Skip to content

Commit

Permalink
Remove attempt to canonicalize the version. It's already canonical en…
Browse files Browse the repository at this point in the history
…ough.

Closes #4302
Closes #3593
  • Loading branch information
jaraco committed Apr 13, 2024
1 parent 92b45e9 commit df45427
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions newsfragments/4302.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove attempt to canonicalize the version. It's already canonical enough.
4 changes: 2 additions & 2 deletions setuptools/_core_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from . import _normalization, _reqs
from .extern.packaging.markers import Marker
from .extern.packaging.requirements import Requirement
from .extern.packaging.utils import canonicalize_name, canonicalize_version
from .extern.packaging.utils import canonicalize_name
from .extern.packaging.version import Version
from .warnings import SetuptoolsDeprecationWarning

Expand Down Expand Up @@ -264,5 +264,5 @@ def _write_provides_extra(file, processed_extras, safe, unsafe):
def get_fullname(self):
return "{}-{}".format(
canonicalize_name(self.get_name()).replace('-', '_'),
canonicalize_version(self.get_version()),
self.get_version(),
)
6 changes: 2 additions & 4 deletions setuptools/tests/test_config_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def test_py_modules_when_wheel_dir_is_cwd(self, tmp_path):


class TestNoConfig:
CANONICAL_DEFAULT_VERSION = "0" # Canonical default version given by setuptools
DEFAULT_VERSION = "0.0.0" # Default version given by setuptools

EXAMPLES = {
"pkg1": ["src/pkg1.py"],
Expand All @@ -277,9 +277,7 @@ def test_build_with_discovered_name(self, tmp_path):
_populate_project_dir(tmp_path, files, {})
_run_build(tmp_path, "--sdist")
# Expected distribution file
dist_file = (
tmp_path / f"dist/ns_nested_pkg-{self.CANONICAL_DEFAULT_VERSION}.tar.gz"
)
dist_file = tmp_path / f"dist/ns_nested_pkg-{self.DEFAULT_VERSION}.tar.gz"
assert dist_file.is_file()


Expand Down

0 comments on commit df45427

Please sign in to comment.