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

Fix PyPy ClassDef.fromlino with decorators #1979

Merged
merged 1 commit into from
Jan 28, 2023

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Jan 28, 2023

Description

Followup to #1910
Never got around to reviewing it in time unfortunately.

The last PyPy release for 3.8 (v7.3.11) actually provided a fix for the ast lineno issue and is now compliant with the cpython implementation.

https://doc.pypy.org/en/latest/release-v7.3.11.html#python-3-8

/CC: @Pierre-Sassoulas

@@ -2139,9 +2139,10 @@ def _newstyle_impl(self, context: InferenceContext | None = None):
@cached_property
def fromlineno(self) -> int | None:
"""The first line that this node appears on in the source code."""
if not PY38_PLUS or PY38 and IS_PYPY:
if not PY38_PLUS or IS_PYPY and PY38 and not PYPY_7_3_11_PLUS:
Copy link
Member Author

Choose a reason for hiding this comment

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

Do we want to support multiple PyPy versions? I guess it's simple enough here, although I wouldn't add any more to CI.

Copy link
Member

Choose a reason for hiding this comment

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

This feel like a lot of work but also added values. I guess on a case by case basis... ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This feel like a lot of work but also added values. I guess on a case by case basis... ?

Yeah, I was more referring to this specific case 😄

@@ -15,6 +15,8 @@ Release date: TBA
* Fix issues with ``typing_extensions.TypeVar``.


* Fix ``ClassDef.fromlino`` for PyPy 3.8 (v7.3.11) if class is wrapped by a decorator.
Copy link
Member Author

Choose a reason for hiding this comment

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

I can move this to 2.14.0 if we want to skip 2.13.4.

Copy link
Member

Choose a reason for hiding this comment

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

Let's not skip, releasing is cheap (compared to fixing the milestones)

@cdce8p cdce8p added this to the 2.13.4 milestone Jan 28, 2023
@codecov
Copy link

codecov bot commented Jan 28, 2023

Codecov Report

Merging #1979 (0d84846) into main (0c9ab0f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1979   +/-   ##
=======================================
  Coverage   92.65%   92.65%           
=======================================
  Files          94       94           
  Lines       10902    10903    +1     
=======================================
+ Hits        10101    10102    +1     
  Misses        801      801           
Flag Coverage Δ
linux 92.41% <100.00%> (+<0.01%) ⬆️
pypy 88.53% <100.00%> (+<0.01%) ⬆️
windows 92.33% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
astroid/const.py 100.00% <100.00%> (ø)
astroid/nodes/scoped_nodes/scoped_nodes.py 92.94% <100.00%> (ø)

@cdce8p cdce8p merged commit dfd88f5 into pylint-dev:main Jan 28, 2023
@cdce8p cdce8p deleted the pypy-classdef-lineno branch January 28, 2023 09:30
github-actions bot pushed a commit that referenced this pull request Jan 28, 2023
cdce8p added a commit that referenced this pull request Jan 28, 2023
(cherry picked from commit dfd88f5)

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
@cdce8p cdce8p added the backported Assigned once the backport is done label Jan 31, 2023
@cdce8p cdce8p modified the milestone: 2.13.4 Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ast backported Assigned once the backport is done PyPy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants