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

Build metadata modernization - pyproject.toml and python_requires #3167

Merged
merged 3 commits into from
Jan 16, 2019

Conversation

pganssle
Copy link
Contributor

Description

The current way you have configured your build system does not comply with PEP 517 or PEP 518, which are very helpful when you have build system dependencies. It is recommended that you add a pyproject.toml with build-system to describe your build system dependencies, which will allow pip install . to "just work" out of the box (I have tested this and it works). Note that I also added it to the MANIFEST.in because it is not currently included by default with even the latest setuptools.

While I was there, I noticed that you didn't have a python_requires in your setup.py and added one. This bit of metadata describes exactly which versions of Python are required to run your software. When you drop support for Python 3.4, add !=3.4.* to the python_requires line and users on Python 3.4 who invoke pip install spaCy will get the last version of spaCy that supports Python 3.4. It is likely to become very important when you want to drop Python 2.

It is imperative that you use twine to upload spaCy to PyPI from now on! Perhaps you already are (I could not find anything in the repo about how uploads are done), but python setup.py upload is deprecated and will be removed soon. The preferred way to upload packages is with twine. Unless you are using the absolute latest version of setuptools, there is a serious bug in the metadata upload that can cause problems with python_requires. If your upload workflow requires that you use setup.py upload, you should enforce that setuptools >= 40.6.3 is used in your setup.py, though I'll stress that even the latest version of setuptools is likely to be much buggier than twine.

I believe that these changes constitute purely factual information and there is no element of "art" to them (there's really no other way to do this), so I do not believe I have a copyright interest in the content of this PR. I cannot sign the contributor agreement, though. If that is a problem, consider this PR to be an "issue" and feel free to "re-implement" it as desired (though again, there's really no other way to convey this purely factual information).

Types of change

Build metadata enhancement

Checklist

  • I have submitted the spaCy Contributor Agreement.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

This adds the build requirements metadata to the repo, which can be used
with any build tools that implement PEP 517 and PEP 518 (e.g. pip, tox).
It is no longer necessary to have the build dependencies installed when
installing from source.
This directive specifies in the build metadata which version of CPython
is supported by this version of spaCy, which pip will take into account
when determining what version to download. This will allow you to safely
drop old versions of Python without `pip install spaCy` breaking for those
versions.
@explosion-bot
Copy link
Collaborator

Hi @pganssle, thanks for your pull request! 👍 It looks like you haven't filled in the spaCy Contributor Agreement (SCA) yet. The agrement ensures that we can use your contribution across the project. Once you've filled in the template, put it in the .github/contributors directory and add it to this pull request. If your pull request targets a branch that's not master, for example develop, make sure to submit the Contributor Agreement to the master branch. Thanks a lot!

If you've already included the Contributor Agreement in your pull request above, you can ignore this message.

@ines
Copy link
Member

ines commented Jan 16, 2019

Thanks for updating this and adding detailed explanation 👍 Agree re: Contributor agreement and yes, we use twine for uploading.

@ines ines added the meta Meta topics, e.g. repo organisation and issue management label Jan 16, 2019
@ines ines merged commit 021d040 into explosion:master Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Meta topics, e.g. repo organisation and issue management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants