public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-zstandard] epel9: switch to modern python packaging guidelines and automatic BuildRequires generation
@ 2026-08-13 8:05 Dominik 'Rathann' Mierzejewski
0 siblings, 0 replies; only message in thread
From: Dominik 'Rathann' Mierzejewski @ 2026-08-13 8:05 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-zstandard
Branch : epel9
Commit : 116bb772112ac74ca669c9ddbe87d3e489b4caa1
Author : Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
Date : 2024-10-03T20:19:36+02:00
Stats : +39/-19 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-zstandard/c/116bb772112ac74ca669c9ddbe87d3e489b4caa1?branch=epel9
Log:
switch to modern python packaging guidelines and automatic BuildRequires generation
relax dependencies to allow build on rawhide
---
diff --git a/python-zstandard-deps.patch b/python-zstandard-deps.patch
new file mode 100644
index 0000000..a86f4dc
--- /dev/null
+++ b/python-zstandard-deps.patch
@@ -0,0 +1,18 @@
+diff -up zstandard-0.23.0/pyproject.toml.orig zstandard-0.23.0/pyproject.toml
+--- zstandard-0.23.0/pyproject.toml.orig 2024-07-14 23:58:50.000000000 +0200
++++ zstandard-0.23.0/pyproject.toml 2024-10-03 16:27:20.742934487 +0200
+@@ -1,12 +1,12 @@
+ [build-system]
+ requires = [
+ "cffi>=1.16.0; python_version <= '3.12'",
+- "cffi==1.17.0rc1; python_version >= '3.13'",
++ "cffi>=1.17.0; python_version >= '3.13'",
+ # 69.0.0 breaks handling of --config-settings=--build-option, which our CI
+ # relies on. So constrained to an older version until we figure out a
+ # workaround. See comment at
+ # https://github.com/pypa/pip/issues/11859#issuecomment-2132287974.
+- "setuptools<69.0.0",
++ "setuptools",
+ ]
+ # Need to use legacy backend because setup_zstd.py breaks build isolation.
+ build-backend = "setuptools.build_meta:__legacy__"
diff --git a/python-zstandard.spec b/python-zstandard.spec
index 925f7fe..f493700 100644
--- a/python-zstandard.spec
+++ b/python-zstandard.spec
@@ -5,14 +5,6 @@
%endif
%global pypi_name zstandard
-%if 0%{!?pytest:1}
-%global pytest %{expand:\\\
- CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
- PATH="%{buildroot}%{_bindir}:$PATH"\\\
- PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\
- PYTHONDONTWRITEBYTECODE=1\\\
- /usr/bin/pytest}
-%endif
%global desc This project provides Python bindings for interfacing with the Zstandard\
compression library. A C extension and CFFI interface are provided.
@@ -25,6 +17,8 @@ License: (BSD-3-Clause OR GPL-2.0-only) AND MIT
URL: https://github.com/indygreg/python-zstandard
Source0: %{pypi_source}
Patch0: %{name}-py313.patch
+# relax dependencies so that auto BR generation works
+Patch1: %{name}-deps.patch
%description
%{desc}
@@ -34,12 +28,9 @@ Summary: %{summary}
BuildRequires: gcc
BuildRequires: libzstd-devel
BuildRequires: python3-devel
-BuildRequires: python3-setuptools
-BuildRequires: python3-cffi
%if %{with check}
-BuildRequires: python3-hypothesis
-BuildRequires: python3-pytest
-BuildRequires: python3-pytest-xdist
+BuildRequires: python3dist(pytest)
+BuildRequires: python3dist(pytest-xdist)
%endif
# https://github.com/indygreg/python-zstandard/issues/48
Provides: bundled(zstd) = 1.5.6
@@ -47,18 +38,29 @@ Provides: bundled(zstd) = 1.5.6
%description -n python3-%{pypi_name}
%{desc}
+%pyproject_extras_subpkg -n python3-%{pypi_name} cffi
+
%prep
%autosetup -p1 -n %{pypi_name}-%{version}
rm -r %{pypi_name}.egg-info
+%generate_buildrequires
+%if %{with check}
+%pyproject_buildrequires -x cffi -t
+%else
+%pyproject_buildrequires -x cffi
+%endif
+
%build
-%py3_build
+%pyproject_wheel
%install
-%py3_install
+%pyproject_install
+%pyproject_save_files -l %{pypi_name}
-%if %{with check}
%check
+%pyproject_check_import
+%if %{with check}
mv zstandard{,.src}
export ZSTD_SLOW_TESTS=1
%pytest -v\
@@ -66,15 +68,15 @@ export ZSTD_SLOW_TESTS=1
mv zstandard{.src,}
%endif
-%files -n python3-%{pypi_name}
+%files -n python3-%{pypi_name} -f %{pyproject_files}
%license LICENSE zstd/COPYING
%doc README.rst
-%{python3_sitearch}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
-%{python3_sitearch}/%{pypi_name}
%changelog
* Thu Oct 03 2024 Dominik Mierzejewski <dominik@greysector.net> - 0.23.0-1
- update to 0.23.0 (resolves rhbz#2298052)
+- switch to modern python packaging guidelines
+ and automatic BuildRequires generation
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-13 8:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-13 8:05 [rpms/python-zstandard] epel9: switch to modern python packaging guidelines and automatic BuildRequires generation Dominik 'Rathann' Mierzejewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox