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

Match nox sessions python version with GA on typeguard #1102

Closed
staticdev opened this issue Jan 2, 2022 · 2 comments · Fixed by cjolowicz/cookiecutter-hypermodern-python-instance#764

Comments

@staticdev
Copy link
Contributor

Typeguard with from __future__ import annontations does not work well with older versions of Python (throwing lots of TypeError: unsupported operand type(s) for |: 'type' and 'type').

Since typeguard on GA is running only on 3.10, I suggest have the same on nox session. Also typeguard seems a bit abandoned for now, while they do not find a new maintainer.

@cjolowicz
Copy link
Owner

Typeguard is far from abandoned, there is active work on Typeguard 3.0.

Allowing modern type syntax by running the runtime type check only on the latest Python makes sense though, thanks!

FTR one alternative would be keeping Union and Optional type syntax. This requires adding --keep-runtime-types to the pyupgrade hook.

@jeeftor
Copy link

jeeftor commented Oct 15, 2022

I think the hook is:

--keep-runtime-typing

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.

3 participants