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
setup.py cleanup: add -stripped build option to not include docs or tests #1878
Conversation
We support python 2.7. At least until pygame 2 is released, at which point we can assess the situation again. |
setup.py
Outdated
compilation_help() | ||
raise SystemExit("Pygame requires Python3 version 3.5 or above.") | ||
if IS_PYPY and sys.version_info < (3, 5): | ||
raise SystemExit("Pygame requires PyPy compatible with Python 3.5 or above.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last I looked, pypy (the 2.7 equivalent) worked. Am I misunderstanding this message?
I guess we should find the exact pypy version that pygame supports 'well enough'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't yet tested on PyPy 2.7, this might be a bit too conservative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good.
I'd like to be sure we have the python/pypy version requirement messages right.
Can we wait and merge this in after the python 2.0.0.dev10 release?
So what is left to be done here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 🎉
setup.py is currently full of dead code, code that should be dead but is still reachable, and side effects.
This pull request removes handling of cases that should not happen any more, like no newbuffer support. Current versions of PyPy and CPython (3.5 and up) implement the buffer API, and older versions that don't are not supported. It's the same with setuptools.
Instead of handling the absence of these features, we should just return early on unsupported Python versions.
This pull request also adds a "-stripped" parameter, to be invoked like this:
python3 setup.py -stripped bdist_wheel
. Stripped builds do not include any docs, tests, or code examples, so you can save space when embedding them in a binary distribution created with p4a or PyInstaller.These features are already part of the android branch, and by porting them over to
master
, I hope we get closer to pointing the p4a build recipe to an official release tarball instead of a specialised version.