Build metadata modernization - pyproject.toml and python_requires #3167
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
withbuild-system
to describe your build system dependencies, which will allowpip install .
to "just work" out of the box (I have tested this and it works). Note that I also added it to theMANIFEST.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 yoursetup.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 thepython_requires
line and users on Python 3.4 who invokepip 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 withtwine
. Unless you are using the absolute latest version of setuptools, there is a serious bug in the metadata upload that can cause problems withpython_requires
. If your upload workflow requires that you usesetup.py
upload, you should enforce thatsetuptools >= 40.6.3
is used in your setup.py, though I'll stress that even the latest version ofsetuptools
is likely to be much buggier thantwine
.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