-
Notifications
You must be signed in to change notification settings - Fork 6
Fix typing for Python 3.9 and remove support for Python 3.13 #259
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
Conversation
931ef1d to
3782d1c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## stable #259 +/- ##
==========================================
+ Coverage 70.31% 70.33% +0.02%
==========================================
Files 81 81
Lines 7502 7505 +3
Branches 1391 1463 +72
==========================================
+ Hits 5275 5279 +4
+ Misses 1852 1847 -5
- Partials 375 379 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
0ad5dc9 to
304dfe5
Compare
951face to
a19d50d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I wonder if it's fixed in later versions of Typer. We have it pinned to 0.12.5 in the lock file and with the typer = { version = "^0.12.3", optional = true } since it's below 1.0 we don't actually support the newer 0.13, 0.14 and 0.15 versions of Typer.
pyproject.toml
Outdated
| ] | ||
|
|
||
| "infrahub_sdk/ctl/**/*.py" = [ | ||
| "UP007", # Use `X | Y` for type annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this was only related to Typer can you add this as a comment to indicate why we have this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I added a comment
Regarding Typer 0.15, I tried but the issue was still present
a19d50d to
b61ea64
Compare
b61ea64 to
1aa09f5
Compare
Fixes #251
Fixes #253
This PR removes the support for Python 3.13 and fixes the typing issues for
infrahubctlfor Python 3.9 by reverting to the old annotation (Optional).The root cause of the issue seams to be with Typer that doesn't support this format prior to 3.10.
Also, this PR implement the fix proposed in #250 by @FragmentedPacket to ensure the tests are running with the right version of Python in CI.