-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Ensure pyproject.toml
accepts UTF-8 in maintainers
#3666
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,9 @@ def test_apply_pyproject_equivalent_to_setupcfg(url, monkeypatch, tmp_path): | |
{name = "Tzu-Ping Chung"} | ||
] | ||
maintainers = [ | ||
{name = "Brett Cannon", email = "[email protected]"} | ||
{name = "Brett Cannon", email = "[email protected]"}, | ||
{name = "John X. Ãørçeč", email = "[email protected]"}, | ||
{name = "Γαμα קּ 東", email = "[email protected]"}, | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
|
@@ -147,7 +149,7 @@ def _pep621_example_project(tmp_path, readme="README.rst"): | |
replacements = {'readme = "README.rst"': f'readme = "{readme}"'} | ||
for orig, subst in replacements.items(): | ||
text = text.replace(orig, subst) | ||
pyproject.write_text(text) | ||
pyproject.write_text(text, encoding="utf-8") | ||
|
||
(tmp_path / readme).write_text("hello world") | ||
(tmp_path / "LICENSE.txt").write_text("--- LICENSE stub ---") | ||
|
@@ -189,6 +191,21 @@ def test_no_explicit_content_type_for_missing_extension(tmp_path): | |
assert dist.metadata.long_description_content_type is None | ||
|
||
|
||
def test_utf8_maintainer_in_metadata(tmp_path): # issue-3663 | ||
pyproject = _pep621_example_project(tmp_path, "README") | ||
dist = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject) | ||
expected = ( | ||
'Brett Cannon <[email protected]>, "John X. Ãørçeč" <[email protected]>, ' | ||
'Γαμα קּ 東 <[email protected]>' | ||
) | ||
assert dist.metadata.maintainer_email == expected | ||
pkg_file = tmp_path / "PKG-FILE" | ||
with open(pkg_file, "w", encoding="utf-8") as fh: | ||
dist.metadata.write_pkg_file(fh) | ||
content = pkg_file.read_text(encoding="utf-8") | ||
assert f"Maintainer-email: {expected}" in content | ||
|
||
|
||
# TODO: After PEP 639 is accepted, we have to move the license-files | ||
# to the `project` table instead of `tool.setuptools` | ||
def test_license_and_license_files(tmp_path): | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it'd handle IDNs as well. I'd add a test case for that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abravalheri turned out that the international emails aren't supported in the stdlib, so I thought it'd be reasonable to document that as an xfailing test case: #3670.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @webknjaz