Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mypy failing when follow CONTRIBUTING instructions #202

Open
dschristianson opened this issue Sep 23, 2024 · 0 comments
Open

mypy failing when follow CONTRIBUTING instructions #202

dschristianson opened this issue Sep 23, 2024 · 0 comments
Labels
BASIN-3D bug Something isn't working

Comments

@dschristianson
Copy link
Contributor

Describe the bug
When pytest is run following the development configuration instructions in CONTRIBUTING (line 40), mypy fails.
The issue seems to be in calling mypy from pytest via the pytest.ini config.
Note that pytest seems to using plugin mypy-0.10.3 while when running separately, mypy version = 1.11.2.
See stack trace and more info below.

To Reproduce
Follow configuration instructions in CONTRIBUTING. I tested environments with python 3.8 and 3.10.

Expected behavior
All tests should pass.

Desktop (please complete the following information):

  • Python 3.8 and 3.10

Additional context

Stacktrace:

tests/integration/__init__.py::mypy 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/main.py", line 283, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/main.py", line 337, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 139, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/logging.py", line 803, in pytest_runtestloop
INTERNALERROR>     return (yield)  # Run all the tests.
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/terminal.py", line 673, in pytest_runtestloop
INTERNALERROR>     result = yield
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/main.py", line 362, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 139, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/warnings.py", line 112, in pytest_runtest_protocol
INTERNALERROR>     return (yield)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/assertion/__init__.py", line 176, in pytest_runtest_protocol
INTERNALERROR>     return (yield)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/unittest.py", line 429, in pytest_runtest_protocol
INTERNALERROR>     res = yield
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/faulthandler.py", line 88, in pytest_runtest_protocol
INTERNALERROR>     return (yield)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/runner.py", line 113, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/runner.py", line 126, in runtestprotocol
INTERNALERROR>     rep = call_and_report(item, "setup", log)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/runner.py", line 244, in call_and_report
INTERNALERROR>     report: TestReport = ihook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 139, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/tmpdir.py", line 318, in pytest_runtest_makereport
INTERNALERROR>     rep = yield
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/skipping.py", line 269, in pytest_runtest_makereport
INTERNALERROR>     rep = yield
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/runner.py", line 368, in pytest_runtest_makereport
INTERNALERROR>     return TestReport.from_item_and_call(item, call)
INTERNALERROR>   File "/opt/anaconda3/envs/basin3d-38sqlal/lib/python3.8/site-packages/_pytest/reports.py", line 369, in from_item_and_call
INTERNALERROR>     assert line is not None
INTERNALERROR> AssertionError

I tried a few things to troubleshoot:

  1. With python 3.10, I changed the python version in the mypy.ini file.
  2. I removed the --mypy option in the pytest.ini file to confirm that it was calling mypy from this mode. All other pytests pass.
  3. Running mypy separately, all mypy checks pass.
@dschristianson dschristianson added bug Something isn't working BASIN-3D labels Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BASIN-3D bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant