From 67ac3a80127e5f41f18c28ad2e745caeaaa171e4 Mon Sep 17 00:00:00 2001
From: Daniel Holth <dholth@fastmail.fm>
Date: Sat, 20 Jul 2024 14:45:18 -0400
Subject: [PATCH] add to_filename helper

---
 enscons/util.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/enscons/util.py b/enscons/util.py
index 2f9e1f0..b675691 100644
--- a/enscons/util.py
+++ b/enscons/util.py
@@ -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):