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

Remove legacy ast support (pre 3.9) #172

Merged
merged 7 commits into from
Mar 9, 2025
Merged

Remove legacy ast support (pre 3.9) #172

merged 7 commits into from
Mar 9, 2025

Conversation

gordonwatts
Copy link
Member

@gordonwatts gordonwatts commented Mar 9, 2025

Since we no longer supporting Python 3.7, a lot of legacy code can be removed. This will be required anyway as we move to python 3.14 where a lot of this stuff simply disappears.

  • Remove all ast.Num support
  • Remove all ast.Str support
  • Remove all ast.NameConstant support
  • Update use of ast.expr to remove lots of cast operations.

Fixes #171

@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.27%. Comparing base (0d87c94) to head (4ff656f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
+ Coverage   96.92%   97.27%   +0.34%     
==========================================
  Files          15       15              
  Lines        1334     1319      -15     
==========================================
- Hits         1293     1283      -10     
+ Misses         41       36       -5     
Flag Coverage Δ
unittests 97.27% <100.00%> (+0.34%) ⬆️

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.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gordonwatts gordonwatts self-assigned this Mar 9, 2025
@gordonwatts gordonwatts added the enhancement New feature or request label Mar 9, 2025
@gordonwatts gordonwatts merged commit 4f1245e into master Mar 9, 2025
32 checks passed
@gordonwatts gordonwatts deleted the feat/astConstant branch March 9, 2025 15:03
gordonwatts added a commit that referenced this pull request Mar 10, 2025
* Remove ast.Num

* Remove ast.Str

* Remove ast.NameConstant

* Move to value for constant

* Remove ast.Index as well

* Fix up pylance errors due to `ast.expr`

* Fix up a few flake8 import errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert everthing to only use ast.Constant - and drop ast.Num.
2 participants