Skip to content

Conversation

@dgarros
Copy link
Contributor

@dgarros dgarros commented Jan 30, 2025

Fixes #251
Fixes #253

This PR removes the support for Python 3.13 and fixes the typing issues for infrahubctl for 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.

@dgarros dgarros force-pushed the dga-20250130-fix-253 branch from 931ef1d to 3782d1c Compare January 30, 2025 20:19
@github-actions github-actions bot added the group/ci Issue related to the CI pipeline label Jan 30, 2025
@codecov
Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All 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     
Flag Coverage Δ
integration-tests 22.43% <0.00%> (-0.01%) ⬇️
python-3.10 45.50% <100.00%> (+0.02%) ⬆️
python-3.11 45.50% <100.00%> (+0.02%) ⬆️
python-3.12 45.50% <100.00%> (+0.02%) ⬆️
python-3.13 ?
python-3.9 44.32% <100.00%> (-1.16%) ⬇️
python-filler-3.12 23.99% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
infrahub_sdk/ctl/check.py 27.04% <100.00%> (ø)
infrahub_sdk/ctl/cli_commands.py 58.59% <100.00%> (ø)
infrahub_sdk/ctl/generator.py 23.21% <100.00%> (ø)
infrahub_sdk/ctl/importer.py 59.09% <100.00%> (+1.94%) ⬆️
infrahub_sdk/ctl/repository.py 81.81% <100.00%> (+0.23%) ⬆️
infrahub_sdk/ctl/utils.py 66.42% <100.00%> (ø)
infrahub_sdk/ctl/validate.py 53.52% <100.00%> (+0.66%) ⬆️

... and 4 files with indirect coverage changes

@dgarros dgarros force-pushed the dga-20250130-fix-253 branch 2 times, most recently from 0ad5dc9 to 304dfe5 Compare February 20, 2025 05:42
@dgarros dgarros force-pushed the dga-20250130-fix-253 branch from 951face to a19d50d Compare February 20, 2025 05:50
@dgarros dgarros requested a review from a team February 20, 2025 05:56
@dgarros dgarros marked this pull request as ready for review February 20, 2025 05:57
@dgarros dgarros added the type/bug Something isn't working as expected label Feb 20, 2025
Copy link
Contributor

@ogenstad ogenstad left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

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

@dgarros dgarros force-pushed the dga-20250130-fix-253 branch from a19d50d to b61ea64 Compare February 20, 2025 07:41
@dgarros dgarros force-pushed the dga-20250130-fix-253 branch from b61ea64 to 1aa09f5 Compare February 21, 2025 14:51
@dgarros dgarros merged commit 3870abe into stable Feb 21, 2025
14 checks passed
@dgarros dgarros deleted the dga-20250130-fix-253 branch February 21, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group/ci Issue related to the CI pipeline type/bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Temporarily remove the support for Python 3.13 bug: TypeError when executing CTL

2 participants