Skip to content

Rely on SPDX identifier for license #4975

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

Merged
merged 5 commits into from
May 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions LICENSE

This file was deleted.

1 change: 1 addition & 0 deletions newsfragments/4956.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Restored license declaration in package metadata. See jaraco/skeleton#171.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ classifiers = [
"Topic :: Utilities",
]
requires-python = ">=3.9"
license = "MIT"
dependencies = [
]
keywords = ["CPAN PyPI distutils eggs package management"]
Expand Down
16 changes: 9 additions & 7 deletions setuptools/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, "/")
Expand All @@ -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):
...
Expand Down
6 changes: 6 additions & 0 deletions setuptools/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ def sample_project(tmp_path):
return tmp_path / 'sampleproject'


@pytest.fixture
def sample_project_cwd(sample_project):
with path.Path(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"

Expand Down
Loading