Package: scikit-build
Version: 0.17.6-2
Followup-For: Bug #1076313
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu oracular ubuntu-patch
Control: tags -1 patch

Dear Maintainer,

Would it be possible to consider the attached patch as the solution for this
issue?
I have cherry-picked upstream patches that fix setuptools 0.69 and 0.70
compatibility issues.

  * Resolve setuptools ftbfs (LP: #2074032):
    - d/p/0002-tests-fix-for-distutils-change.patch: apply upstream
      patch to resolve ftbfs due to tests assiging internal setuptools
      variable.Thanks to Henry Schreiner <henryschreiner...@gmail.com>.
    - d/p/0003-tests-support-setuptools-69.3.0-changes.patch: apply
      upstream patch to update test assertions.
      Thanks to Steve Kowalik <ste...@wedontsleep.org>


Thanks for considering the patch.


-- System Information:
Debian Release: trixie/sid
  APT prefers noble-updates
  APT policy: (500, 'noble-updates'), (500, 'noble-security'), (500, 'noble'), 
(100, 'noble-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.8.0-38-generic (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru 
scikit-build-0.17.6/debian/patches/0002-tests-fix-for-distutils-change.patch 
scikit-build-0.17.6/debian/patches/0002-tests-fix-for-distutils-change.patch
--- 
scikit-build-0.17.6/debian/patches/0002-tests-fix-for-distutils-change.patch    
    1970-01-01 12:00:00.000000000 +1200
+++ 
scikit-build-0.17.6/debian/patches/0002-tests-fix-for-distutils-change.patch    
    2024-07-25 10:55:45.000000000 +1200
@@ -0,0 +1,23 @@
+Description: tests: fix for distutils change
+ Clear global variable instead of reassigning it.
+ The type of _path_created has changed from dict to set
+ and test initialization was causing an error.
+Author: Henry Schreiner <henryschreiner...@gmail.com>
+Origin: upstream, 
https://github.com/scikit-build/scikit-build/commit/7005897053bc5c71d823c36bbd89bd43121670f1
+Bug: https://github.com/scikit-build/scikit-build/pull/1103
+Bug-Ubuntu: https://bugs.launchpad.net/debian/+source/scikit-build/+bug/2074032
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076313
+Last-Update: 2024-07-25
+---
+
+--- a/tests/__init__.py
++++ b/tests/__init__.py
+@@ -217,7 +217,7 @@
+     """
+
+     # See 
https://stackoverflow.com/questions/9160227/dir-util-copy-tree-fails-after-shutil-rmtree
+-    distutils.dir_util._path_created = {}  # type: ignore[attr-defined]
++    distutils.dir_util._path_created.clear()  # type: ignore[attr-defined]
+
+     # Clear _PYTHON_HOST_PLATFORM to ensure value sets in 
skbuild.setuptools_wrap.setup() does not
+     # influence other tests.
diff -Nru 
scikit-build-0.17.6/debian/patches/0003-tests-support-setuptools-69.3.0-changes.patch
 
scikit-build-0.17.6/debian/patches/0003-tests-support-setuptools-69.3.0-changes.patch
--- 
scikit-build-0.17.6/debian/patches/0003-tests-support-setuptools-69.3.0-changes.patch
       1970-01-01 12:00:00.000000000 +1200
+++ 
scikit-build-0.17.6/debian/patches/0003-tests-support-setuptools-69.3.0-changes.patch
       2024-07-25 10:55:45.000000000 +1200
@@ -0,0 +1,153 @@
+Subject: tests: support setuptools 69.3.0 changes in two tests
+ setuptools 69.3.0 now canonicalizes package names in filenames, which
+ means all dashes are now converted to underscores, leading to test
+ failures due to FileNotFoundErrors. Handle both cases to support older
+ and newer setuptools.
+Author: Steve Kowalik <ste...@wedontsleep.org>
+Origin: upstream, 
https://github.com/scikit-build/scikit-build/commit/4dab4576d7a480da7484cfc5c249c86f7d3ecde3
+Bug: https://github.com/scikit-build/scikit-build/pull/1087
+Bug-Ubuntu: https://bugs.launchpad.net/debian/+source/scikit-build/+bug/2074032
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076313
+Last-Update: 2024-07-25
+---
+
+--- a/tests/test_hello_cython.py
++++ b/tests/test_hello_cython.py
+@@ -34,20 +34,25 @@
+     sdists_zip = glob.glob("dist/*.zip")
+     assert sdists_tar or sdists_zip
+
++    dirname = "hello-cython-1.2.3"
++    # setuptools 69.3.0 and above now canonicalize the filename as well.
++    if any("hello_cython" in x for x in sdists_zip + sdists_tar):
++        dirname = "hello_cython-1.2.3"
++
+     expected_content = [
+-        "hello-cython-1.2.3/CMakeLists.txt",
+-        "hello-cython-1.2.3/hello/_hello.pyx",
+-        "hello-cython-1.2.3/hello/CMakeLists.txt",
+-        "hello-cython-1.2.3/hello/__init__.py",
+-        "hello-cython-1.2.3/hello/__main__.py",
+-        "hello-cython-1.2.3/setup.py",
++        f"{dirname}/CMakeLists.txt",
++        f"{dirname}/hello/_hello.pyx",
++        f"{dirname}/hello/CMakeLists.txt",
++        f"{dirname}/hello/__init__.py",
++        f"{dirname}/hello/__main__.py",
++        f"{dirname}/setup.py",
+     ]
+
+-    sdist_archive = "dist/hello-cython-1.2.3.zip"
++    sdist_archive = f"dist/{dirname}.zip"
+     if sdists_tar:
+-        sdist_archive = "dist/hello-cython-1.2.3.tar.gz"
++        sdist_archive = f"dist/{dirname}.tar.gz"
+
+-    check_sdist_content(sdist_archive, "hello-cython-1.2.3", 
expected_content, package_dir="hello")
++    check_sdist_content(sdist_archive, dirname, expected_content, 
package_dir="hello")
+
+
+ @project_setup_py_test("hello-cython", ["bdist_wheel"])
+--- a/tests/test_hello_fortran.py
++++ b/tests/test_hello_fortran.py
+@@ -33,23 +33,28 @@
+     sdists_zip = glob.glob("dist/*.zip")
+     assert sdists_tar or sdists_zip
+
++    dirname = "hello-fortran-1.2.3"
++    # setuptools 69.3.0 and above now canonicalize the filename as well.
++    if any("hello_fortran" in x for x in sdists_zip + sdists_tar):
++        dirname = "hello_fortran-1.2.3"
++
+     expected_content = [
+-        "hello-fortran-1.2.3/bonjour/_bonjour.f90",
+-        "hello-fortran-1.2.3/bonjour/_bonjour.pyf",
+-        "hello-fortran-1.2.3/bonjour/CMakeLists.txt",
+-        "hello-fortran-1.2.3/CMakeLists.txt",
+-        "hello-fortran-1.2.3/hello/_hello.f90",
+-        "hello-fortran-1.2.3/hello/CMakeLists.txt",
+-        "hello-fortran-1.2.3/hello/__init__.py",
+-        "hello-fortran-1.2.3/hello/__main__.py",
+-        "hello-fortran-1.2.3/setup.py",
++        f"{dirname}/bonjour/_bonjour.f90",
++        f"{dirname}/bonjour/_bonjour.pyf",
++        f"{dirname}/bonjour/CMakeLists.txt",
++        f"{dirname}/CMakeLists.txt",
++        f"{dirname}/hello/_hello.f90",
++        f"{dirname}/hello/CMakeLists.txt",
++        f"{dirname}/hello/__init__.py",
++        f"{dirname}/hello/__main__.py",
++        f"{dirname}/setup.py",
+     ]
+
+-    sdist_archive = "dist/hello-fortran-1.2.3.zip"
++    sdist_archive = f"dist/{dirname}.zip"
+     if sdists_tar:
+-        sdist_archive = "dist/hello-fortran-1.2.3.tar.gz"
++        sdist_archive = f"dist/{dirname}.tar.gz"
+
+-    check_sdist_content(sdist_archive, "hello-fortran-1.2.3", 
expected_content)
++    check_sdist_content(sdist_archive, dirname, expected_content)
+
+
+ @pytest.mark.fortran()
+--- a/tests/test_hello_pure.py
++++ b/tests/test_hello_pure.py
+@@ -32,16 +32,21 @@
+     sdists_zip = glob.glob("dist/*.zip")
+     assert sdists_tar or sdists_zip
+
++    dirname = "hello-pure-1.2.3"
++    # setuptools 69.3.0 and above now canonicalize the filename as well.
++    if any("hello_pure" in x for x in sdists_zip + sdists_tar):
++        dirname = "hello_pure-1.2.3"
++
+     expected_content = [
+-        "hello-pure-1.2.3/hello/__init__.py",
+-        "hello-pure-1.2.3/setup.py",
++        f"{dirname}/hello/__init__.py",
++        f"{dirname}/setup.py",
+     ]
+
+-    sdist_archive = "dist/hello-pure-1.2.3.zip"
++    sdist_archive = f"dist/{dirname}.zip"
+     if sdists_tar:
+-        sdist_archive = "dist/hello-pure-1.2.3.tar.gz"
++        sdist_archive = f"dist/{dirname}.tar.gz"
+
+-    check_sdist_content(sdist_archive, "hello-pure-1.2.3", expected_content)
++    check_sdist_content(sdist_archive, dirname, expected_content)
+
+
+ @project_setup_py_test("hello-pure", ["bdist_wheel"], 
disable_languages_test=True)
+--- a/tests/test_manifest_in.py
++++ b/tests/test_manifest_in.py
+@@ -21,17 +21,22 @@
+     sdists_zip = glob.glob("dist/*.zip")
+     assert sdists_tar or sdists_zip
+
++    dirname = "manifest-in-1.2.3"
++    # setuptools 69.3.0 and above now canonicalize the filename as well.
++    if any("manifest_in" in x for x in sdists_zip + sdists_tar):
++        dirname = "manifest_in-1.2.3"
++
+     expected_content = [
+-        "manifest-in-1.2.3/hello/__init__.py",
+-        "manifest-in-1.2.3/setup.py",
+-        "manifest-in-1.2.3/MANIFEST.in",
++        f"{dirname}/hello/__init__.py",
++        f"{dirname}/setup.py",
++        f"{dirname}/MANIFEST.in",
+     ]
+
+-    sdist_archive = "dist/manifest-in-1.2.3.zip"
++    sdist_archive = f"dist/{dirname}.zip"
+     if sdists_tar:
+-        sdist_archive = "dist/manifest-in-1.2.3.tar.gz"
++        sdist_archive = f"dist/{dirname}.tar.gz"
+
+-    check_sdist_content(sdist_archive, "manifest-in-1.2.3", expected_content)
++    check_sdist_content(sdist_archive, dirname, expected_content)
+
+
+ @project_setup_py_test("manifest-in", ["bdist_wheel"], 
disable_languages_test=True)
diff -Nru scikit-build-0.17.6/debian/patches/series 
scikit-build-0.17.6/debian/patches/series
--- scikit-build-0.17.6/debian/patches/series   2024-04-27 12:01:05.000000000 
+1200
+++ scikit-build-0.17.6/debian/patches/series   2024-07-25 10:55:45.000000000 
+1200
@@ -1 +1,3 @@
 0001-Remove-cmake-extension.patch
+0002-tests-fix-for-distutils-change.patch
+0003-tests-support-setuptools-69.3.0-changes.patch

Reply via email to