#114 Python 3.13 compatibility patches
Merged a month ago by churchyard. Opened a month ago by churchyard.
rpms/ churchyard/python-setuptools python3.13_  into  rawhide

file added
+40
@@ -0,0 +1,40 @@ 

+ From d53bf1509f40c8e84feb62ac13e91b76074a063a Mon Sep 17 00:00:00 2001

+ From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>

+ Date: Tue, 14 May 2024 16:19:02 +0200

+ Subject: [PATCH] Explicitly disallow resource paths starting with single

+  backslash

+ 

+ Previously, such paths were disallowed implicitly

+ as they were treated as Windows absolute paths.

+ 

+ Since Python 3.13, paths starting with a single backslash are not considered

+ Windows-absolute, so we treat them specially.

+ 

+ This change makes the existing doctest pass with Python 3.13.

+ 

+ Partially fixes https://github.com/pypa/setuptools/issues/4196

+ ---

+  pkg_resources/__init__.py | 3 ++-

+  1 file changed, 2 insertions(+), 1 deletion(-)

+ 

+ diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py

+ index 713d9bdfa3..faee7dec79 100644

+ --- a/pkg_resources/__init__.py

+ +++ b/pkg_resources/__init__.py

+ @@ -1604,6 +1604,7 @@ def _validate_resource_path(path):

+              os.path.pardir in path.split(posixpath.sep)

+              or posixpath.isabs(path)

+              or ntpath.isabs(path)

+ +            or path.startswith("\\")

+          )

+          if not invalid:

+              return

+ @@ -1611,7 +1612,7 @@ def _validate_resource_path(path):

+          msg = "Use of .. or absolute path in a resource path is not allowed."

+  

+          # Aggressively disallow Windows absolute paths

+ -        if ntpath.isabs(path) and not posixpath.isabs(path):

+ +        if (path.startswith("\\") or ntpath.isabs(path)) and not posixpath.isabs(path):

+              raise ValueError(msg)

+  

+          # for compatibility, warn; in future

file added
+30
@@ -0,0 +1,30 @@ 

+ From c6266e423fa26aafa01f1df71de7c6613273155e Mon Sep 17 00:00:00 2001

+ From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>

+ Date: Tue, 14 May 2024 16:24:07 +0200

+ Subject: [PATCH] Make the validation test for entry-points work with Python

+  3.13+

+ 

+ The exception in importlib.metadata has changed.

+ See https://github.com/python/importlib_metadata/issues/488

+ 

+ This makes an existing test pass with Python 3.13.

+ 

+ Partially fixes https://github.com/pypa/setuptools/issues/4196

+ ---

+  setuptools/_entry_points.py | 3 ++-

+  1 file changed, 2 insertions(+), 1 deletion(-)

+ 

+ diff --git a/setuptools/_entry_points.py b/setuptools/_entry_points.py

+ index 747a69067e..b244e78387 100644

+ --- a/setuptools/_entry_points.py

+ +++ b/setuptools/_entry_points.py

+ @@ -17,7 +17,8 @@ def ensure_valid(ep):

+      """

+      try:

+          ep.extras

+ -    except AttributeError as ex:

+ +    except (AttributeError, AssertionError) as ex:

+ +        # Why both? See https://github.com/python/importlib_metadata/issues/488

+          msg = (

+              f"Problems to parse {ep}.\nPlease ensure entry-point follows the spec: "

+              "https://packaging.python.org/en/latest/specifications/entry-points/"

file modified
+4
@@ -45,6 +45,10 @@ 

  # adjust it, but only when $RPM_BUILD_ROOT is set

  Patch:          Adjust-the-setup.py-install-deprecation-message.patch

  

+ # Python 3.13 compatibility patches, merged upstream

+ Patch:          https://github.com/pypa/setuptools/pull/4356.patch

+ Patch:          https://github.com/pypa/setuptools/pull/4357.patch

+ 

  BuildArch:      noarch

  

  BuildRequires:  python%{python3_pkgversion}-devel

A local Python 3.13 mockbuild passed for me.

https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-setuptools triggered but failed due to repo 404

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/20a7e3c138474603b64394e3a2c6089d

rebased onto 7731644

a month ago

Amended:

-# Python 3.13 compatibility patches, proposed upstream
+# Python 3.13 compatibility patches, merged upstream

LGTM and it builds correctly. Ship it!

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/1bcaaede5f0a4f3e985791b6b51f41d0

Pull-Request has been merged by churchyard

a month ago