Skip to content

Commit

Permalink
Use only the first matching url as Home-page. Put the rest under Proj…
Browse files Browse the repository at this point in the history
…ect-URL
  • Loading branch information
domdfcoding committed Jun 5, 2021
1 parent db28b24 commit ce2b229
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/example_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
[project.urls]
Homepage = "https://whey.readthedocs.io/en/latest"
"Home Page" = "https://whey.readthedocs.io/en/latest"
Documentation = "https://whey.readthedocs.io/en/latest"
"Issue Tracker" = "https://github.com/repo-helper/whey/issues"
"Source Code" = "https://github.com/repo-helper/whey"
Expand Down
1 change: 1 addition & 0 deletions tests/test_build_/test_build_additional_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Author-email: Dominic Davis-Foster <[email protected]>
License: MIT
Keywords: build,distribution,packaging,pep517,pep621,sdist,wheel
Home-page: https://whey.readthedocs.io/en/latest
Project-URL: Home Page, https://whey.readthedocs.io/en/latest
Project-URL: Documentation, https://whey.readthedocs.io/en/latest
Project-URL: Issue Tracker, https://github.com/repo-helper/whey/issues
Project-URL: Source Code, https://github.com/repo-helper/whey
Expand Down
1 change: 1 addition & 0 deletions tests/test_build_/test_build_complete_COMPLETE_B_.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ file = "LICENSE"

[project.urls]
Homepage = "https://whey.readthedocs.io/en/latest"
"Home Page" = "https://whey.readthedocs.io/en/latest"
Documentation = "https://whey.readthedocs.io/en/latest"
"Issue Tracker" = "https://github.com/repo-helper/whey/issues"
"Source Code" = "https://github.com/repo-helper/whey"
Expand Down
1 change: 1 addition & 0 deletions tests/test_build_/test_build_complete_COMPLETE_B_.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Author-email: Dominic Davis-Foster <[email protected]>
License: MIT
Keywords: build,distribution,packaging,pep517,pep621,sdist,wheel
Home-page: https://whey.readthedocs.io/en/latest
Project-URL: Home Page, https://whey.readthedocs.io/en/latest
Project-URL: Documentation, https://whey.readthedocs.io/en/latest
Project-URL: Issue Tracker, https://github.com/repo-helper/whey/issues
Project-URL: Source Code, https://github.com/repo-helper/whey
Expand Down
1 change: 1 addition & 0 deletions tests/test_build_/test_build_markdown_readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Author-email: Dominic Davis-Foster <[email protected]>
License: MIT
Keywords: build,distribution,packaging,pep517,pep621,sdist,wheel
Home-page: https://whey.readthedocs.io/en/latest
Project-URL: Home Page, https://whey.readthedocs.io/en/latest
Project-URL: Documentation, https://whey.readthedocs.io/en/latest
Project-URL: Issue Tracker, https://github.com/repo-helper/whey/issues
Project-URL: Source Code, https://github.com/repo-helper/whey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Author-email: Dominic Davis-Foster <[email protected]>
License: MIT
Keywords: build,distribution,packaging,pep517,pep621,sdist,wheel
Home-page: https://whey.readthedocs.io/en/latest
Project-URL: Home Page, https://whey.readthedocs.io/en/latest
Project-URL: Documentation, https://whey.readthedocs.io/en/latest
Project-URL: Issue Tracker, https://github.com/repo-helper/whey/issues
Project-URL: Source Code, https://github.com/repo-helper/whey
Expand Down
1 change: 1 addition & 0 deletions tests/test_foreman_/test_build_additional_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Author-email: Dominic Davis-Foster <[email protected]>
License: MIT
Keywords: build,distribution,packaging,pep517,pep621,sdist,wheel
Home-page: https://whey.readthedocs.io/en/latest
Project-URL: Home Page, https://whey.readthedocs.io/en/latest
Project-URL: Documentation, https://whey.readthedocs.io/en/latest
Project-URL: Issue Tracker, https://github.com/repo-helper/whey/issues
Project-URL: Source Code, https://github.com/repo-helper/whey
Expand Down
1 change: 1 addition & 0 deletions tests/test_foreman_/test_build_complete_COMPLETE_B_.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Author-email: Dominic Davis-Foster <[email protected]>
License: MIT
Keywords: build,distribution,packaging,pep517,pep621,sdist,wheel
Home-page: https://whey.readthedocs.io/en/latest
Project-URL: Home Page, https://whey.readthedocs.io/en/latest
Project-URL: Documentation, https://whey.readthedocs.io/en/latest
Project-URL: Issue Tracker, https://github.com/repo-helper/whey/issues
Project-URL: Source Code, https://github.com/repo-helper/whey
Expand Down
5 changes: 4 additions & 1 deletion whey/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,12 @@ def write_metadata(self, metadata_file: PathPlus):
if self.config["keywords"]:
metadata["Keywords"] = ','.join(self.config["keywords"])

seen_hp = False

for category, url in self.config["urls"].items():
if category.lower() in {"homepage", "home page"}:
if category.lower() in {"homepage", "home page"} and not seen_hp:
metadata["Home-page"] = url
seen_hp = True
else:
metadata["Project-URL"] = f"{category}, {url}"

Expand Down

0 comments on commit ce2b229

Please sign in to comment.