From 9a81db3c77bc106017dcd4b0853a5a94f43ae33c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 3 May 2025 03:57:47 -0400 Subject: [PATCH 1/4] Replace copy of license with an SPDX identifier. (jaraco/skeleton#171) --- LICENSE | 17 ----------------- pyproject.toml | 1 + 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 LICENSE diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 1bb5a44356..0000000000 --- a/LICENSE +++ /dev/null @@ -1,17 +0,0 @@ -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/pyproject.toml b/pyproject.toml index 71b1a7dabc..fa0c801fba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ classifiers = [ "Programming Language :: Python :: 3 :: Only", ] requires-python = ">=3.9" +license = "MIT" dependencies = [ ] dynamic = ["version"] From 63588b6f19be4a7769423a1c14865f192931f829 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 3 May 2025 04:00:35 -0400 Subject: [PATCH 2/4] Add news fragment. --- newsfragments/4956.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/4956.feature.rst diff --git a/newsfragments/4956.feature.rst b/newsfragments/4956.feature.rst new file mode 100644 index 0000000000..e42aec415d --- /dev/null +++ b/newsfragments/4956.feature.rst @@ -0,0 +1 @@ +Restored license declaration in package metadata. See jaraco/skeleton#171. From 2af90ac872ddbdfd229244377a95b8be1dde035f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 3 May 2025 04:28:04 -0400 Subject: [PATCH 3/4] Update tests in setuptools/dist not to rely on Setuptools having a license file. --- setuptools/dist.py | 16 +++++++++------- setuptools/tests/fixtures.py | 6 ++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/setuptools/dist.py b/setuptools/dist.py index 8d972cc49b..57aeb2579d 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -471,12 +471,13 @@ def _expand_patterns( cls, patterns: list[str], enforce_match: bool = True ) -> Iterator[str]: """ - >>> list(Distribution._expand_patterns(['LICENSE'])) - ['LICENSE'] + >>> getfixture('sample_project_cwd') + >>> list(Distribution._expand_patterns(['LICENSE.txt'])) + ['LICENSE.txt'] >>> list(Distribution._expand_patterns(['pyproject.toml', 'LIC*'])) - ['pyproject.toml', 'LICENSE'] - >>> list(Distribution._expand_patterns(['setuptools/**/pyprojecttoml.py'])) - ['setuptools/config/pyprojecttoml.py'] + ['pyproject.toml', 'LICENSE.txt'] + >>> list(Distribution._expand_patterns(['src/**/*.dat'])) + ['src/sample/package_data.dat'] """ return ( path.replace(os.sep, "/") @@ -488,8 +489,9 @@ def _expand_patterns( @staticmethod def _find_pattern(pattern: str, enforce_match: bool = True) -> list[str]: r""" - >>> Distribution._find_pattern("LICENSE") - ['LICENSE'] + >>> getfixture('sample_project_cwd') + >>> Distribution._find_pattern("LICENSE.txt") + ['LICENSE.txt'] >>> Distribution._find_pattern("/LICENSE.MIT") Traceback (most recent call last): ... diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py index a5472984b5..542e4a62b3 100644 --- a/setuptools/tests/fixtures.py +++ b/setuptools/tests/fixtures.py @@ -60,6 +60,12 @@ def sample_project(tmp_path): return tmp_path / 'sampleproject' +@pytest.fixture +def sample_project_cwd(sample_project): + with contextlib.chdir(sample_project): + yield + + # sdist and wheel artifacts should be stable across a round of tests # so we can build them once per session and use the files as "readonly" From 553dd342e42ab2093a36c13c30700aa4ccc4f226 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 3 May 2025 04:00:35 -0400 Subject: [PATCH 4/4] Rely on path.Path for directory context. `contextlib.chdir` isn't available until Python 3.11. --- setuptools/tests/fixtures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py index 542e4a62b3..6ca42648bd 100644 --- a/setuptools/tests/fixtures.py +++ b/setuptools/tests/fixtures.py @@ -62,7 +62,7 @@ def sample_project(tmp_path): @pytest.fixture def sample_project_cwd(sample_project): - with contextlib.chdir(sample_project): + with path.Path(sample_project): yield