Skip to content

Commit

Permalink
add to_filename helper
Browse files Browse the repository at this point in the history
  • Loading branch information
dholth committed Jul 20, 2024
1 parent 3ae43a7 commit 67ac3a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions enscons/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ def safe_version(version):
version = version.replace(" ", ".")
return re.sub("[^A-Za-z0-9.]+", "-", version)

# from pkg_resources
def to_filename(name):
"""Convert a project or version name to its filename-escaped form
Any '-' characters are currently replaced with '_'.
"""
return name.replace('-', '_')

# from wheel
def requires_to_requires_dist(requirement):
Expand Down

0 comments on commit 67ac3a8

Please sign in to comment.