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

Bump PyPy runtime to v3.9 @ GHA #12557

Merged
merged 3 commits into from
Jul 19, 2024

Conversation

x612skm
Copy link
Contributor

@x612skm x612skm commented Jul 1, 2024

As we were encountering this -

 __________________ ERROR collecting testing/_py/test_local.py __________________
/opt/hostedtoolcache/PyPy/3.8.16/x64/lib/pypy3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1023: in _gcd_import
    ???
<frozen importlib._bootstrap>:1000: in _find_and_load
    ???
<frozen importlib._bootstrap>:984: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:680: in _load_unlocked
    ???
.tox/pypy3-xdist/lib/pypy3.8/site-packages/_pytest/assertion/rewrite.py:166: in exec_module
    source_stat, co = _rewrite_test(fn, self.config)
.tox/pypy3-xdist/lib/pypy3.8/site-packages/_pytest/assertion/rewrite.py:350: in _rewrite_test
    co = compile(tree, strfn, "exec", dont_inherit=True)
E   TypeError: expected some sort of stmt, but got <_ast.Store object at 0x0000000002142880>

Due to the PyPy version 3.8 which has a bug at its garbage collector and its EoL. Hence bumping the PyPy version to resolve the issue.

Closes #11771

@webknjaz webknjaz self-requested a review July 1, 2024 17:22
@webknjaz webknjaz self-assigned this Jul 1, 2024
@webknjaz
Copy link
Member

webknjaz commented Jul 1, 2024

Note for other maintainers: please, ignore this PR for now. I'm walking a mentee through the contribution process.

@webknjaz
Copy link
Member

webknjaz commented Jul 1, 2024

Looking at https://github.com/pytest-dev/pytest/actions/runs/9748380501/job/26903269973?pr=12557#step:6:138, it seems like this PR might also need to adjust the tests.

@x612skm x612skm marked this pull request as draft July 1, 2024 18:12
@x612skm x612skm force-pushed the maintainence/11771-pypy-3.9-bump branch 5 times, most recently from 9a94f46 to c03089b Compare July 2, 2024 18:36
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jul 4, 2024
@x612skm x612skm marked this pull request as ready for review July 19, 2024 12:12
x612skm and others added 3 commits July 19, 2024 18:06
PyPy 3.8 has a flaky bug in the garbage collector that is not going to
be fixed there since that version is EoL, but newer versions have it
addressed.

The problem manifests itself in CI as follows:

    ```console
    TypeError: expected some sort of stmt, but got <_ast.Load object ...>
    ```

This patch makes use of the PyPy version that is still supported
and contains a fix for the said bug.

Ref: https://www.pypy.org/posts/2024/03/fixing-bug-incremental-gc.html

Resolves pytest-dev#11771.
It appears that newer PyPy versions have a different syntax error marker
offset. This patch stripps 7 whitespaces off of the marker line.
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
@x612skm x612skm force-pushed the maintainence/11771-pypy-3.9-bump branch from 3649e2b to ced7072 Compare July 19, 2024 12:41
@x612skm x612skm requested a review from webknjaz July 19, 2024 12:41
@webknjaz webknjaz enabled auto-merge July 19, 2024 12:42
@webknjaz webknjaz merged commit a7d5a8e into pytest-dev:main Jul 19, 2024
28 of 29 checks passed
Copy link

patchback bot commented Jul 19, 2024

Backport to 8.2.x: 💚 backport PR created

✅ Backport PR branch: patchback/backports/8.2.x/a7d5a8eba9addd119432fa71880b51052a89812f/pr-12557

Backported as #12632

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@nicoddemus
Copy link
Member

nicoddemus commented Jul 19, 2024

@webknjaz just a quick reminder, probably would have been best to squash/merge this instead of a normal merge, as the individual commits do not add much to the history. 👍

@webknjaz
Copy link
Member

@nicoddemus my understanding is that it's okay to use natural merge when the incoming commits aren't a mess. I usually only use the fake merge modes like squash when nothing else can save the history.

@nicoddemus
Copy link
Member

I'm not sure this is a consensus, but I usually only keep commits when they make sense separately, which was not the case here: I don't see the value of having a commit implementing a feature, a separate commit adding a changelog, and another one adding someone to AUTHORS -- this is of course fine for development, but it is not useful months or years down the road when reviewing the history.

@RonnyPfannschmidt @bluetech @The-Compiler what are your opinions here?

@nicoddemus
Copy link
Member

Actually I will move this to a separate discussion, I think it is probably best to discuss this properly.

@nicoddemus
Copy link
Member

#12633 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided (automation) changelog entry is part of PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Selftests sometimes fail on pypy: TypeError: expected some sort of stmt, but got <_ast.Load object ...>
3 participants