diff --git a/.gitignore b/.gitignore index d543ea7..f510175 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1 @@ -/setuptools-rust-0.11.6.tar.gz -/setuptools-rust-0.12.0.tar.gz -/setuptools-rust-0.12.1.tar.gz -/setuptools-rust-1.0.0.tar.gz -/setuptools-rust-1.1.2.tar.gz -/setuptools-rust-1.2.0.tar.gz -/setuptools-rust-1.5.2.tar.gz -/setuptools-rust-1.6.0.tar.gz +SOURCES/setuptools-rust-1.7.0.tar.gz diff --git a/.python-setuptools-rust.metadata b/.python-setuptools-rust.metadata new file mode 100644 index 0000000..fa735d9 --- /dev/null +++ b/.python-setuptools-rust.metadata @@ -0,0 +1 @@ +a8a6f454b45b6a62f1ef2a69f5bf0c2e41407067 SOURCES/setuptools-rust-1.7.0.tar.gz diff --git a/SOURCES/8203ca9d.patch b/SOURCES/8203ca9d.patch new file mode 100644 index 0000000..90c9c9a --- /dev/null +++ b/SOURCES/8203ca9d.patch @@ -0,0 +1,22 @@ +From 8203ca9dc9ee8c8257591bf7e8c122ac1d152009 Mon Sep 17 00:00:00 2001 +From: David Hewitt +Date: Tue, 7 May 2024 21:49:16 +0100 +Subject: [PATCH] fix pytest error + +--- + tests/test_extension.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_extension.py b/tests/test_extension.py +index 69f86132..28315649 100644 +--- a/tests/test_extension.py ++++ b/tests/test_extension.py +@@ -42,7 +42,7 @@ def test_metadata_cargo_log( + hello_world_bin.metadata(quiet=False) + captured = capfd.readouterr() + assert captured.out == "" +- assert "TRACE cargo::util::config" in captured.err ++ assert "TRACE" in captured.err + + # With quiet set, nothing will be printed + hello_world_bin.metadata(quiet=True) diff --git a/SPECS/python-setuptools-rust.spec b/SPECS/python-setuptools-rust.spec new file mode 100644 index 0000000..d12dffd --- /dev/null +++ b/SPECS/python-setuptools-rust.spec @@ -0,0 +1,248 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.6.5) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 13; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + +# RHEL does not have packaged rust libraries +%bcond packaged_rust_libraries %{undefined rhel} +# The integration tests depend on the presence of these libraries +%bcond integration_tests %{with packaged_rust_libraries} +# Regex of integration tests to skip. +# * html-py-ever requires unpackaged rust crates +%global integration_tests_exc '^(html-py-ever)' + +Name: python-setuptools-rust +Version: 1.7.0 +Release: %autorelease +Summary: Setuptools Rust extension plugin + +License: MIT +URL: https://github.com/PyO3/setuptools-rust +Source0: %{pypi_source setuptools-rust} + +# Fix FTBFS with cargo 1.78+ +# Cherry-picked from https://github.com/PyO3/setuptools-rust/pull/428 (merged) +Patch: https://github.com/PyO3/setuptools-rust/commit/8203ca9d.patch + +BuildArch: noarch + +BuildRequires: python3-devel +BuildRequires: %{py3_dist pytest} +%if 0%{?fedora} +BuildRequires: rust-packaging +%else +# RHEL has rust-toolset instead of rust-packaging +BuildRequires: rust-toolset >= 1.45 +%endif +%if %{with integration_tests} +BuildRequires: %{py3_dist cffi} +%endif + + +%global _description %{expand: +Setuptools helpers for Rust Python extensions. Compile and distribute Python +extensions written in Rust as easily as if they were written in C.} + +%description %{_description} + + +%package -n python3-setuptools-rust +Summary: %{summary} +Requires: cargo + +%description -n python3-setuptools-rust %{_description} + + +%prep +%autosetup -p1 -n setuptools-rust-%{version} + +%cargo_prep + +%if %{with integration_tests} +for example in $(ls examples/ | grep -vE %{integration_tests_exc}); do + cd "examples/${example}" + %cargo_prep + cd - +done +%endif + + +%generate_buildrequires +%pyproject_buildrequires +%if %{with integration_tests} +for example in $(ls examples/ | grep -vE %{integration_tests_exc}); do + cd "examples/${example}" + %cargo_generate_buildrequires + cd - >&2 +done +%endif + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files setuptools_rust + + +%check +%pyproject_check_import +# Disable tests that require internet access and/or test Windows functionality +%global test_ignores %{shrink: + not test_adjusted_local_rust_target_windows_msvc + and not test_get_lib_name_namespace_package +} + +%if %{without packaged_rust_libraries} +%global test_ignores %{shrink:%{test_ignores} + and not test_metadata_contents + and not test_metadata_cargo_log +} +%endif + +%pytest tests/ setuptools_rust/ --import-mode importlib -k '%{test_ignores}' + +%if %{with integration_tests} +export %{py3_test_envvars} +%global _pyproject_wheeldir dist +for example in $(ls examples/ | grep -vE %{integration_tests_exc}); do + cd "examples/${example}" + %pyproject_wheel + if [ -d "tests/" ]; then + %{python3} -m venv venv --system-site-packages + ./venv/bin/pip install dist/*.whl + ./venv/bin/python -Pm pytest tests/ + fi + cd - +done +%endif + + +%files -n python3-setuptools-rust -f %{pyproject_files} +%doc README.md CHANGELOG.md +%license LICENSE + + +%changelog +* Sun Jan 05 2025 Arkady L. Shane - 1.7.0-13 +- Rebuilt for MSVSphere 10 + +## START: Generated by rpmautospec +* Mon Aug 05 2024 Yaakov Selkowitz - 1.7.0-13 +- Depend only on cargo at runtime + +* Fri Jul 19 2024 Fedora Release Engineering - 1.7.0-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Fri Jun 07 2024 Python Maint - 1.7.0-11 +- Rebuilt for Python 3.13 + +* Wed May 29 2024 Miro Hrončok - 1.7.0-10 +- Fix FTBFS with cargo 1.78+ +- Fixes: rhbz#2279993 + +* Fri Jan 26 2024 Fedora Release Engineering - 1.7.0-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 1.7.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Aug 31 2023 Maxwell G - 1.7.0-7 +- Fix inaccurate RHEL comment + +* Thu Aug 31 2023 Maxwell G - 1.7.0-6 +- Use pyproject_wheel instead of calling hook directly + +* Thu Aug 31 2023 Maxwell G - 1.7.0-5 +- Use direct paths instead of activating venvs + +* Thu Aug 31 2023 Maxwell G - 1.7.0-4 +- Use %%py3_test_envvars instead of manually setting PYTHONPATH + +* Wed Aug 23 2023 Maxwell G - 1.7.0-3 +- Modernize the specfile and run all tests + +* Wed Aug 23 2023 Maxwell G - 1.7.0-2 +- Remove obsolete `ExcludeArch: %%{rust_arches}` + +* Wed Aug 23 2023 Christian Heimes - 1.7.0-1 +- Update to 1.7.0, fixes rhbz#2233656 +- modernize packaging, upstream has remove setup.py +- remove setup.cfg hacks for RHEL + +* Fri Jul 21 2023 Fedora Release Engineering - 1.6.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed Jun 14 2023 Python Maint - 1.6.0-4 +- Rebuilt for Python 3.12 + +* Thu Jun 08 2023 Miro Hrončok - 1.6.0-3 +- Try to switch to the proper branch + +* Thu Jun 08 2023 Miro Hrončok - 1.6.0-2 +- CI: Build python-cryptography + +* Mon May 22 2023 Maxwell G - 1.6.0-1 +- Update to 1.6.0. Fixes rhbz#2190299. + +* Mon May 22 2023 Fabio Valentini - 1.5.2-3 +- Remove bogus dependency restriction on rust-packaging + +* Fri Jan 20 2023 Fedora Release Engineering - 1.5.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Mon Dec 19 2022 Tomáš Hrnčiar - 1.5.2-1 +- Update to 1.5.2 + +* Fri Jul 22 2022 Fedora Release Engineering - 1.2.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Tue Jun 14 2022 Python Maint - 1.2.0-2 +- Rebuilt for Python 3.11 + +* Wed Mar 23 2022 Christian Heimes - 1.2.0-1 +- Update to 1.2.0, fixes RHBZ#2066883 + +* Fri Jan 21 2022 Fedora Release Engineering - 1.1.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Dec 06 2021 Christian Heimes - 1.1.2-1 +- Update to 1.1.2, fixes RHBZ#2027601 + +* Mon Nov 22 2021 Christian Heimes - 1.0.0-1 +- Update to 1.0.0, fixes RHBZ#2025354 + +* Fri Jul 23 2021 Fedora Release Engineering - 0.12.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jun 02 2021 Python Maint - 0.12.1-2 +- Rebuilt for Python 3.10 + +* Thu Mar 11 2021 Christian Heimes - 0.12.1-1 +- Update to 0.12.1 + +* Tue Mar 09 2021 Christian Heimes - 0.12.0-1 +- Update to 0.12.0 (#1936679) +- Run tomlgen example as test case + +* Thu Feb 11 2021 Christian Heimes - 0.11.6-4 +- Fix RHEL build: remove wheel build requirements, use rust-toolset + +* Thu Feb 11 2021 Christian Heimes - 0.11.6-3 +- Add RHEL packaging support + +* Wed Jan 27 2021 Fedora Release Engineering - 0.11.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Thu Jan 14 2021 Christian Heimes - 0.11.6-1 +- Initial package. +- Resolves: rhbz#1906490 + +## END: Generated by rpmautospec diff --git a/python-setuptools-rust.spec b/python-setuptools-rust.spec deleted file mode 100644 index 81c48da..0000000 --- a/python-setuptools-rust.spec +++ /dev/null @@ -1,93 +0,0 @@ -%if 0%{?rhel} -%bcond_with tests -%else -%bcond_without tests -%endif - -Name: python-setuptools-rust -Version: 1.6.0 -Release: %autorelease -Summary: Setuptools Rust extension plugin - -License: MIT -URL: https://github.com/PyO3/setuptools-rust -Source0: %{pypi_source setuptools-rust} -BuildArch: noarch -ExclusiveArch: %{rust_arches} - -BuildRequires: python3-devel -BuildRequires: python3dist(setuptools) > 46.1 -BuildRequires: python3dist(semantic-version) >= 2.8.2 -BuildRequires: python3dist(typing-extensions) >= 3.7.4.4 -%if 0%{?fedora} -BuildRequires: python3dist(wheel) -BuildRequires: rust-packaging -%else -# RHEL has rust-toolset and neither setuptools-scm nor wheel -BuildRequires: rust-toolset >= 1.45 -%endif -%if %{with tests} -BuildRequires: rust-pyo3+default-devel -%endif - -%description -Setuptools helpers for Rust Python extensions. Compile and distribute Python -extensions written in Rust as easily as if they were written in C. - -%package -n python3-setuptools-rust -Summary: %{summary} -%if 0%{?fedora} -Requires: rust-packaging -%else -Requires: rust-toolset >= 1.45 -%endif - -%description -n python3-setuptools-rust -Setuptools helpers for Rust Python extensions. Compile and distribute Python -extensions written in Rust as easily as if they were written in C. - -%prep -%autosetup -n setuptools-rust-%{version} -# Remove bundled egg-info -rm -rf setuptools-rust.egg-info - -%if ! 0%{?fedora} -# RHEL doesn't have setuptools-scm -# remove setuptools-scm -rm pyproject.toml -sed -i 's/setup_requires.*//' setup.cfg - -# create version.py without setuptools-scm -cat > setuptools_rust/version.py << EOF -version = '%{VERSION}' -version_tuple = ($(echo %{VERSION} | sed 's/\./, /g')) -EOF -%endif - - -%build -%py3_build - -%install -%py3_install - -%check -PYTHONPATH=%{buildroot}%{python3_sitelib} \ - %{__python3} -c "from setuptools_rust import RustExtension, version" - -%if %{with tests} -cd examples/hello-world -%cargo_prep -PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} setup.py build -cd ../.. -%endif - - -%files -n python3-setuptools-rust -%doc README.md CHANGELOG.md -%license LICENSE -%{python3_sitelib}/setuptools_rust/ -%{python3_sitelib}/setuptools_rust-%{version}-py%{python3_version}.egg-info/ - -%changelog -%autochangelog diff --git a/sources b/sources deleted file mode 100644 index 966c06f..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -SHA512 (setuptools-rust-1.6.0.tar.gz) = cf6b2df2609f17ce261536d9bc71f2aee615eaf89a43a55c9c5cef4147f04517c169ad565bcd40347d3d6c79c120ad1fee4841afe9a91ae5588e82dbfb2c55df