From 4e43f5954ab5a9a8b3433bc5654c6ca527de2cceb81fa43aa80330255773f7e4 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 3 Jun 2024 06:11:13 +0000 Subject: [PATCH] - Add patch support-setuptools-69-3.patch: * Support changes introduced by setuptools 69.3.0. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-scikit-build?expand=0&rev=44 --- python-scikit-build.changes | 6 +++ python-scikit-build.spec | 6 ++- support-setuptools-69-3.patch | 84 +++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 support-setuptools-69-3.patch diff --git a/python-scikit-build.changes b/python-scikit-build.changes index 6eda582..6731c8c 100644 --- a/python-scikit-build.changes +++ b/python-scikit-build.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jun 3 06:10:14 UTC 2024 - Steve Kowalik + +- Add patch support-setuptools-69-3.patch: + * Support changes introduced by setuptools 69.3.0. + ------------------------------------------------------------------- Sat Jul 1 13:49:46 UTC 2023 - Ben Greiner diff --git a/python-scikit-build.spec b/python-scikit-build.spec index c49e952..6089870 100644 --- a/python-scikit-build.spec +++ b/python-scikit-build.spec @@ -1,7 +1,7 @@ # -# spec file +# spec file for package python-scikit-build # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -34,6 +34,8 @@ License: MIT URL: https://github.com/scikit-build/scikit-build Source: https://files.pythonhosted.org/packages/source/s/scikit-build/scikit_build-%{version}.tar.gz Source99: sample-setup.cfg +# PATCH-FIX-UPSTREAM gh#scikit-build/scikit-build#1087 +Patch0: support-setuptools-69-3.patch BuildRequires: %{python_module devel >= 3.7} BuildRequires: %{python_module hatch-fancy-pypi-readme} BuildRequires: %{python_module hatch-vcs} diff --git a/support-setuptools-69-3.patch b/support-setuptools-69-3.patch new file mode 100644 index 0000000..6062d8f --- /dev/null +++ b/support-setuptools-69-3.patch @@ -0,0 +1,84 @@ +From d0655bdcb9f27b9d64c582b947a7b56732f76c82 Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +Date: Mon, 3 Jun 2024 15:53:10 +1000 +Subject: [PATCH] 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. +--- + tests/test_hello_cython.py | 23 ++++++++++++++--------- + tests/test_hello_pure.py | 15 ++++++++++----- + 2 files changed, 24 insertions(+), 14 deletions(-) + +diff --git a/tests/test_hello_cython.py b/tests/test_hello_cython.py +index dc95f697..1d9e944d 100644 +--- a/tests/test_hello_cython.py ++++ b/tests/test_hello_cython.py +@@ -29,20 +29,25 @@ def test_hello_cython_sdist(): + 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"]) +diff --git a/tests/test_hello_pure.py b/tests/test_hello_pure.py +index 21b0840b..cc176854 100644 +--- a/tests/test_hello_pure.py ++++ b/tests/test_hello_pure.py +@@ -27,16 +27,21 @@ def test_hello_pure_sdist(): + 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)