-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
from setuptools.config import expand, pyprojecttoml, setupcfg | ||
from setuptools.config._apply_pyprojecttoml import _MissingDynamic, _some_attrgetter | ||
from setuptools.dist import Distribution | ||
from setuptools.errors import RemovedConfigError | ||
from setuptools.errors import InvalidConfigError, RemovedConfigError | ||
|
||
from .downloads import retrieve_file, urls_from_file | ||
|
||
|
@@ -174,7 +174,10 @@ def main_tomatoes(): pass | |
{email = "[email protected]"}, | ||
{name = "Tzu-Ping Chung"} | ||
] | ||
license = "MIT" | ||
license = "mit or apache-2.0" # should be normalized in metadata | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
] | ||
""" | ||
|
||
|
||
|
@@ -285,8 +288,8 @@ def test_utf8_maintainer_in_metadata( # issue-3663 | |
pytest.param( | ||
PEP639_LICENSE_EXPRESSION, | ||
None, | ||
'MIT', | ||
'License-Expression: MIT', | ||
'MIT OR Apache-2.0', | ||
'License-Expression: MIT OR Apache-2.0', | ||
id='license-expression', | ||
), | ||
), | ||
|
@@ -313,6 +316,18 @@ def test_license_in_metadata( | |
assert content_str in content | ||
|
||
|
||
def test_license_expression_with_bad_classifier(tmp_path): | ||
text = PEP639_LICENSE_EXPRESSION.rsplit("\n", 2)[0] | ||
pyproject = _pep621_example_project( | ||
tmp_path, | ||
"README", | ||
f"{text}\n \"License :: OSI Approved :: MIT License\"\n]", | ||
) | ||
msg = "License classifier are deprecated.*'License :: OSI Approved :: MIT License'" | ||
with pytest.raises(InvalidConfigError, match=msg): | ||
pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject) | ||
|
||
|
||
class TestLicenseFiles: | ||
def base_pyproject(self, tmp_path, additional_text): | ||
pyproject = _pep621_example_project(tmp_path, "README") | ||
|