You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone https://github.com/common-workflow-language/cwltool
cd cwltool
git checkout dependabot/pip/mypy-1.7.0
make dev
MYPYPATH=mypy-stubs CWLTOOL_USE_MYPYC=1 pip install --verbose -e .
pytest -k '(test_listing_deep or test_cwltool_options or test_passthrough_successive or test_listing_v1_0 or test_disable_dir_overwrite_without_ext or test_disable_dir_creation_in_outdir_with_ext or test_warn_large_inputs or test_directory_workflow)'
# any of these tests will trigger the error, I'm just being comprehensive
Expected Behavior
Tests pass without failure
Actual Behavior
ERROR cwltool:test_ext.py:30 Got workflow error
Traceback (most recent call last):
File "cwltool/executors.py", line 220, in run_jobs
for job in jobiter:
File "cwltool/command_line_tool.py", line 963, in job
builder = self._init_job(job_order, runtimeContext)
File "cwltool/process.py", line 788, in _init_job
visit_class(v, ("Directory",), lambda x: inc(dircount)) # noqa: B023
File "cwltool/utils.py", line 219, in visit_class
op(rec)
File "cwltool/process.py", line 788, in <lambda>
visit_class(v, ("Directory",), lambda x: inc(dircount)) # noqa: B023
AttributeError: attribute 'inc' of '_init_job_Process_env' undefined
ERROR cwltool:test_ext.py:30 Workflow error, try again with --debug for more information:
attribute 'inc' of '_init_job_Process_env' undefined
Your Environment
Mypy version used: 1.7.0
Mypy command-line flags:
Mypy configuration options from mypy.ini (and other config files):
Python version used: 3.11.2, but also 3.8, 3.9, 3.11, and 3.12
[case testCallNestedFunctionWithLambda]
def f(x: int) -> int:
def inc(x: int) -> int:
return x + 1
return (lambda x: inc(x))(1)
[file driver.py]
from native import f
print(f(1))
[out]
2
Fails with
Traceback (most recent call last):
File "driver.py", line 2, in <module>
print(f(1))
^^^^
File "run-functions.test", line 1294, in f
return (lambda x: inc(x))(1)
File "run-functions.test", line 1294, in <lambda>
return (lambda x: inc(x))(1)
AttributeError: attribute 'inc' of 'f_env' undefined
Activity
AlexWaygood commentedon Nov 13, 2023
cc. @JukkaL
ilevkivskyi commentedon Nov 13, 2023
A standalone mypyc test case to reproduce
Fails with
ilevkivskyi commentedon Nov 13, 2023
Also same crash in a test that doesn't involve a lambda:
[mypyc] Fix regression with nested functions (#16484)
[mypyc] Fix regression with nested functions (#16484)