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

Skip memray on pypy #3286

Merged
merged 5 commits into from Jan 23, 2024
Merged

Skip memray on pypy #3286

merged 5 commits into from Jan 23, 2024

Conversation

ecerulm
Copy link
Contributor

@ecerulm ecerulm commented Jan 17, 2024

Currently nox -rs test-pypy can fail with

nox > python -m coverage run --parallel-mode -m pytest --memray --hide-memray-summary -v -ra --color=auto --tb=native --durations=10 --sict-config --strict-markers test/
ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
__main__.py: error: unrecognized arguments: --memray --hide-memray-summary

the cause is that although the code in noxfile.py tries to check if memray is supported, it does the check on the python interpreter that executes nox, not on the python interpreter used inside the session.

This patch disable memray if session.python == "pypy".

Alternatively, we could use session.run() to write the sys.implementation.name, etc to a file and read that from noxfile.py , so that noxfile.py could use the information from the actual python interpreter for the decision, but IMHO it's way more complicated for little benefit

noxfile.py Outdated Show resolved Hide resolved
@ecerulm ecerulm requested a review from pquentin January 18, 2024 15:50
@sethmlarson sethmlarson added the Skip Changelog Pull requests that don't require a changelog entry label Jan 19, 2024
Copy link
Member

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Thanks for this, can you run nox -rs format locally and make sure it passes, lint job is failing on CI.

pquentin
pquentin previously approved these changes Jan 22, 2024
Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thanks! Nearly there.

noxfile.py Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
@pquentin pquentin merged commit 03f7b65 into urllib3:main Jan 23, 2024
30 of 33 checks passed
@ecerulm ecerulm deleted the no_memray_on_pypy branch February 6, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Pull requests that don't require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants