Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport PyPy (easy) #727
Support PyPy (easy) #727
Comments
|
We should also add validation that this works as part of our CI pipeline. |
|
I was going to give this a shot but it seems travis does not yet have pypy 3.6 available. |
|
Azure Pipelines are planning on adding PyPy: microsoft/azure-pipelines-tasks#8514. (See #731 for adding Azure Pipelines with CPython to this repo.) |
|
I was actually targeting my PyPy sprint contributions in Dusseldorf with this in mind so I'm happy it works for you :) To be fully frank, not everything works on PyPy yet, the asyncio parts are failing in particular. |
|
Just as an FYI: I tried configuring this on Travis (see https://github.com/alexchamberlain/black/blob/pypy3/.travis.yml#L36). |
|
if you drop |
|
An update with pypy3.6 v7.2.0:
Wouldn't it be possible to install black without typed-ast on PyPy ? With |
|
For the record, the PR which introduced the |
|
I want to support PyPy but this is going to be a tough sell. PyPy3 is 3.6Well, PyPy3 is now targeting 3.6, working on 3.7. The functionality to parse Python 2 code into an AST on Python 3 was only added in Python 3.8.0. So @zsol is right that we could drop this dependency on Python 3.8 but that doesn't solve the problem for PyPy. We need a Python 2 ASTSadly, we need to be able to convert Python 2 code into AST form to do the sanity checks that Black is doing by default. This found many many bugs and is one of the reasons Black is being trusted by its users even though it's so young of a project. We need a fast Python 2 ASTThe reason we chose typed-ast over pure Python parsers on PyPI is that it's written in C and thus pretty fast. This is important because the sanity check is not really core functionality of Black. Sometimes I ponder if |
|
What about installing |
|
Please take a look. Works in my case: #1172 |
See also: psf/black#727
See also: psf/black#727
All code is updated to use black formatting. https://github.com/psf/black A pyproject.toml file is added with configuration for the black tool. Note that skip-string-normalization is enabled; this allows pyvcd code to continue using single-quoted strings instead of black's default of double-quoted strings. The Makefile's 'lint' and 'format' targets are updated to use black. N.B. there is an issue with installing/running black with pypy3, so instead of including it in requirements.txt, it is installed conditionally in .travis.yml. psf/black#727 python/typed_ast#111
They are conditional on cpython because currently neither tool can be installed in a pypy environment. psf/black#727 python/typed_ast#111
See also: - tony/django-docutils@565013a - psf/black#727
Please consider adding PyPy Trove classifiers, because apparently
blackworks fine! At least on the recent PyPy (I tested PyPy3.6 v7.0 on macOS). I used version 18.9b0 ofblack. See https://pypy.org/download.html