Skip to content

Update setuptools configuration to align with PEP 517/518 #780

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

Merged
merged 5 commits into from
Nov 16, 2020

Conversation

Cleptomania
Copy link
Member

PEP 517 and PEP 518 outline some ideals for the format of build system configuration.

This PR serves to align Arcade's build system more closely with these PEPs. From an end-user perspective there shouldn't be any noticeable difference. However this should serve to cleanup the development install process and simplify the build system. As well as help serve as an example of good standards for project setup.

The key change here is primarily using the setup.cfg file rather than the setup.py file, and switching to the pep517 package for building the wheel for distribution.

To install the arcade from source after these changes, the below command can be used:

pip install -e "."

Extra package groups can be defined as desired by using:

pip install -e ".[dev, build, docs]"

With this change in order to build the wheel all that's needed(assuming the build package group was defined during install) is:

mkdir dist
python -m pep517.build .

This will build the wheel and tar.gz file into the dist directory.

Another change this makes is pinning crucial dependency versions, specifically, pyglet, pillow, pymunk, numpy, pytiled_parser. They are pinned at their current latest versions which is what was previously being installed and tested with. Not having the versions of these packages does not feel safe as at any time breaking changes could be released on them and Arcade would always be installing the latest version from PyPi

@SirGnip
Copy link
Contributor

SirGnip commented Nov 3, 2020

This might be jamming too much in this one commit, but I just noticed type hinting is broken for code that imports arcade and created this ticket #781. I think the fix is a one-liner in setup.py (or however pyproject.toml/setup.cfg handles stuff like this)

@Cleptomania
Copy link
Member Author

I think we'd be fine to fix #781 in this, as it is solely related to the build system not including the proper file. It's a simple one line fix that needs added to MANIFEST.in to include the py.typed file.

I'll add it in tonight when I work on the version pinning and test it out.

@pvcraven
Copy link
Member

pvcraven commented Nov 7, 2020

Is this ready? Or ready-ish?

@Cleptomania
Copy link
Member Author

I think it's ready but I figured it would be best for you to test out building with it since I'm not 100% sure what your process was for building a release before, just to make sure everything you'd expect to still works. There should be no impact to end users, but make's the install from source and build process a little more clean.

I've looked into all branching dependencies of our dependencies and ensured there are no version conflicts. As of the versions I've pinned they're all working and good to go. Pyglet is pinned to a specific range that I've determined with @einarf and everything else is pinned to an approximate matching the minor version, so it will install the latest patch version of each but not go over the minor version.

@pvcraven pvcraven merged commit 91dd7f1 into development Nov 16, 2020
@Cleptomania Cleptomania deleted the pep517 branch December 14, 2020 17:09
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.

3 participants