KEMBAR78
Allow mypy to run self check on PyPy by emmatyping · Pull Request #11350 · python/mypy · GitHub
Skip to content

Conversation

emmatyping
Copy link
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).

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

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
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

Copy link
Collaborator

@JukkaL JukkaL left a comment

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
Copy link

mattip commented Oct 20, 2021

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.

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

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
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

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
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