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

Python 3.10 support #9

Closed
flipixwork opened this issue Oct 6, 2024 · 2 comments · Fixed by #11
Closed

Python 3.10 support #9

flipixwork opened this issue Oct 6, 2024 · 2 comments · Fixed by #11

Comments

@flipixwork
Copy link

After adding Self to hardware.py and build.py, support for version 3.10 broke.

joelspadin added a commit to joelspadin/zmk-cli that referenced this issue Oct 6, 2024
typing.Self requires Python 3.11. Replaced it with the class name for
types that aren't subclassed or a TypeVar for types that are.

The type annotation on Hardware.from_dict() must be given as a string,
or pyupgrade will convert it to type[_Self], which breaks because
Hardware has a member named "type" (which cannot be renamed since it
must match the name of the YAML files the class represents).

Fixes zmkfirmware#9
joelspadin added a commit that referenced this issue Oct 6, 2024
typing.Self requires Python 3.11. Replaced it with the class name for
types that aren't subclassed or a TypeVar for types that are.

The type annotation on Hardware.from_dict() must be given as a string,
or pyupgrade will convert it to type[_Self], which breaks because
Hardware has a member named "type" (which cannot be renamed since it
must match the name of the YAML files the class represents).

Fixes #9
@joelspadin
Copy link
Collaborator

Thanks for the report. Can you check if version 0.1.3 fixes the issue?

@flipixwork
Copy link
Author

All works, thanks.

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