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

21.6.0: mypy errors #54

Closed
mtelka opened this issue Feb 17, 2023 · 4 comments · Fixed by #59
Closed

21.6.0: mypy errors #54

mtelka opened this issue Feb 17, 2023 · 4 comments · Fixed by #59
Milestone

Comments

@mtelka
Copy link

mtelka commented Feb 17, 2023

$ python -m mypy.stubtest --allowlist dev/mypy.allowlist contextlib2
error: not checking stubs due to mypy build errors:
contextlib2/__init__.pyi:41: error: Class contextlib2._GeneratorContextManager has abstract attributes "__exit__"  [misc]
contextlib2/__init__.pyi:41: note: If it is meant to be abstract, add 'abc.ABCMeta' as an explicit metaclass
contextlib2/__init__.pyi:55: error: Class contextlib2.closing has abstract attributes "__exit__"  [misc]
contextlib2/__init__.pyi:55: note: If it is meant to be abstract, add 'abc.ABCMeta' as an explicit metaclass
contextlib2/__init__.pyi:62: error: Class contextlib2.aclosing has abstract attributes "__aexit__"  [misc]
contextlib2/__init__.pyi:62: note: If it is meant to be abstract, add 'abc.ABCMeta' as an explicit metaclass
contextlib2/__init__.pyi:74: error: Class contextlib2.redirect_stdout has abstract attributes "__exit__"  [misc]
contextlib2/__init__.pyi:74: note: If it is meant to be abstract, add 'abc.ABCMeta' as an explicit metaclass
contextlib2/__init__.pyi:77: error: Class contextlib2.redirect_stderr has abstract attributes "__exit__"  [misc]
contextlib2/__init__.pyi:77: note: If it is meant to be abstract, add 'abc.ABCMeta' as an explicit metaclass
contextlib2/__init__.pyi:116: error: Return type "Awaitable[AsyncExitStack]" of "__aenter__" incompatible with return type "Coroutine[Any, Any, AsyncExitStack]" in supertype "AbstractAsyncContextManager"  [override]
contextlib2/__init__.pyi:117: error: Return type "Awaitable[bool]" of "__aexit__" incompatible with return type "Coroutine[Any, Any, Optional[bool]]" in supertype "AbstractAsyncContextManager"  [override]
$
@ncoghlan
Copy link
Collaborator

ncoghlan commented May 22, 2024

This may be covered by #43 (updating to a new base version of all the contextlib files)

@ncoghlan
Copy link
Collaborator

Getting CI running again showed that the nominally python3.10 test environment wasn't actually running on Python 3.10, it was running on whatever happened to be the system Python in the GitHub action containers. This was 3.8 in the old Ubuntu 20.04 runners, and only went up to 3.10 when the runners updated to Ubuntu 22.04

That was after the last merged contextlib2 update (which synced with the Python 3.10 beta version in June 2021), hence this problem not being detected in CI.

@ncoghlan
Copy link
Collaborator

I take that back, it is failing everywhere (maybe a newer mypy is the issue?). Turning off the check for now, will turn it back on after the sync with newer versions.

ncoghlan added a commit that referenced this issue May 22, 2024
* sync with latest typeshed stub file (closes #54)
* publish `dev/mypy.allowlist` in sdist (closes #53)
* drop Python 3.7 support due to positional-only arg
  syntax in the updated stub file
ncoghlan added a commit that referenced this issue May 22, 2024
* sync with latest typeshed stub file (closes #54)
* publish `dev/mypy.allowlist` in sdist (closes #53)
* drop Python 3.7 support due to positional-only arg
  syntax in the updated stub file
ncoghlan added a commit that referenced this issue May 22, 2024
* sync with latest typeshed stub file (closes #54)
* publish `dev/mypy.allowlist` in sdist (closes #53)
* drop Python 3.7 support due to positional-only arg
  syntax in the updated stub file
@ncoghlan ncoghlan added this to the 24.6.0 milestone May 22, 2024
@ncoghlan
Copy link
Collaborator

I did run into one weird apparent mypy misbehaviour while working on this: python/mypy#17277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants