diff --git a/src/psij/_plugins.py b/src/psij/_plugins.py index 4b8b9121..07ec1041 100644 --- a/src/psij/_plugins.py +++ b/src/psij/_plugins.py @@ -53,7 +53,7 @@ def _register_plugin(desc: Descriptor, root_path: str, type: str, mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(mod) # type: ignore cls = getattr(mod, cls_name) - cls.__psij_file__ = mod_path # type: ignore + cls.__psij_file__ = mod_path except Exception as ex: s = str(ex) logger.info(s) diff --git a/src/psij/job_spec.py b/src/psij/job_spec.py index e3585d0d..f4d383e2 100644 --- a/src/psij/job_spec.py +++ b/src/psij/job_spec.py @@ -137,7 +137,7 @@ def __init__(self, executable: Optional[str] = None, arguments: Optional[List[st # care of the conversion, but mypy gets confused self._directory = _to_path(directory) self.inherit_environment = inherit_environment - self.environment = _to_env_dict(environment) + self._environment = _to_env_dict(environment) self._stdin_path = _to_path(stdin_path) self._stdout_path = _to_path(stdout_path) self._stderr_path = _to_path(stderr_path) diff --git a/tests/test_executor.py b/tests/test_executor.py index ac6bef0e..83090ecc 100644 --- a/tests/test_executor.py +++ b/tests/test_executor.py @@ -142,7 +142,7 @@ def test_env_var(execparams: ExecutorTestParams) -> None: arguments=['-c', 'env > /tmp/t; echo -n $TEST_VAR$TEST_INT'], stdout_path=outp)) assert job.spec is not None - job.spec.environment = {'TEST_INT': 1, 'TEST_VAR': '_y_'} # type: ignore + job.spec.environment = {'TEST_INT': 1, 'TEST_VAR': '_y_'} ex = _get_executor_instance(execparams, job) ex.submit(job) status = job.wait(timeout=_get_timeout(execparams)) diff --git a/tests/test_job_spec.py b/tests/test_job_spec.py index f02b6305..1c40618f 100644 --- a/tests/test_job_spec.py +++ b/tests/test_job_spec.py @@ -29,13 +29,15 @@ def test_environment_types() -> None: assert spec.environment is None spec = JobSpec(environment={'foo': 'bar'}) - assert spec.environment['foo'] == 'bar' # type: ignore + assert spec.environment is not None + assert spec.environment['foo'] == 'bar' spec = JobSpec() spec.environment = {'foo': 'bar'} + assert spec.environment is not None assert spec.environment['foo'] == 'bar' - spec.environment = {'foo': 'biz', 'bar': 42} # type: ignore + spec.environment = {'foo': 'biz', 'bar': 42} assert spec.environment['foo'] == 'biz' assert spec.environment['bar'] == '42'