Skip to content

Commit 32ec5cb

Browse files
authored
chore(test): update tests to expect PEP 753 compliant urls
Relates-to: python-poetry/poetry-core#807
1 parent 61f43e8 commit 32ec5cb

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/poetry/factory.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,16 +241,20 @@ def create_pyproject_from_package(cls, package: Package) -> TOMLDocument:
241241
if package.classifiers:
242242
content["classifiers"] = package.classifiers
243243

244-
for key, attr in {
245-
("documentation", "documentation_url"),
246-
("repository", "repository_url"),
247-
("homepage", "homepage"),
248-
("maintainers", "maintainers"),
249-
("keywords", "keywords"),
250-
}:
251-
value = getattr(package, attr, None)
252-
if value:
253-
content[key] = value
244+
if package.documentation_url:
245+
content["documentation"] = package.documentation_url
246+
247+
if package.repository_url:
248+
content["repository"] = package.repository_url
249+
250+
if package.homepage:
251+
content["homepage"] = package.homepage
252+
253+
if package.maintainers:
254+
content["maintainers"] = package.maintainers
255+
256+
if package.keywords:
257+
content["keywords"] = package.keywords
254258

255259
readmes = []
256260

tests/masonry/builders/test_editable_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ def test_builder_installs_proper_files_for_standard_packages(
174174
Name: simple-project
175175
Version: 1.2.3
176176
Summary: Some description.
177-
Home-page: https://python-poetry.org
178177
License: MIT
179178
Keywords: packaging,dependency,poetry
180179
Author: Sébastien Eustace
@@ -185,6 +184,7 @@ def test_builder_installs_proper_files_for_standard_packages(
185184
Classifier: Topic :: Software Development :: Build Tools
186185
Classifier: Topic :: Software Development :: Libraries :: Python Modules
187186
Project-URL: Documentation, https://python-poetry.org/docs
187+
Project-URL: Homepage, https://python-poetry.org
188188
Project-URL: Repository, https://github.com/python-poetry/poetry
189189
Description-Content-Type: text/x-rst
190190
@@ -342,14 +342,14 @@ def test_builder_generates_proper_metadata_when_multiple_readme_files(
342342
Name: my-package
343343
Version: 0.1
344344
Summary: Some description.
345-
Home-page: https://python-poetry.org
346345
License: MIT
347346
Author: Your Name
348347
Author-email: [email protected]
349348
Requires-Python: >=2.7,<3.0
350349
Classifier: License :: OSI Approved :: MIT License
351350
Classifier: Programming Language :: Python :: 2
352351
Classifier: Programming Language :: Python :: 2.7
352+
Project-URL: Homepage, https://python-poetry.org
353353
Description-Content-Type: text/x-rst
354354
355355
Single Python

0 commit comments

Comments
 (0)