diff options
author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2021-04-17 21:33:23 +0200 |
---|---|---|
committer | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2021-05-23 01:42:45 +0200 |
commit | 482e8e7687e3272ca2d0b1d5d73b92c3219f4576 (patch) | |
tree | 2d4ae8bd52a42e895fbe724aea1fd55c2a688231 | |
parent | b16725ac388b6a0bab6c0ff79d809559589be248 (diff) | |
download | python-setuptools-git-482e8e7687e3272ca2d0b1d5d73b92c3219f4576.tar.gz |
Overwrite exlude from MANIFEST with license_files option
* needed for 'License-File' metadata, as this is written
before MANIFEST is read
-rw-r--r-- | changelog.d/2645.breaking.rst | 3 | ||||
-rw-r--r-- | setuptools/command/egg_info.py | 2 | ||||
-rw-r--r-- | setuptools/tests/test_egg_info.py | 11 |
3 files changed, 10 insertions, 6 deletions
diff --git a/changelog.d/2645.breaking.rst b/changelog.d/2645.breaking.rst new file mode 100644 index 00000000..b96b492a --- /dev/null +++ b/changelog.d/2645.breaking.rst @@ -0,0 +1,3 @@ +License files excluded via the ``MANIFEST.in`` but matched by either +the ``license_file`` (deprecated) or ``license_files`` options, +will be nevertheless included in the source distribution. - by :user:`cdce8p` diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 67259c7c..18b81340 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -539,9 +539,9 @@ class manifest_maker(sdist): if not os.path.exists(self.manifest): self.write_manifest() # it must exist so it'll get in the list self.add_defaults() - self.add_license_files() if os.path.exists(self.template): self.read_template() + self.add_license_files() self.prune_file_list() self.filelist.sort() self.filelist.remove_duplicates() diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index 29fb2062..2821a295 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -551,7 +551,7 @@ class TestEggInfo: """), 'MANIFEST.in': "exclude LICENSE", 'LICENSE': "Test license" - }, False), # license file is manually excluded + }, True), # manifest is overwritten by license_file pytest.param({ 'setup.cfg': DALS(""" [metadata] @@ -647,7 +647,7 @@ class TestEggInfo: """), 'MANIFEST.in': "exclude LICENSE", 'LICENSE': "Test license" - }, [], ['LICENSE']), # license file is manually excluded + }, ['LICENSE'], []), # manifest is overwritten by license_files ({ 'setup.cfg': DALS(""" [metadata] @@ -658,7 +658,8 @@ class TestEggInfo: 'MANIFEST.in': "exclude LICENSE-XYZ", 'LICENSE-ABC': "ABC license", 'LICENSE-XYZ': "XYZ license" - }, ['LICENSE-ABC'], ['LICENSE-XYZ']), # subset is manually excluded + # manifest is overwritten by license_files + }, ['LICENSE-ABC', 'LICENSE-XYZ'], []), pytest.param({ 'setup.cfg': "", 'LICENSE-ABC': "ABC license", @@ -791,8 +792,8 @@ class TestEggInfo: 'LICENSE-ABC': "ABC license", 'LICENSE-PQR': "PQR license", 'LICENSE-XYZ': "XYZ license" - # manually excluded - }, ['LICENSE-XYZ'], ['LICENSE-ABC', 'LICENSE-PQR']), + # manifest is overwritten + }, ['LICENSE-ABC', 'LICENSE-PQR', 'LICENSE-XYZ'], []), pytest.param({ 'setup.cfg': DALS(""" [metadata] |