|
26 | 26 | import setuptools.command.easy_install as ei
|
27 | 27 | from pkg_resources import Distribution as PRDistribution, normalize_path, working_set
|
28 | 28 | from setuptools import sandbox
|
| 29 | +from setuptools._normalization import safer_name |
29 | 30 | from setuptools.command.easy_install import PthDistributions
|
30 | 31 | from setuptools.dist import Distribution
|
31 | 32 | from setuptools.sandbox import run_setup
|
@@ -1209,10 +1210,11 @@ def create_setup_requires_package(
|
1209 | 1210 | package itself is just 'test_pkg'.
|
1210 | 1211 | """
|
1211 | 1212 |
|
| 1213 | + normalized_distname = safer_name(distname) |
1212 | 1214 | test_setup_attrs = {
|
1213 | 1215 | 'name': 'test_pkg',
|
1214 | 1216 | 'version': '0.0',
|
1215 |
| - 'setup_requires': [f'{distname}=={version}'], |
| 1217 | + 'setup_requires': [f'{normalized_distname}=={version}'], |
1216 | 1218 | 'dependency_links': [os.path.abspath(path)],
|
1217 | 1219 | }
|
1218 | 1220 | if setup_attrs:
|
@@ -1261,7 +1263,7 @@ def create_setup_requires_package(
|
1261 | 1263 | with open(os.path.join(test_pkg, 'setup.py'), 'w', encoding="utf-8") as f:
|
1262 | 1264 | f.write(setup_py_template % test_setup_attrs)
|
1263 | 1265 |
|
1264 |
| - foobar_path = os.path.join(path, f'{distname}-{version}.tar.gz') |
| 1266 | + foobar_path = os.path.join(path, f'{normalized_distname}-{version}.tar.gz') |
1265 | 1267 | make_package(foobar_path, distname, version)
|
1266 | 1268 |
|
1267 | 1269 | return test_pkg
|
|
0 commit comments