Skip to content

Commit

Permalink
dash to underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
marscher committed Oct 15, 2024
1 parent c8adedd commit 87e40a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pydeps2env/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ def add_requirement(
if not isinstance(req, Requirement):
req = Requirement(req)

# A pip requirement can contain dashes in their name, we need to replace them to underscores.
# https://docs.conda.io/projects/conda-build/en/latest/concepts/package-naming-conv.html#term-Package-name
if "-" in req.name:
req.name = req.replace("-", "_")

if req.name not in requirements:
requirements[req.name] = req
elif mode == "combine":
Expand Down

0 comments on commit 87e40a2

Please sign in to comment.