Skip to content
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

Merged
merged 5 commits into from Jun 27, 2020

Conversation

robertpfeiffer
Copy link
Contributor

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.

@illume
Copy link
Member

illume commented May 30, 2020

We support python 2.7. At least until pygame 2 is released, at which point we can assess the situation again.

setup.py Show resolved Hide resolved
setup.py Show resolved Hide resolved
setup.py Show resolved Hide resolved
setup.py Show resolved Hide resolved
setup.py Show resolved Hide resolved
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.")
Copy link
Member

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

Copy link
Contributor Author

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.

setup.py Show resolved Hide resolved
setup.py Show resolved Hide resolved
Copy link
Member

@illume illume left a 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?

@robertpfeiffer
Copy link
Contributor Author

So what is left to be done here?

setup.py Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
Copy link
Member

@illume illume left a comment

Choose a reason for hiding this comment

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

👍 🎉

@illume illume merged commit 539fdeb into pygame:master Jun 27, 2020
@illume illume changed the title Refactor setup, add -stripped build option setup.py cleanup: add -stripped build option to not include docs or tests Sep 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants