aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/_vendor/packaging/utils.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2018-03-18 10:49:33 -0400
committerJason R. Coombs <jaraco@jaraco.com>2018-03-18 10:49:33 -0400
commit3f890dcf3d8d60f781678d45aacee3bd4829c10c (patch)
tree072c7a75031585565fe5975ba4a737b3bf9cdc0e /setuptools/_vendor/packaging/utils.py
parent27736e29ed889d6bce64275cb1d4a0d8d75b63da (diff)
downloadexternal_python_setuptools-3f890dcf3d8d60f781678d45aacee3bd4829c10c.tar.gz
external_python_setuptools-3f890dcf3d8d60f781678d45aacee3bd4829c10c.tar.bz2
external_python_setuptools-3f890dcf3d8d60f781678d45aacee3bd4829c10c.zip
Add vendored dependenciesfeature/vendor-pkg-resources
Diffstat (limited to 'setuptools/_vendor/packaging/utils.py')
-rw-r--r--setuptools/_vendor/packaging/utils.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/setuptools/_vendor/packaging/utils.py b/setuptools/_vendor/packaging/utils.py
new file mode 100644
index 00000000..942387ce
--- /dev/null
+++ b/setuptools/_vendor/packaging/utils.py
@@ -0,0 +1,14 @@
+# This file is dual licensed under the terms of the Apache License, Version
+# 2.0, and the BSD License. See the LICENSE file in the root of this repository
+# for complete details.
+from __future__ import absolute_import, division, print_function
+
+import re
+
+
+_canonicalize_regex = re.compile(r"[-_.]+")
+
+
+def canonicalize_name(name):
+ # This is taken from PEP 503.
+ return _canonicalize_regex.sub("-", name).lower()