public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-cramjam] f43: Update to 2.12.0 (close RHBZ#2457848)
@ 2026-08-22 8:24 Benjamin A. Beasley
0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-08-22 8:24 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-cramjam
Branch : f43
Commit : 25b517bf570dd0469c5477df2d2269b135244582
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date : 2026-08-22T08:41:26+01:00
Stats : +57/-384 in 5 file(s)
URL : https://src.fedoraproject.org/rpms/python-cramjam/c/25b517bf570dd0469c5477df2d2269b135244582?branch=f43
Log:
Update to 2.12.0 (close RHBZ#2457848)
---
diff --git a/.gitignore b/.gitignore
index a7a581a..0c95501 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@
/cramjam-2.11.0rc2.tar.gz
/cramjam-2.11.0rc3.tar.gz
/cramjam-2.11.0.tar.gz
+/cramjam-2.12.0.tar.gz
diff --git a/246.patch b/246.patch
new file mode 100644
index 0000000..53a5181
--- /dev/null
+++ b/246.patch
@@ -0,0 +1,51 @@
+From 941b858ee7f97cf36c9950d4f212b24b9b4d3bd3 Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Sat, 22 Aug 2026 08:31:55 +0100
+Subject: [PATCH 1/2] =?UTF-8?q?Don=E2=80=99t=20depend=20on=20deprecated=20?=
+ =?UTF-8?q?pyo3/generate-import-lib=20feature?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+---
+ Cargo.toml | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/Cargo.toml b/Cargo.toml
+index 4c71f6a3..18e2cb0b 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -37,9 +37,7 @@ default = [
+ experimental = ["blosc2", "igzip", "ideflate", "izlib"]
+
+ extension-module = ["pyo3/extension-module"]
+-generate-import-lib = [
+- "pyo3/generate-import-lib",
+-] # needed for Windows PyPy builds
++generate-import-lib = []
+
+ snappy = ["libcramjam/snappy"]
+ lz4 = ["libcramjam/lz4"]
+
+From 3c1b40c6c965ce36dc6049bd7b6e2434d77516f3 Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Sat, 22 Aug 2026 08:33:21 +0100
+Subject: [PATCH 2/2] Drop our generate-import-lib feature since it no longer
+ does anything
+
+---
+ Cargo.toml | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/Cargo.toml b/Cargo.toml
+index 18e2cb0b..c01fea43 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -37,7 +37,6 @@ default = [
+ experimental = ["blosc2", "igzip", "ideflate", "izlib"]
+
+ extension-module = ["pyo3/extension-module"]
+-generate-import-lib = []
+
+ snappy = ["libcramjam/snappy"]
+ lz4 = ["libcramjam/lz4"]
diff --git a/cramjam-2.11.0-pyo3-0.29.patch b/cramjam-2.11.0-pyo3-0.29.patch
deleted file mode 100644
index 887ad64..0000000
--- a/cramjam-2.11.0-pyo3-0.29.patch
+++ /dev/null
@@ -1,368 +0,0 @@
-diff -Naur cramjam-2.11.0-original/Cargo.toml cramjam-2.11.0/Cargo.toml
---- cramjam-2.11.0-original/Cargo.toml 1970-01-01 01:00:00.000000000 +0100
-+++ cramjam-2.11.0/Cargo.toml 2026-06-19 21:25:39.298774732 +0100
-@@ -71,11 +71,11 @@
-
-
- [dependencies]
--pyo3 = { version = "^0.25", default-features = false, features = ["macros"] }
-+pyo3 = { version = "^0.29", default-features = false, features = ["macros"] }
- libcramjam = { version = "^0.8", default-features = false }
-
- [build-dependencies]
--pyo3-build-config = "^0.25"
-+pyo3-build-config = "^0.29"
-
- [profile.release]
- strip = true
-diff -Naur cramjam-2.11.0-original/pyproject.toml cramjam-2.11.0/pyproject.toml
---- cramjam-2.11.0-original/pyproject.toml 2025-07-27 21:42:07.000000000 +0100
-+++ cramjam-2.11.0/pyproject.toml 2026-06-19 21:25:56.572961647 +0100
-@@ -2,7 +2,7 @@
- name = "cramjam"
- version = "2.11.0"
- keywords = ["compression", "decompression", "snappy", "zstd", "bz2", "gzip", "lz4", "brotli", "deflate", "blosc2"]
--requires-python = ">=3.8"
-+requires-python = ">=3.11"
- license = { file = "LICENSE" }
-
- [project.urls]
-diff -Naur cramjam-2.11.0-original/src/blosc2.rs cramjam-2.11.0/src/blosc2.rs
---- cramjam-2.11.0-original/src/blosc2.rs 2025-07-27 21:42:07.000000000 +0100
-+++ cramjam-2.11.0/src/blosc2.rs 2026-06-19 21:25:39.298994605 +0100
-@@ -143,7 +143,7 @@
- pub fn decompress_chunk(py: Python, data: BytesType, output_len: Option<usize>) -> PyResult<RustyBuffer> {
- let bytes = data.as_bytes();
- let buf = py
-- .allow_threads(|| libcramjam::blosc2::decompress_chunk(bytes))
-+ .detach(|| libcramjam::blosc2::decompress_chunk(bytes))
- .map(RustyBuffer::from)?;
- Ok(buf)
- }
-@@ -153,7 +153,7 @@
- pub fn decompress_chunk_into(py: Python, input: BytesType, mut output: BytesType) -> PyResult<usize> {
- let bytes = input.as_bytes();
- let out = output.as_bytes_mut()?;
-- let nbytes = py.allow_threads(|| libcramjam::blosc2::decompress_chunk_into(bytes, out))?;
-+ let nbytes = py.detach(|| libcramjam::blosc2::decompress_chunk_into(bytes, out))?;
- Ok(nbytes)
- }
-
-@@ -176,7 +176,7 @@
- codec: Option<PyCodec>,
- ) -> PyResult<RustyBuffer> {
- let bytes = data.as_bytes();
-- py.allow_threads(|| {
-+ py.detach(|| {
- let clevel = clevel.map(Into::into);
- let filter = filter.map(Into::into);
- let codec = codec.map(Into::into);
-@@ -200,7 +200,7 @@
- ) -> PyResult<usize> {
- let bytes = input.as_bytes();
- let out = output.as_bytes_mut()?;
-- py.allow_threads(|| {
-+ py.detach(|| {
- let clevel = clevel.map(Into::into);
- let filter = filter.map(Into::into);
- let codec = codec.map(Into::into);
-diff -Naur cramjam-2.11.0-original/src/io.rs cramjam-2.11.0/src/io.rs
---- cramjam-2.11.0-original/src/io.rs 2025-07-27 21:42:07.000000000 +0100
-+++ cramjam-2.11.0/src/io.rs 2026-06-19 21:25:39.299162587 +0100
-@@ -14,7 +14,6 @@
- use pyo3::ffi;
- use pyo3::prelude::*;
- use pyo3::types::PyBytes;
--use pyo3::IntoPyObjectExt;
- use std::path::PathBuf;
-
- pub(crate) trait AsBytes {
-@@ -210,7 +209,7 @@
- pub fn as_slice_mut(&mut self) -> PyResult<&mut [u8]> {
- #[cfg(any(PyPy, Py_GIL_DISABLED))]
- {
-- Python::with_gil(|py| {
-+ Python::attach(|py| {
- let is_memoryview = unsafe { ffi::PyMemoryView_Check(self.owner.as_ptr()) } == 1;
- if is_memoryview || self.owner.bind(py).is_instance_of::<PyBytes>() {
- #[cfg(PyPy)]
-@@ -260,13 +259,14 @@
-
- impl Drop for PythonBuffer {
- fn drop(&mut self) {
-- Python::with_gil(|_| unsafe { ffi::PyBuffer_Release(&mut *self.inner) })
-+ Python::attach(|_| unsafe { ffi::PyBuffer_Release(&mut *self.inner) })
- }
- }
-
--impl<'py> FromPyObject<'py> for PythonBuffer {
-- fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
-- Self::try_from(obj)
-+impl<'a, 'py> FromPyObject<'a, 'py> for PythonBuffer {
-+ type Error = PyErr;
-+ fn extract(obj: Borrowed<'a, 'py, PyAny>) -> PyResult<Self> {
-+ Self::try_from(&*obj)
- }
- }
-
-@@ -285,7 +285,7 @@
- inner: std::pin::Pin::from(buf),
- pos: 0,
- #[cfg(any(PyPy, Py_GIL_DISABLED))]
-- owner: Python::with_gil(|py| obj.into_py_any(py).unwrap()),
-+ owner: obj.clone().unbind(),
- };
- // sanity checks
- if buf.inner.shape.is_null() {
-@@ -629,7 +629,7 @@
- }
- fn __contains__(&self, py: Python, x: BytesType) -> bool {
- let bytes = x.as_bytes();
-- py.allow_threads(|| self.inner.get_ref().windows(bytes.len()).any(|w| w == bytes))
-+ py.detach(|| self.inner.get_ref().windows(bytes.len()).any(|w| w == bytes))
- }
- fn __repr__(&mut self, py: Python) -> PyResult<String> {
- Ok(format!("cramjam.Buffer<len={:?}>", self.len(py)?))
-diff -Naur cramjam-2.11.0-original/src/lib.rs cramjam-2.11.0/src/lib.rs
---- cramjam-2.11.0-original/src/lib.rs 2025-07-27 21:42:07.000000000 +0100
-+++ cramjam-2.11.0/src/lib.rs 2026-06-19 21:25:39.299321450 +0100
-@@ -222,13 +222,13 @@
- BytesType::RustyFile(f) => {
- let borrowed = f.borrow();
- let file = &borrowed.inner;
-- $py.allow_threads(|| {
-+ $py.detach(|| {
- $op(file, &mut Cursor::new(&mut output) $(, $args)* )
- })
- },
- _ => {
- let bytes = $input.as_bytes();
-- $py.allow_threads(|| {
-+ $py.detach(|| {
- $op(bytes, &mut Cursor::new(&mut output) $(, $args)* )
- })
- }
-@@ -246,20 +246,20 @@
- BytesType::RustyFile(f) => {
- let mut borrowed = f.borrow_mut();
- let mut f_out = &mut borrowed.inner;
-- $py.allow_threads(|| {
-+ $py.detach(|| {
- $op(f_in, &mut f_out $(, $args)* )
- })
- },
- BytesType::RustyBuffer(buffer) => {
- let mut borrowed = buffer.borrow_mut();
- let mut buf_out = &mut borrowed.inner;
-- $py.allow_threads(|| {
-+ $py.detach(|| {
- $op(f_in, &mut buf_out $(, $args)* )
- })
- },
- _ => {
- let bytes_out = $output.as_bytes_mut()?;
-- $py.allow_threads(|| {
-+ $py.detach(|| {
- $op(f_in, &mut Cursor::new(bytes_out) $(, $args)* )
- })
- }
-@@ -271,20 +271,20 @@
- BytesType::RustyFile(f) => {
- let mut borrowed = f.borrow_mut();
- let mut f_out = &mut borrowed.inner;
-- $py.allow_threads(|| {
-+ $py.detach(|| {
- $op(bytes_in, &mut f_out $(, $args)* )
- })
- },
- BytesType::RustyBuffer(buffer) => {
- let mut borrowed = buffer.borrow_mut();
- let mut buf_out = &mut borrowed.inner;
-- $py.allow_threads(|| {
-+ $py.detach(|| {
- $op(bytes_in, &mut buf_out $(, $args)* )
- })
- },
- _ => {
- let bytes_out = $output.as_bytes_mut()?;
-- $py.allow_threads(|| {
-+ $py.detach(|| {
- $op(bytes_in, &mut Cursor::new(bytes_out) $(, $args)*)
- })
- }
-@@ -331,11 +331,11 @@
- BytesType::RustyFile(f) => {
- let mut borrowed = f.borrow_mut();
- let f_in = &mut borrowed.inner;
-- py.allow_threads(|| libcramjam::$codec::decompress(f_in, inner).map_err(Into::into))
-+ py.detach(|| libcramjam::$codec::decompress(f_in, inner).map_err(Into::into))
- }
- _ => {
- let bytes = input.as_bytes();
-- py.allow_threads(|| {
-+ py.detach(|| {
- libcramjam::$codec::decompress(&mut Cursor::new(bytes), inner).map_err(Into::into)
- })
- }
-@@ -377,7 +377,7 @@
- }
- fn __contains__(&self, py: Python, x: BytesType) -> bool {
- let bytes = x.as_bytes();
-- py.allow_threads(|| {
-+ py.detach(|| {
- self.inner
- .as_ref()
- .map(|c| c.get_ref().windows(bytes.len()).any(|w| w == bytes))
-diff -Naur cramjam-2.11.0-original/src/lz4.rs cramjam-2.11.0/src/lz4.rs
---- cramjam-2.11.0-original/src/lz4.rs 2025-07-27 21:42:07.000000000 +0100
-+++ cramjam-2.11.0/src/lz4.rs 2026-06-19 21:25:39.299458812 +0100
-@@ -81,7 +81,7 @@
- pub fn decompress_block(py: Python, data: BytesType, output_len: Option<usize>) -> PyResult<RustyBuffer> {
- let bytes = data.as_bytes();
-
-- py.allow_threads(|| {
-+ py.detach(|| {
- match output_len {
- Some(n) => {
- let mut buf = vec![0u8; n];
-@@ -123,7 +123,7 @@
- store_size: Option<bool>,
- ) -> PyResult<RustyBuffer> {
- let bytes = data.as_bytes();
-- py.allow_threads(|| {
-+ py.detach(|| {
- libcramjam::lz4::block::compress_vec(bytes, compression.map(|v| v as _), acceleration, store_size)
- })
- .map_err(CompressionError::from_err)
-@@ -160,7 +160,7 @@
- }
-
- let out_bytes = output.as_bytes_mut()?;
-- py.allow_threads(
-+ py.detach(
- || match libcramjam::lz4::block::decompress_into(bytes, out_bytes, Some(size_stored)) {
- Ok(r) => Ok(r),
- // Fallback and try negation of stored size, incase we/they got it wrong;
-@@ -202,7 +202,7 @@
- ) -> PyResult<usize> {
- let bytes = data.as_bytes();
- let out_bytes = output.as_bytes_mut()?;
-- py.allow_threads(|| {
-+ py.detach(|| {
- libcramjam::lz4::block::compress_into(
- bytes,
- out_bytes,
-diff -Naur cramjam-2.11.0-original/src/snappy.rs cramjam-2.11.0/src/snappy.rs
---- cramjam-2.11.0-original/src/snappy.rs 2025-07-27 21:42:07.000000000 +0100
-+++ cramjam-2.11.0/src/snappy.rs 2026-06-19 21:25:39.299551963 +0100
-@@ -54,7 +54,7 @@
- #[pyo3(signature = (data, output_len=None))]
- pub fn decompress_raw(py: Python, data: BytesType, output_len: Option<usize>) -> PyResult<RustyBuffer> {
- let bytes = data.as_bytes();
-- py.allow_threads(|| libcramjam::snappy::raw::decompress_vec(bytes))
-+ py.detach(|| libcramjam::snappy::raw::decompress_vec(bytes))
- .map_err(DecompressionError::from_err)
- .map(From::from)
- }
-@@ -72,7 +72,7 @@
- #[pyo3(signature = (data, output_len=None))]
- pub fn compress_raw(py: Python, data: BytesType, output_len: Option<usize>) -> PyResult<RustyBuffer> {
- let bytes = data.as_bytes();
-- py.allow_threads(|| libcramjam::snappy::raw::compress_vec(bytes))
-+ py.detach(|| libcramjam::snappy::raw::compress_vec(bytes))
- .map_err(CompressionError::from_err)
- .map(From::from)
- }
-@@ -94,7 +94,7 @@
- pub fn compress_raw_into(py: Python, input: BytesType, mut output: BytesType) -> PyResult<usize> {
- let bytes_in = input.as_bytes();
- let bytes_out = output.as_bytes_mut()?;
-- py.allow_threads(|| libcramjam::snappy::raw::compress(bytes_in, bytes_out))
-+ py.detach(|| libcramjam::snappy::raw::compress(bytes_in, bytes_out))
- .map_err(CompressionError::from_err)
- }
-
-@@ -103,7 +103,7 @@
- pub fn decompress_raw_into(py: Python, input: BytesType, mut output: BytesType) -> PyResult<usize> {
- let bytes_in = input.as_bytes();
- let bytes_out = output.as_bytes_mut()?;
-- py.allow_threads(|| libcramjam::snappy::raw::decompress(bytes_in, bytes_out))
-+ py.detach(|| libcramjam::snappy::raw::decompress(bytes_in, bytes_out))
- .map_err(DecompressionError::from_err)
- }
-
-diff -Naur cramjam-2.11.0-original/src/xz.rs cramjam-2.11.0/src/xz.rs
---- cramjam-2.11.0-original/src/xz.rs 2025-07-27 21:42:07.000000000 +0100
-+++ cramjam-2.11.0/src/xz.rs 2026-06-19 21:25:39.299630265 +0100
-@@ -130,7 +130,7 @@
-
- /// Available Filter IDs
- #[derive(Clone, Debug, PartialEq)]
-- #[pyclass(eq, eq_int)]
-+ #[pyclass(eq, eq_int, from_py_object)]
- #[allow(missing_docs)]
- pub enum Filter {
- Arm,
-@@ -150,7 +150,7 @@
-
- /// MatchFinder, used with Options.mf attribute
- #[derive(Clone, Debug, PartialEq)]
-- #[pyclass(eq, eq_int)]
-+ #[pyclass(eq, eq_int, from_py_object)]
- #[allow(missing_docs)]
- pub enum MatchFinder {
- HashChain3,
-@@ -174,7 +174,7 @@
-
- /// MatchFinder, used with Options.mode attribute
- #[derive(Clone, Debug, PartialEq)]
-- #[pyclass(eq, eq_int)]
-+ #[pyclass(eq, eq_int, from_py_object)]
- #[allow(missing_docs)]
- pub enum Mode {
- Fast,
-@@ -192,7 +192,7 @@
- /// FilterChain, similar to the default Python XZ filter chain which is a list of
- /// dicts.
- #[derive(Debug, Clone)]
-- #[pyclass]
-+ #[pyclass(from_py_object)]
- pub struct FilterChain(Vec<FilterChainItem>);
-
- #[pymethods]
-@@ -229,7 +229,7 @@
- /// FilterChainItem. In Python's lzma module, this represents a single dict in the
- /// filter chain list. To be added to the `FilterChain`
- #[derive(Clone, Debug, Default)]
-- #[pyclass]
-+ #[pyclass(from_py_object)]
- pub struct FilterChainItem {
- filter: Filter,
- options: Options,
-@@ -250,7 +250,7 @@
-
- ///
- #[derive(Clone, Debug, Default)]
-- #[pyclass]
-+ #[pyclass(from_py_object)]
- pub struct Options {
- preset: Option<u32>,
- dict_size: Option<u32>,
-@@ -331,7 +331,7 @@
-
- /// Possible formats
- #[derive(Clone, Debug, PartialEq)]
-- #[pyclass(eq, eq_int)]
-+ #[pyclass(eq, eq_int, from_py_object)]
- pub enum Format {
- /// Auto select the format, for compression this is XZ,
- /// for decompression it will be determined by the compressed input.
-@@ -362,7 +362,7 @@
-
- /// Possible Check configurations
- #[derive(Debug, Clone, PartialEq)]
-- #[pyclass(eq, eq_int)]
-+ #[pyclass(eq, eq_int, from_py_object)]
- #[allow(missing_docs)]
- pub enum Check {
- Crc64,
diff --git a/python-cramjam.spec b/python-cramjam.spec
index 66edf24..4b9449f 100644
--- a/python-cramjam.spec
+++ b/python-cramjam.spec
@@ -4,7 +4,7 @@
#global snapdate YYYYMMDD
Name: python-cramjam
-Version: 2.11.0
+Version: 2.12.0
Release: %autorelease
Summary: Thin Python bindings to de/compression algorithms in Rust
@@ -33,15 +33,9 @@ Source1: get_source
%endif
-# Bump pyo3 to 0.28
-# https://github.com/milesgranger/cramjam/pull/240
-# Rebased on 2.11.0. Without changes to Cargo.lock and
-# .github/workflows/CI.yml, which are not relevant downstream.
-#
-# Further update to 0.29, without source-code changes, introducing one new
-# deprecation warning as noted in
-# https://github.com/milesgranger/cramjam/pull/240#issuecomment-4756886599.
-Patch: cramjam-2.11.0-pyo3-0.29.patch
+# Don’t depend on deprecated pyo3/generate-import-lib feature
+# https://github.com/milesgranger/cramjam/pull/246
+Patch: %{url}/pull/246.patch
BuildSystem: pyproject
BuildOption(install): --assert-license cramjam
@@ -87,11 +81,6 @@ License: %{shrink:
%prep -a
-# Downstream-only: patch out the generate-import-lib feature, which is only
-# relevant on Windows, and which depends on the corresponding pyo3 feature –
-# which is not packaged for that reason.
-tomcli set Cargo.toml del 'features.generate-import-lib'
-
# Downstream-only: patch out the wasm-compat feature, which is unnecessary and
# would bring in unwanted dependencies
tomcli set Cargo.toml del 'features.wasm32-compat'
diff --git a/sources b/sources
index 9b98da9..148e7a1 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (cramjam-2.11.0.tar.gz) = d92446c0c0ef885f3544783caa1f179fd50b6a6290ada011495b7385411527f75a2544c0c8cdc36910c83c879dbac7dd130f4fe8f3dc3b885a84a45286cb3695
+SHA512 (cramjam-2.12.0.tar.gz) = 1dab0f2c6910f4e8613617bfb8e6763785efefaffb7455630ca2b18d71cae0fa8e30b2cf50340ebe1ab022d9790531fce56feca4f1aea92f8858e547c2abc4dc
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-22 8:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-22 8:24 [rpms/python-cramjam] f43: Update to 2.12.0 (close RHBZ#2457848) Benjamin A. Beasley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox