Skip to content

Commit 3222dab

Browse files
authored
Merge pull request #524 from ExaWorks/typing_fixes
Typing fixes
2 parents dc1b82e + 12ca095 commit 3222dab

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/psij/_plugins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def _register_plugin(desc: Descriptor, root_path: str, type: str,
5353
mod = importlib.util.module_from_spec(spec)
5454
spec.loader.exec_module(mod) # type: ignore
5555
cls = getattr(mod, cls_name)
56-
cls.__psij_file__ = mod_path # type: ignore
56+
cls.__psij_file__ = mod_path
5757
except Exception as ex:
5858
s = str(ex)
5959
logger.info(s)

src/psij/job_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def __init__(self, executable: Optional[str] = None, arguments: Optional[List[st
137137
# care of the conversion, but mypy gets confused
138138
self._directory = _to_path(directory)
139139
self.inherit_environment = inherit_environment
140-
self.environment = _to_env_dict(environment)
140+
self._environment = _to_env_dict(environment)
141141
self._stdin_path = _to_path(stdin_path)
142142
self._stdout_path = _to_path(stdout_path)
143143
self._stderr_path = _to_path(stderr_path)

tests/test_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_env_var(execparams: ExecutorTestParams) -> None:
142142
arguments=['-c', 'env > /tmp/t; echo -n $TEST_VAR$TEST_INT'],
143143
stdout_path=outp))
144144
assert job.spec is not None
145-
job.spec.environment = {'TEST_INT': 1, 'TEST_VAR': '_y_'} # type: ignore
145+
job.spec.environment = {'TEST_INT': 1, 'TEST_VAR': '_y_'}
146146
ex = _get_executor_instance(execparams, job)
147147
ex.submit(job)
148148
status = job.wait(timeout=_get_timeout(execparams))

tests/test_job_spec.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ def test_environment_types() -> None:
2929
assert spec.environment is None
3030

3131
spec = JobSpec(environment={'foo': 'bar'})
32-
assert spec.environment['foo'] == 'bar' # type: ignore
32+
assert spec.environment is not None
33+
assert spec.environment['foo'] == 'bar'
3334

3435
spec = JobSpec()
3536
spec.environment = {'foo': 'bar'}
37+
assert spec.environment is not None
3638
assert spec.environment['foo'] == 'bar'
3739

38-
spec.environment = {'foo': 'biz', 'bar': 42} # type: ignore
40+
spec.environment = {'foo': 'biz', 'bar': 42}
3941
assert spec.environment['foo'] == 'biz'
4042
assert spec.environment['bar'] == '42'
4143

0 commit comments

Comments
 (0)