Skip to content

Conversation

@davidism
Copy link
Member

@davidism davidism commented Feb 7, 2021

The C extension is twice as slow as the native code on PyPy. Maybe this can be re-evaluated later.

closes #176

they're not actually faster on PyPy, at least right now
@davidism davidism added this to the 2.0.0 milestone Feb 7, 2021
@davidism davidism merged commit 39c79f3 into master Feb 7, 2021
@davidism davidism deleted the pypy-no-speedups branch February 7, 2021 07:03
@davidism
Copy link
Member Author

davidism commented Feb 7, 2021

Also needed to skip PyPy when invoking cibuildwheel: 6e24924

Seems like there's not a nice way to build a universal wheel alongside platform wheels. That means for now I'm just keeping the current 1.x system where PyPy will install from the sdist.

@davidism davidism mentioned this pull request Feb 7, 2021
6 tasks
@davidism
Copy link
Member Author

davidism commented Feb 7, 2021

@henryiii wondering if you have any insight into building a universal wheel for PyPy so it doesn't have to build from sdist. cibuildwheel raises an error that the file doesn't look like a platform wheel on pp*, which is correct. I tried python setup.py bdist_wheel --universal on its own with 3.9 and it still built a platform wheel.

@henryiii
Copy link

henryiii commented Feb 7, 2021

Your setup.py checks for several things to decide to add an extension. If you build on pypy, it should be fine, or you could add an extra setting to the setup.py to disable the extension. If you don't add an Extension, it will be "universal", that is, not platform specific.

It's actually not a actual "universal" wheel, so --universal is not correct, "universal" was the name for a py2.py3 wheel. You want just a py3 wheel.

@henryiii
Copy link

henryiii commented Feb 7, 2021

It's here:

markupsafe/setup.py

Lines 55 to 59 in 6e24924

supports_speedups = platform.python_implementation() not in {"PyPy", "Jython"}
if os.environ.get("CIBUILDWHEEL", "0") == "1" and supports_speedups:
run_setup(True)
elif supports_speedups:

You need a run with run_setup(False) in order to get a pure python wheel.

@davidism
Copy link
Member Author

davidism commented Feb 7, 2021

That makes sense, I just tried on PyPy and the wheel was tagged py3-none instead. Seems obvious now, thanks for the help.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unicode incorrectly escaped on PyPy 7.3.1

3 participants