Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow mypy to run self check on PyPy - #11350

Merged
JukkaL merged 3 commits into
masterfrom
pypy
Oct 19, 2021
Merged

Allow mypy to run self check on PyPy#11350
JukkaL merged 3 commits into
masterfrom
pypy

Conversation

@emmatyping

Copy link
Copy Markdown
Member

Description

A few lines change required to have mypy run on PyPy, to the extent that it can run self-check. Note this requires the new PyPy 3.8 beta to work.

Test Plan

None.

I don't expect tests to pass because things like lxml and such are not available for PyPy, so I don't think we should integrate testing (yet).

@hauntsaninja hauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! We could run just self check using PyPy in CI

@emmatyping

Copy link
Copy Markdown
Member Author

Thanks! We could run just self check using PyPy in CI

Yeah I'll open a follow up issue to do that, but for now Github actions doesn't support PyPy 3.8 (it is still in beta to be fair) so we will have to wait.

I also added a slight tweak to the FAQ about PyPy 3.8

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Cool!

@JukkaL
JukkaL merged commit 4d0ab44 into master Oct 19, 2021
@JukkaL
JukkaL deleted the pypy branch October 19, 2021 15:09
@mattip

mattip commented Oct 20, 2021

Copy link
Copy Markdown

This is great news. The setup-python github action supports any pypy in pypy's versions.json, so you should be able to add a pypy-3.8 run if you want.

Comment thread test-requirements.txt
pytest-forked>=1.3.0,<2.0.0
pytest-cov>=2.10.0,<3.0.0
py>=1.5.2
typed_ast>=1.4.0,<1.5.0; python_version>='3.8'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Isn;t python_version>='3.8' backwards?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, we still need typed_ast for the Python 2 tests even on newer Python 3.xs

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

hmm, so eventually there will be some acrobatics needed to exclude pypy and skip those tests

typed_ast>=1.4.0,<1.5.0; python_version>='3.8' and platform_python_implementation != 'PyPy'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes :/ for now we are just going to run mypy on itself. At some point we can look into actual test coverage, but wheels for dependencies like lxml and psutil aren't available on Windows so that's already an issue.

tushar-deepsource pushed a commit to DeepSourceCorp/mypy that referenced this pull request Jan 20, 2022
A few lines change required to have mypy run on PyPy, to the extent that it 
can run self-check. Note this requires the new PyPy 3.8 beta to work.

I don't expect tests to pass because things like lxml and such are not available 
for PyPy, so I don't think we should integrate testing (yet).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants