-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Use license_files instead of deprecated license_file #6348
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
Conversation
Awesome, thanks a lot @hugovk! |
|
That's a good point, thanks! Should we decline this PR then and reopen it at a later time? |
we could set depends whether we want it to work for non-pyproject invocations 🤔 |
When building from source, does setuptools do anything with the license file? |
In fact, can this metadata be removed? |
it does do something, yes: $ echo -e 'from setuptools import setup; setup()' > setup.py
$ touch LICENSE
$ ~/opt/venv/bin/python setup.py sdist
...
$ tar --list -f dist/UNKNOWN-0.0.0.tar.gz
UNKNOWN-0.0.0/
UNKNOWN-0.0.0/setup.py
UNKNOWN-0.0.0/PKG-INFO
UNKNOWN-0.0.0/UNKNOWN.egg-info/
UNKNOWN-0.0.0/UNKNOWN.egg-info/PKG-INFO
UNKNOWN-0.0.0/UNKNOWN.egg-info/top_level.txt
UNKNOWN-0.0.0/UNKNOWN.egg-info/dependency_links.txt
UNKNOWN-0.0.0/UNKNOWN.egg-info/SOURCES.txt
UNKNOWN-0.0.0/setup.cfg
$ echo -e '[metadata]\nlicense_file=LICENSE\n' > setup.cfg
$ ~/opt/venv/bin/python setup.py sdist
...
$ tar --list -f dist/UNKNOWN-0.0.0.tar.gz
UNKNOWN-0.0.0/
UNKNOWN-0.0.0/setup.py
UNKNOWN-0.0.0/LICENSE
UNKNOWN-0.0.0/PKG-INFO
UNKNOWN-0.0.0/UNKNOWN.egg-info/
UNKNOWN-0.0.0/UNKNOWN.egg-info/PKG-INFO
UNKNOWN-0.0.0/UNKNOWN.egg-info/top_level.txt
UNKNOWN-0.0.0/UNKNOWN.egg-info/dependency_links.txt
UNKNOWN-0.0.0/UNKNOWN.egg-info/SOURCES.txt
UNKNOWN-0.0.0/setup.cfg (hard to see, but the presence of the setting causes the operating system packagers get grumpy for reasons if you don't include this file in the sdist |
Will setuptools-scm include it for sdists? |
I don't know I don't use it, but given the description -- probably? |
(I prefer not to involve eggs when I don't have to) |
(oh, black and this are already using setuptools-scm, carry on then) |
Testing with pylast master with: pytest-5.3.3.dev9+ge1df9dbf0.d20191220/testing/example_scripts/perf_exdiff --git a/setup.cfg b/setup.cfg
index 54b64af96..bef9f7871 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -10,7 +10,6 @@ project_urls =
author = Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin and others
license = MIT license
-license_file = LICENSE
keywords = test, unittest
classifiers =
Development Status :: 6 - Mature setuptools<42$ pip install "setuptools<42"
Requirement already satisfied: setuptools<42 in /usr/local/lib/python3.7/site-packages (41.6.0)
$ python setup.py sdist
...
$ tar --list -f dist/pytest-5.3.3.dev9+ge1df9dbf0.d20191220.tar.gz | grep LICENSE
pytest-5.3.3.dev9+ge1df9dbf0.d20191220/LICENSE
pytest-5.3.3.dev9+ge1df9dbf0.d20191220/doc/en/_themes/LICENSE setuptools==42$ pip install -U setuptools
Collecting setuptools
Using cached https://files.pythonhosted.org/packages/54/28/c45d8b54c1339f9644b87663945e54a8503cfef59cf0f65b3ff5dd17cf64/setuptools-42.0.2-py2.py3-none-any.whl
Installing collected packages: setuptools
Found existing installation: setuptools 41.6.0
Uninstalling setuptools-41.6.0:
Successfully uninstalled setuptools-41.6.0
Successfully installed setuptools-42.0.2
$ rm dist/pytest-5.3.3.dev9+ge1df9dbf0.d20191220.tar.gz
$ python setup.py sdist
...
$ tar --list -f dist/pytest-5.3.3.dev9+ge1df9dbf0.d20191220.tar.gz | grep LICENSE
pytest-5.3.3.dev9+ge1df9dbf0.d20191220/LICENSE
pytest-5.3.3.dev9+ge1df9dbf0.d20191220/doc/en/_themes/LICENSE |
Please see PR #6375 as an alternative to this which removes the deprecated metadata. |
Closing in favor of #6375. |
Here is a quick checklist that should be present in PRs.
master
branch for bug fixes, documentation updates and trivial changes.features
branch for new features, improvements, and removals/deprecations.changelog
folder, with a name like<ISSUE NUMBER>.<TYPE>.rst
. See changelog/README.rst for details.AUTHORS
in alphabetical order.license_file
has been deprecated in favour oflicense_files
.https://wheel.readthedocs.io/en/stable/news.html
And setuptools 42 was released Nov 23, 2019:
https://packaging.python.org/guides/using-manifest-in/#how-files-are-included-in-an-sdist