Skip to content

Commit

Permalink
chore(test): update tests to expect PEP 753 compliant urls
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby authored Jan 11, 2025
1 parent 61f43e8 commit 32ec5cb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions src/poetry/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,20 @@ def create_pyproject_from_package(cls, package: Package) -> TOMLDocument:
if package.classifiers:
content["classifiers"] = package.classifiers

for key, attr in {
("documentation", "documentation_url"),
("repository", "repository_url"),
("homepage", "homepage"),
("maintainers", "maintainers"),
("keywords", "keywords"),
}:
value = getattr(package, attr, None)
if value:
content[key] = value
if package.documentation_url:
content["documentation"] = package.documentation_url

if package.repository_url:
content["repository"] = package.repository_url

if package.homepage:
content["homepage"] = package.homepage

if package.maintainers:
content["maintainers"] = package.maintainers

if package.keywords:
content["keywords"] = package.keywords

readmes = []

Expand Down
4 changes: 2 additions & 2 deletions tests/masonry/builders/test_editable_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def test_builder_installs_proper_files_for_standard_packages(
Name: simple-project
Version: 1.2.3
Summary: Some description.
Home-page: https://python-poetry.org
License: MIT
Keywords: packaging,dependency,poetry
Author: Sébastien Eustace
Expand All @@ -185,6 +184,7 @@ def test_builder_installs_proper_files_for_standard_packages(
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Project-URL: Documentation, https://python-poetry.org/docs
Project-URL: Homepage, https://python-poetry.org
Project-URL: Repository, https://github.com/python-poetry/poetry
Description-Content-Type: text/x-rst
Expand Down Expand Up @@ -342,14 +342,14 @@ def test_builder_generates_proper_metadata_when_multiple_readme_files(
Name: my-package
Version: 0.1
Summary: Some description.
Home-page: https://python-poetry.org
License: MIT
Author: Your Name
Author-email: you@example.com
Requires-Python: >=2.7,<3.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Project-URL: Homepage, https://python-poetry.org
Description-Content-Type: text/x-rst
Single Python
Expand Down

0 comments on commit 32ec5cb

Please sign in to comment.