Skip to content

Commit 1836bfb

Browse files
committed
Normalize distname in create_setup_requires_package
1 parent 1ec0c91 commit 1836bfb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

setuptools/tests/test_easy_install.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import setuptools.command.easy_install as ei
2727
from pkg_resources import Distribution as PRDistribution, normalize_path, working_set
2828
from setuptools import sandbox
29+
from setuptools._normalization import safer_name
2930
from setuptools.command.easy_install import PthDistributions
3031
from setuptools.dist import Distribution
3132
from setuptools.sandbox import run_setup
@@ -1209,10 +1210,11 @@ def create_setup_requires_package(
12091210
package itself is just 'test_pkg'.
12101211
"""
12111212

1213+
normalized_distname = safer_name(distname)
12121214
test_setup_attrs = {
12131215
'name': 'test_pkg',
12141216
'version': '0.0',
1215-
'setup_requires': [f'{distname}=={version}'],
1217+
'setup_requires': [f'{normalized_distname}=={version}'],
12161218
'dependency_links': [os.path.abspath(path)],
12171219
}
12181220
if setup_attrs:
@@ -1261,7 +1263,7 @@ def create_setup_requires_package(
12611263
with open(os.path.join(test_pkg, 'setup.py'), 'w', encoding="utf-8") as f:
12621264
f.write(setup_py_template % test_setup_attrs)
12631265

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')
12651267
make_package(foobar_path, distname, version)
12661268

12671269
return test_pkg

0 commit comments

Comments
 (0)