[packages/python3-hatchling] avoid name normalization except for package name; rel 7
atler
atler at pld-linux.org
Thu Jun 19 15:16:18 CEST 2025
commit f6e8dec740c69ed6a61dfacd6f19e12b63435e3d
Author: Jan Palus <atler at pld-linux.org>
Date: Thu Jun 19 15:11:16 2025 +0200
avoid name normalization except for package name; rel 7
attempts to fix https://github.com/pypa/hatch/issues/1967
primary objective is not to normalize dependency names
while keeping .dist-info directory name normalization.
package name normalization is kept for backward compatibility.
no-names-normalization.patch | 37 +++++++++++++++++++++++++++++++++++++
python3-hatchling.spec | 4 +++-
2 files changed, 40 insertions(+), 1 deletion(-)
---
diff --git a/python3-hatchling.spec b/python3-hatchling.spec
index ef54a48..2e91444 100644
--- a/python3-hatchling.spec
+++ b/python3-hatchling.spec
@@ -7,11 +7,12 @@ Summary: Modern, extensible Python build backend
Summary(pl.UTF-8): Nowoczesny, rozszerzalny backend budowania pakietów dla Pythona
Name: python3-%{module}
Version: 1.27.0
-Release: 6
+Release: 7
License: MIT
Group: Libraries/Python
Source0: https://pypi.debian.net/hatchling/%{module}-%{version}.tar.gz
# Source0-md5: 6ffb3087c9b6a9ffbfc1bb394f7ed1a8
+Patch0: no-names-normalization.patch
URL: https://pypi.org/project/hatchling/
BuildRequires: python3-build
BuildRequires: python3-installer
@@ -46,6 +47,7 @@ pakietów Pythona, wykorzystywany przez Hatch
%prep
%setup -q -n %{module}-%{version}
+%patch -P0 -p1
%build
%py3_build_pyproject
diff --git a/no-names-normalization.patch b/no-names-normalization.patch
new file mode 100644
index 0000000..a8e9e24
--- /dev/null
+++ b/no-names-normalization.patch
@@ -0,0 +1,37 @@
+--- hatchling-1.27.0/src/hatchling/metadata/utils.py.orig 2020-02-02 01:00:00.000000000 +0100
++++ hatchling-1.27.0/src/hatchling/metadata/utils.py 2025-06-19 14:40:26.303286164 +0200
+@@ -16,9 +16,13 @@
+ return re.search('^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$', project_name, re.IGNORECASE) is not None
+
+
+-def normalize_project_name(project_name: str) -> str:
++def name_normalization(name: str) -> str:
+ # https://peps.python.org/pep-0503/#normalized-names
+- return re.sub(r'[-_.]+', '-', project_name).lower()
++ return re.sub(r'[-_.]+', '-', name).lower()
++
++
++def normalize_project_name(project_name: str) -> str:
++ return project_name
+
+
+ def normalize_requirement(requirement: Requirement) -> None:
+--- hatchling-1.27.0/src/hatchling/metadata/core.py.orig 2020-02-02 01:00:00.000000000 +0100
++++ hatchling-1.27.0/src/hatchling/metadata/core.py 2025-06-19 15:07:27.916613000 +0200
+@@ -11,6 +11,7 @@
+ is_valid_project_name,
+ normalize_project_name,
+ normalize_requirement,
++ name_normalization,
+ )
+ from hatchling.plugin.manager import PluginManagerBound
+ from hatchling.utils.constants import DEFAULT_CONFIG_FILE
+@@ -429,7 +430,7 @@
+ https://peps.python.org/pep-0621/#name
+ """
+ if self._name is None:
+- self._name = normalize_project_name(self.raw_name)
++ self._name = name_normalization(self.raw_name)
+
+ return self._name
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-hatchling.git/commitdiff/f6e8dec740c69ed6a61dfacd6f19e12b63435e3d
More information about the pld-cvs-commit
mailing list