Skip to content

Commit 5061e67

Browse files
authored
Merge pull request #4975 from pypa/feature/skeleton-171
Rely on SPDX identifier for license
2 parents 22f087c + 553dd34 commit 5061e67

File tree

5 files changed

+17
-24
lines changed

5 files changed

+17
-24
lines changed

LICENSE

-17
This file was deleted.

newsfragments/4956.feature.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Restored license declaration in package metadata. See jaraco/skeleton#171.

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ classifiers = [
2222
"Topic :: Utilities",
2323
]
2424
requires-python = ">=3.9"
25+
license = "MIT"
2526
dependencies = [
2627
]
2728
keywords = ["CPAN PyPI distutils eggs package management"]

setuptools/dist.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,13 @@ def _expand_patterns(
471471
cls, patterns: list[str], enforce_match: bool = True
472472
) -> Iterator[str]:
473473
"""
474-
>>> list(Distribution._expand_patterns(['LICENSE']))
475-
['LICENSE']
474+
>>> getfixture('sample_project_cwd')
475+
>>> list(Distribution._expand_patterns(['LICENSE.txt']))
476+
['LICENSE.txt']
476477
>>> list(Distribution._expand_patterns(['pyproject.toml', 'LIC*']))
477-
['pyproject.toml', 'LICENSE']
478-
>>> list(Distribution._expand_patterns(['setuptools/**/pyprojecttoml.py']))
479-
['setuptools/config/pyprojecttoml.py']
478+
['pyproject.toml', 'LICENSE.txt']
479+
>>> list(Distribution._expand_patterns(['src/**/*.dat']))
480+
['src/sample/package_data.dat']
480481
"""
481482
return (
482483
path.replace(os.sep, "/")
@@ -488,8 +489,9 @@ def _expand_patterns(
488489
@staticmethod
489490
def _find_pattern(pattern: str, enforce_match: bool = True) -> list[str]:
490491
r"""
491-
>>> Distribution._find_pattern("LICENSE")
492-
['LICENSE']
492+
>>> getfixture('sample_project_cwd')
493+
>>> Distribution._find_pattern("LICENSE.txt")
494+
['LICENSE.txt']
493495
>>> Distribution._find_pattern("/LICENSE.MIT")
494496
Traceback (most recent call last):
495497
...

setuptools/tests/fixtures.py

+6
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ def sample_project(tmp_path):
6060
return tmp_path / 'sampleproject'
6161

6262

63+
@pytest.fixture
64+
def sample_project_cwd(sample_project):
65+
with path.Path(sample_project):
66+
yield
67+
68+
6369
# sdist and wheel artifacts should be stable across a round of tests
6470
# so we can build them once per session and use the files as "readonly"
6571

0 commit comments

Comments
 (0)