Skip to content

Commit

Permalink
Allow - and _ in requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
wch committed Jul 24, 2024
1 parent 3d93bbb commit 13f2e32
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shinylive/_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,9 @@ def _find_packages_in_requirements(req_txt: str) -> list[str]:
# If we got here, it's a package specification.
# Remove any trailing version info: "my-package (>= 1.0.0)" -> "my-package"
pkg_name = re.sub(r"([a-zA-Z0-9._-]+)(.*)", r"\1", line).strip()
# Replace underscores with hyphens: "typing_extensions" -> "typing-extensions"
pkg_name = pkg_name.replace("_", "-")

reqs.append(pkg_name)

return reqs

0 comments on commit 13f2e32

Please sign in to comment.