8000 Set ruff `target-version` to the minimum supported version of Python by tleonhardt · Pull Request #1441 · python-cmd2/cmd2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Set ruff target-version to the minimum supported version of Python #1441

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

Merged
merged 1 commit into from
Jun 8, 2025

Conversation

tleonhardt
Copy link
Member
@tleonhardt tleonhardt commented Jun 8, 2025

Set ruff target-version to the minimum supported version of Python, in our current case py39.

Ignore ruff FA100 warning about adding import for future annotations. I tried it but it wreaked havoc due to how cmd2 actively validates type hints using inspect. If you use future annotations it delays evaluation until necessary, which benefits runtime performance but converts all type annotations to strings instead of types.

Also:

  • cleaned up how we specify ruff per-file ignores
  • fixed a couple minor performance issues ruff warned about

Ignore warning about adding import for future annotations. I tried it but it wreaked havoc due to how cmd2 actively validates type hints using inspect.
If you use future annotations it delays evaluation until necessary, which benefits runtime performance but converts all type annotations to strings instead of types.

Also, cleaned up how we specify ruff per-file ignores.
Copy link
codecov bot commented Jun 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.55%. Comparing base (28f226a) to head (7402581).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1441      +/-   ##
==========================================
- Coverage   98.56%   98.55%   -0.02%     
==========================================
  Files          20       20              
  Lines        5726     5726              
==========================================
- Hits         5644     5643       -1     
- Misses         82       83       +1     
Flag Coverage Δ
unittests 98.55% <100.00%> (-0.02%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tleonhardt tleonhardt merged commit 8d1c82c into master Jun 8, 2025
29 of 30 checks passed
@tleonhardt tleonhardt deleted the ruff-min-version branch June 8, 2025 18:41
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 this pull request may close these issues.

1 participant
0