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

Drop support for Python 3.8 #2443

Merged
merged 7 commits into from
May 20, 2024
Merged

Drop support for Python 3.8 #2443

merged 7 commits into from
May 20, 2024

Conversation

jacobtylerwalls
Copy link
Member

3.8 is EOL in late October 2024, and 3.13 final is scheduled for early October 2024. Aiming for new minor releases of astroid and pylint by then to drop support for 3.8 and add support for 3.13.

@jacobtylerwalls jacobtylerwalls added the Maintenance Discussion or action around maintaining astroid or the dev workflow label May 19, 2024
@jacobtylerwalls jacobtylerwalls added this to the 3.3.0 milestone May 19, 2024
@jacobtylerwalls
Copy link
Member Author

pre-commit.ci autofix

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Releasing the review before completion because I don't want to comment n time the same thing, if I'm misguided in saying that every condition that has PY38 and something else can be removed entirely.

ChangeLog Outdated Show resolved Hide resolved
# The ast parser of python < 3.8 sets col_offset of multi-line strings to -1
# as it is unable to determine the value correctly. We reset this to None.
if doc_ast_node.col_offset == -1:
doc_ast_node.col_offset = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ho, this one is going to be a nice cleanup in pylint's testutil / functional !

astroid/rebuilder.py Outdated Show resolved Hide resolved
astroid/rebuilder.py Outdated Show resolved Hide resolved
tests/test_nodes_lineno.py Outdated Show resolved Hide resolved
astroid/nodes/scoped_nodes/scoped_nodes.py Outdated Show resolved Hide resolved
@jacobtylerwalls
Copy link
Member Author

Yeah, I just caught that myself. Sorry!

Copy link

codecov bot commented May 19, 2024

Codecov Report

Attention: Patch coverage is 94.28571% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.75%. Comparing base (03db5c1) to head (cc9ffb9).
Report is 80 commits behind head on main.

Files Patch % Lines
astroid/brain/brain_dataclasses.py 71.42% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2443      +/-   ##
==========================================
- Coverage   92.79%   92.75%   -0.04%     
==========================================
  Files          94       94              
  Lines       11118    11045      -73     
==========================================
- Hits        10317    10245      -72     
+ Misses        801      800       -1     
Flag Coverage Δ
linux 92.63% <94.28%> (+0.04%) ⬆️
pypy 92.75% <94.28%> (-0.04%) ⬇️
windows 92.73% <94.28%> (+0.04%) ⬆️

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

Files Coverage Δ
astroid/_backport_stdlib_names.py 100.00% <100.00%> (+8.33%) ⬆️
astroid/brain/brain_builtin_inference.py 92.05% <100.00%> (ø)
astroid/brain/brain_collections.py 100.00% <100.00%> (ø)
astroid/brain/brain_hashlib.py 100.00% <100.00%> (ø)
astroid/brain/brain_re.py 100.00% <100.00%> (ø)
astroid/brain/brain_regex.py 100.00% <100.00%> (ø)
astroid/brain/brain_subprocess.py 100.00% <100.00%> (ø)
astroid/brain/brain_type.py 100.00% <100.00%> (ø)
astroid/brain/brain_typing.py 87.26% <100.00%> (-0.47%) ⬇️
astroid/const.py 100.00% <ø> (ø)
... and 11 more

... and 1 file with indirect coverage changes

Copy link
Member

@cdce8p cdce8p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably have done that in multiple steps / PRs, like

  • Update CI + do code changes to remove 3.8 special cases
  • Update tests
  • Update typing + ruff and pylint to 3.9.0

Might be easier to follow when reviewing it later, but this works the same.

--
In general, I do support removing support for 3.8. We could even do it fairly soon IMO. Maybe after the PEP 695 fix is merged and one last bugfix release created?

For pylint, we should just make sure to bump the minor version and update requires-python when we pull in the new astroid release. The code changes to remove 3.8 can follow later as well.

astroid/brain/brain_hashlib.py Outdated Show resolved Hide resolved
astroid/brain/brain_subprocess.py Outdated Show resolved Hide resolved
astroid/brain/brain_typing.py Show resolved Hide resolved
astroid/rebuilder.py Outdated Show resolved Hide resolved
astroid/rebuilder.py Outdated Show resolved Hide resolved
tests/test_nodes_lineno.py Outdated Show resolved Hide resolved
tests/test_nodes_lineno.py Outdated Show resolved Hide resolved
tests/test_nodes_lineno.py Outdated Show resolved Hide resolved
Copy link
Member

@cdce8p cdce8p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @jacobtylerwalls 👍🏻

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

byebye400lines

... So much joy.

astroid/_backport_stdlib_names.py Show resolved Hide resolved
@@ -74,20 +73,6 @@
except AttributeError:
pass

if IS_PYPY and sys.version_info < (3, 8):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, look like we forgot to remove when dropping 3.7

@Pierre-Sassoulas Pierre-Sassoulas merged commit 7ff0f4f into main May 20, 2024
17 of 18 checks passed
@Pierre-Sassoulas Pierre-Sassoulas deleted the drop-38 branch May 20, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining astroid or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants