Skip to content

Commit

Permalink
Using typing-extensions for 3.9 support of @OverRide
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Jan 22, 2025
1 parent 75ff4a3 commit e149bd2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies = [
'kiwipy[rmq]~=0.8.5',
'nest_asyncio~=1.5,>=1.5.1',
'pyyaml~=6.0',
'typing-extensions~=4.12'
]

[project.urls]
Expand Down
2 changes: 2 additions & 0 deletions src/plumpy/persistence.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import annotations

import abc
import asyncio
import collections
Expand Down
2 changes: 1 addition & 1 deletion src/plumpy/process_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
Union,
cast,
final,
override,
)

import yaml
from typing_extensions import override
from yaml.loader import Loader

from plumpy.message import MessageBuilder, MessageType
Expand Down
6 changes: 3 additions & 3 deletions src/plumpy/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,20 +285,20 @@ def recreate_from(
if 'loop' in load_context:
proc._loop = load_context.loop
else:
_LOGGER.warning(f'cannot find `loop` store in load_context, use default event loop')
_LOGGER.warning('cannot find `loop` store in load_context, use default event loop')
proc._loop = asyncio.get_event_loop()

proc._state = proc.recreate_state(saved_state['_state'])

if 'coordinator' in load_context:
proc._coordinator = load_context.coordinator
else:
_LOGGER.warning(f'cannot find `coordinator` store in load_context')
_LOGGER.warning('cannot find `coordinator` store in load_context')

if 'logger' in load_context:
proc._logger = load_context.logger
else:
_LOGGER.warning(f'cannot find `logger` store in load_context')
_LOGGER.warning('cannot find `logger` store in load_context')

# Need to call this here as things downstream may rely on us having the runtime variable above
persistence.load_auto_persist_params(proc, saved_state, load_context)
Expand Down
2 changes: 2 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e149bd2

Please sign in to comment.