commit
bfc17cb97d
@ -0,0 +1 @@
|
|||||||
|
SOURCES/python-zlib-ng-0.5.1.tar.gz
|
@ -0,0 +1 @@
|
|||||||
|
98471e35f342a6ce9db7df8cc34246efdeab73d2 SOURCES/python-zlib-ng-0.5.1.tar.gz
|
@ -0,0 +1,81 @@
|
|||||||
|
From a73adb1859fd89df67abfaa48f9c7f48a2d41748 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
|
||||||
|
Date: Wed, 25 Sep 2024 08:16:24 -0400
|
||||||
|
Subject: [PATCH] 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.
|
||||||
|
---
|
||||||
|
.gitignore | 2 --
|
||||||
|
pyproject.toml | 9 +--------
|
||||||
|
setup.py | 4 +---
|
||||||
|
src/zlib_ng/_version.py | 1 +
|
||||||
|
4 files changed, 3 insertions(+), 13 deletions(-)
|
||||||
|
create mode 100644 src/zlib_ng/_version.py
|
||||||
|
|
||||||
|
diff --git a/.gitignore b/.gitignore
|
||||||
|
index 671f3ec..b6e4761 100644
|
||||||
|
--- a/.gitignore
|
||||||
|
+++ b/.gitignore
|
||||||
|
@@ -1,5 +1,3 @@
|
||||||
|
-src/zlib_ng/_version.py
|
||||||
|
-
|
||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
diff --git a/pyproject.toml b/pyproject.toml
|
||||||
|
index 28ae41d..b2fcc25 100644
|
||||||
|
--- a/pyproject.toml
|
||||||
|
+++ b/pyproject.toml
|
||||||
|
@@ -1,10 +1,3 @@
|
||||||
|
[build-system]
|
||||||
|
-requires = ["setuptools>=64", "versioningit>=1.1.0"]
|
||||||
|
+requires = ["setuptools>=64"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
-
|
||||||
|
-[tool.versioningit.vcs]
|
||||||
|
-method="git"
|
||||||
|
-default-tag = "v0.0.0"
|
||||||
|
-
|
||||||
|
-[tool.versioningit.write]
|
||||||
|
-file = "src/zlib_ng/_version.py"
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index 8959b04..600a84f 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -16,8 +16,6 @@ from pathlib import Path
|
||||||
|
from setuptools import Extension, find_packages, setup
|
||||||
|
from setuptools.command.build_ext import build_ext
|
||||||
|
|
||||||
|
-import versioningit
|
||||||
|
-
|
||||||
|
ZLIB_NG_SOURCE = os.path.join("src", "zlib_ng", "zlib-ng")
|
||||||
|
|
||||||
|
SYSTEM_IS_UNIX = (sys.platform.startswith("linux") or
|
||||||
|
@@ -126,7 +124,7 @@ def build_zlib_ng():
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name="zlib-ng",
|
||||||
|
- version=versioningit.get_version(),
|
||||||
|
+ version="@VERSION@",
|
||||||
|
description="Drop-in replacement for zlib and gzip modules using zlib-ng",
|
||||||
|
author="Leiden University Medical Center",
|
||||||
|
author_email="r.h.p.vorderman@lumc.nl", # A placeholder for now
|
||||||
|
diff --git a/src/zlib_ng/_version.py b/src/zlib_ng/_version.py
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..b238b3b
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/zlib_ng/_version.py
|
||||||
|
@@ -0,0 +1 @@
|
||||||
|
+__version__ = "@VERSION@"
|
||||||
|
--
|
||||||
|
2.46.1
|
||||||
|
|
@ -0,0 +1,180 @@
|
|||||||
|
## 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
|
Loading…
Reference in new issue