Skip to content

Commit b0135f5

Browse files
committed
Support PEP 625
1 parent 6ee23bf commit b0135f5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

setuptools/_distutils/dist.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
DistutilsArgError,
2424
DistutilsClassError,
2525
)
26+
from setuptools.extern.packaging.utils import canonicalize_name, canonicalize_version
2627
from .fancy_getopt import FancyGetopt, translate_longopt
2728
from .util import check_environ, strtobool, rfc822_escape
2829
from ._log import log
@@ -1189,7 +1190,9 @@ def get_version(self):
11891190
return self.version or "0.0.0"
11901191

11911192
def get_fullname(self):
1192-
return "{}-{}".format(self.get_name(), self.get_version())
1193+
return "{}-{}".format(
1194+
canonicalize_name(self.get_name()), canonicalize_version(self.get_version())
1195+
)
11931196

11941197
def get_author(self):
11951198
return self.author

setuptools/tests/test_config_discovery.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def test_py_modules_when_wheel_dir_is_cwd(self, tmp_path):
255255

256256

257257
class TestNoConfig:
258-
DEFAULT_VERSION = "0.0.0" # Default version given by setuptools
258+
CANONICAL_DEFAULT_VERSION = "0" # Canonical default version given by setuptools
259259

260260
EXAMPLES = {
261261
"pkg1": ["src/pkg1.py"],
@@ -277,7 +277,9 @@ def test_build_with_discovered_name(self, tmp_path):
277277
_populate_project_dir(tmp_path, files, {})
278278
_run_build(tmp_path, "--sdist")
279279
# Expected distribution file
280-
dist_file = tmp_path / f"dist/ns.nested.pkg-{self.DEFAULT_VERSION}.tar.gz"
280+
dist_file = (
281+
tmp_path / f"dist/ns-nested-pkg-{self.CANONICAL_DEFAULT_VERSION}.tar.gz"
282+
)
281283
assert dist_file.is_file()
282284

283285

0 commit comments

Comments
 (0)