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/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. diff --git a/pyproject.toml b/pyproject.toml index 0b8238e86a..507cdbaa0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Topic :: Utilities", ] requires-python = ">=3.9" +license = "MIT" dependencies = [ ] keywords = ["CPAN PyPI distutils eggs package management"] 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..6ca42648bd 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 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"