Skip to content

Commit

Permalink
fix(find_dependencies): use any github repo project-url if need be
Browse files Browse the repository at this point in the history
When looking for the GitHub home of a PyPI package, if nothing is
explicitly marked as Source or Home, use any Project-URL that is a
GitHub repo.
  • Loading branch information
Ned Batchelder authored and nedbat committed Aug 23, 2023
1 parent 42037de commit 7d98dca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions edx_repo_tools/find_dependencies/find_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,12 @@ def repo_url_from_tgz(tgz_path: str) -> Optional[str]:


SOURCE_URL_REGEXES = [
# These regexes are tried in order. The first group is the extracted URL.
r"(?i)^Project-URL: Source.*,\s*(.*)$",
r"(?i)^Home-page: (.*)$",
r"(?i)^Project-URL: Home.*,\s*(.*)$",
# If we can't find a URL marked as home, then use any GitHub repo URL.
r"(?i)^Project-URL: [^,]+,\s*(https?://github.com/[^/]+/[^/]+)$",
]

def repo_url_from_metadata(filename, metadata):
Expand Down

0 comments on commit 7d98dca

Please sign in to comment.