You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
python-zlib-ng/SPECS/python-zlib-ng.spec

181 lines
6.3 KiB

## START: Set by rpmautospec
## (rpmautospec version 0.7.2)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 2;
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
Name: python-zlib-ng
Version: 0.5.1
Release: %autorelease
Summary: Drop-in replacement for zlib and gzip modules using zlib-ng
# The entire source is PSF-2.0, since we do not use the vendored zlib-ng
# sources that would be present in the PyPI sdist. We use the GitHub archive
# because it contains tests and changelogs that the PyPI sdist lacks.
License: PSF-2.0
URL: https://github.com/pycompression/python-zlib-ng
Source: %{url}/archive/v%{version}/python-zlib-ng-%{version}.tar.gz
# EPEL10: Work around versioningit unavailability
#
# We can eventually have python-versioningit in EPEL10, but it requires
# python-pydantic v2, which needs rust-pyo3 and maturin in order to build
# pythn-pydantic-core. Since we already worked around not having
# python-versioningit in EPEL9 (where we have python-pydantic v1 and will
# not have v2 in the future), we might as well use the same workaround in
# EPEL10 to avoid having to wait on Pydantic v2.
#
# Instead of using versioningit, this patch provides @VERSION@ templates
# in setup.py and src/zlib_ng/_version.py, which should be replaced with
# the actual version number using sed.
Patch: 0001-EPEL10-Work-around-versioningit-unavailability.patch
BuildRequires: python3-devel
BuildRequires: gcc
BuildRequires: pkgconfig(zlib-ng)
# For convincing versioningit to do the right thing with a GitHub archive:
BuildRequires: git-core
# List test dependencies manually because this is easier than patching coverage
# out of tox.ini
# (https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters).
BuildRequires: %{py3_dist pytest}
BuildRequires: %{py3_dist pytest-timeout}
BuildRequires: python3-test
%global common_description %{expand:
Faster zlib and gzip compatible compression and decompression by providing
Python bindings for the zlib-ng library.
This package provides Python bindings for the zlib-ng library.
python-zlib-ng provides the bindings by offering three modules:
• zlib_ng: A drop-in replacement for the zlib module that uses zlib-ng to
accelerate its performance.
• gzip_ng: A drop-in replacement for the gzip module that uses zlib_ng
instead of zlib to perform its compression and checksum tasks, which
improves performance.
• gzip_ng_threaded offers an open function which returns buffered read or
write streams that can be used to read and write large files while escaping
the GIL using one or multiple threads. This functionality only works for
streaming, seeking is not supported.
zlib_ng and gzip_ng are almost fully compatible with zlib and gzip from the
Python standard library. There are some minor differences see:
https://pypi.org/project/zlib-ng/#differences-with-zlib-and-gzip-modules
Beginning with Fedora Linux 40, zlib-ng provides the system-wide zlib
implementation, so the Python standard library already uses it by default.
However, some projects still need the APIs provided by this package.}
%description %{common_description}
%package -n python3-zlib-ng
Summary: %{summary}
%description -n python3-zlib-ng %{common_description}
%prep
%autosetup -S git -p1
# Remove bundled zlib-ng library if present (not in GitHub archive because it
# is a git submodule, so this is just an extra precaution).
rm -rvf src/zlib_ng/zlib-ng
# Imitiate versioningit, which we are unable to backport to EPEL9.
sed -r -i 's/@VERSION@/%{version}/' setup.py src/zlib_ng/_version.py
%generate_buildrequires
%pyproject_buildrequires
%build
export CFLAGS="${CFLAGS} $(pkgconf --cflags zlib-ng)"
export LDFLAGS="${LDFLAGS} $(pkgconf --libs zlib-ng)"
export PYTHON_ZLIB_NG_LINK_DYNAMIC='1'
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files -l zlib_ng
%check
# It is difficult for us to run the CLI tests in this environment. We get:
#
# ModuleNotFoundError: No module named 'zlib_ng'
#
# … or similar, because test.support.script_helper from python3-test does not
# respect the PYTHONPATH set by the %%pytest macro.
#
# We choose to skip these few tests rather than putting a lot of effort into
# perhaps making it possible to run them.
k="${k-}${k+ and }not TestCommandLine"
# Note that it is *not* safe to run tests in parallel (pytest-xdist, -n auto)
# due to filesystem race conditions.
%pytest -v -k "${k-}" tests/
%files -n python3-zlib-ng -f %{pyproject_files}
%doc CHANGELOG.rst
%doc README.rst
%changelog
* Sun Jan 05 2025 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.5.1-2
- Rebuilt for MSVSphere 10
## START: Generated by rpmautospec
* Fri Oct 04 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.5.1-2
- Work around versioningit unavailability in EPEL10
* Wed Sep 25 2024 Packit <hello@packit.dev> - 0.5.1-1
- Update to 0.5.1 upstream release
- Resolves: rhbz#2314618
* Fri Aug 09 2024 Packit <hello@packit.dev> - 0.5.0-1
- Update to 0.5.0 upstream release
- Resolves: rhbz#2303861
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 0.4.3-3
- Rebuilt for Python 3.13
* Wed May 15 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.4.3-2
- Backport proposed Python 3.13 bug fix (fix RHBZ#2280571)
* Tue Apr 16 2024 Packit <hello@packit.dev> - 0.4.3-1
- Update to 0.4.3 upstream release
- Resolves: rhbz#2275298
* Wed Apr 10 2024 Packit <hello@packit.dev> - 0.4.2-1
- Update to 0.4.2 upstream release
- Resolves: rhbz#2274336
* Mon Mar 11 2024 Packit <hello@packit.dev> - 0.4.1-1
- [packit] 0.4.1 upstream release
- Resolves rhbz#2269022
* Tue Jan 23 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.4.0-3
- Fix Python 3.13 compatibility (close RHBZ#2259627)
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jan 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.4.0-1
- Initial package (close RHBZ#2257548)
## END: Generated by rpmautospec