Compare commits

...
Sign in to create a new pull request.

55 commits

Author SHA1 Message Date
Benjamin A. Beasley
1d2ec9221e Update to 3.11.4 (close RHBZ#2406238)
- Bundling yyjson is no longer optional
2025-11-21 12:42:56 +00:00
Python Maint
a9cf430503 Rebuilt for Python 3.14.0rc3 bytecode 2025-09-19 13:54:26 +02:00
Benjamin A. Beasley
3a6a32f1ec Update to 3.11.3 (close RHBZ#2391102) 2025-09-01 00:15:04 +01:00
Python Maint
5dd31d4405 Rebuilt for Python 3.14.0rc2 bytecode 2025-08-15 14:17:59 +02:00
Benjamin A. Beasley
c5b71bd4ae Update to 3.11.2 (close RHBZ#2387852) 2025-08-12 17:41:32 -04:00
Benjamin A. Beasley
cab2d3ef66 Update to 3.11.1 (close RHBZ#2383473) 2025-07-26 07:36:45 -04:00
Benjamin A. Beasley
804fc1ddf2 Patch for PyStr regression on big-endian architectures 2025-07-23 15:53:01 -04:00
Benjamin A. Beasley
bcfbf082b2 Package from a GitHub archive, with data/ filtered out 2025-07-21 09:12:22 -04:00
Benjamin A. Beasley
49bc586dce Update to 3.11.0 (close RHBZ#2380202)
- Upstream no longer bundles a forked copy of PyO3
- More carefully audit and account for all licenses in the source
- Add a build conditional to allow building with the yyjson backend
2025-07-16 07:44:45 -04:00
Benjamin A. Beasley
6177d02f00 PyO3 32-bit fix is now included in upstream Python 3.14 PR 2025-06-05 08:01:25 -04:00
Benjamin A. Beasley
bb81ac5e19 Cherry-pick pyo3-ffi fix for Python 3.14 i686 segfaults 2025-06-05 07:41:58 -04:00
Python Maint
9b05a1a744 Rebuilt for Python 3.14 2025-06-03 18:24:47 +02:00
Karolina Surma
227ce2c258 Support Python 3.14 2025-05-26 07:12:21 -04:00
Benjamin A. Beasley
4dc38f53d6 Update to 3.10.18; close RHBZ#2362920 2025-04-29 23:37:22 -04:00
Benjamin A. Beasley
66bfabbfc6 No longer allow compact_str 0.8 2025-04-12 19:48:03 -04:00
Benjamin A. Beasley
90a0f4fa5e Expect maturin to handle license files, except LICENSES.vendored/
See discussion in https://bugzilla.redhat.com/show_bug.cgi?id=2357473.
2025-04-11 08:08:42 -04:00
Benjamin A. Beasley
c0306d6a1e Update to 3.10.6 (close RHBZ#2354600)
- Fixes compatibility with CPython 3.14 alpha 6 (close RHBZ#2349447)
2025-04-03 06:59:18 -04:00
Benjamin A. Beasley
8355452df8 Remove spurious test dependency on arrow 2025-04-03 06:58:08 -04:00
Benjamin A. Beasley
caa0c29ec4 Omit Pendulum integration tests in EPEL10 2025-04-02 20:28:09 -04:00
Benjamin A. Beasley
ab0fdcf9ab Replace rust-packaging BR with cargo-rpm-macros
https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_mandatory_buildrequires

[skip changelog]
2025-04-02 19:57:59 -04:00
Fedora Release Engineering
4384132be9 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-18 16:52:10 +00:00
Benjamin A. Beasley
e0e16f61a9 Update to 3.10.14 (close RHBZ#2336424) 2025-01-09 14:13:26 -05:00
Miro Hrončok
30b44e027b Allow the bundled pyo3 to build this with unsupported Python versions
[skip changelog]
2025-01-06 20:05:01 +01:00
Benjamin A. Beasley
d7ee4a1249 Update to 3.10.13 (close RHBZ#2334886)
- Work around upstream’s maturin version pin to allow building with
  maturin 1.8.0
2024-12-30 08:49:58 -05:00
Benjamin A. Beasley
2746b9bffb Update to 3.10.12. Fixes rhbz#2328508 2024-11-25 13:19:43 -05:00
Benjamin A. Beasley
7fd8624716 Update to 3.10.11. Fixes rhbz#2319918
- Both pyo3-ffi and pyo3-build-config are now vendored and forked
- Add license files for vendored PyO3 crates
2024-11-03 06:48:50 -05:00
Benjamin A. Beasley
87b8204a34 Update to 3.10.7. Fixes rhbz#2303811 2024-08-11 13:11:03 -04:00
Benjamin A. Beasley
91516413ec Convert to %autorelease and %autochangelog
[skip changelog]
2024-07-31 14:18:23 -04:00
Benjamin A. Beasley
e5307353bb Update to 3.10.6. Fixes rhbz#2291190 2024-07-22 14:43:15 -04:00
Fedora Release Engineering
00d4cf1090 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-19 13:44:43 +00:00
Python Maint
36f0703a42 Rebuilt for Python 3.13 2024-06-08 13:30:06 +02:00
Benjamin A. Beasley
e6b46905b4 Enable skipped pandas and psutil integration tests 2024-06-04 12:12:36 -04:00
Benjamin A. Beasley
f896f0f819 Re-enable skipped numpy and pendulum integration tests 2024-06-04 12:12:26 -04:00
Benjamin A. Beasley
26a62120e0 Print the reasons for skipped tests 2024-06-01 15:56:14 -04:00
Benjamin A. Beasley
35560182ee Update to 3.10.3. Fixes rhbz#2278078. 2024-06-01 15:56:14 -04:00
Benjamin A. Beasley
9109069447 Rebuild with Rust 1.78 to fix incomplete debuginfo and backtraces 2024-05-24 12:41:07 -04:00
Benjamin A. Beasley
227caa6c80 Rebuild with Rust 1.78 to fix incomplete debuginfo and backtraces 2024-05-24 12:32:29 -04:00
Maxwell G
e7bd69981e
Update to 3.10.1. Fixes rhbz#2264126. 2024-04-15 23:55:54 +00:00
Maxwell G
3fe02c11c6
Update to 3.9.13. Fixes rhbz#2262570. 2024-02-06 21:26:59 +00:00
Fedora Release Engineering
9ecc5f91b6 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-26 07:40:47 +00:00
Fedora Release Engineering
e70ad5bead Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-22 04:20:49 +00:00
Maxwell G
d22ecca1a5
Update to 3.9.12. Fixes rhbz#2259025. 2024-01-18 21:14:12 +00:00
Maxwell G
a1d33d86fd
Update to 3.9.10. Fixes rhbz#2243767. 2023-11-22 06:48:29 +00:00
Benjamin A. Beasley
988fb09475 Fix a typo in the description 2023-11-05 15:53:45 -05:00
Maxwell G
3ff334ed6b
Let %cargo_prep handle removing .cargo/config.toml. 2023-10-10 19:03:53 +00:00
Maxwell G
4e24494280
Update to 3.9.8. Fixes rhbz#2229530.
* Replace Cargo.toml patch that no longer applies with tomcli-set.
* Also remove no-panic feature.
2023-10-10 18:59:25 +00:00
Tomáš Hrnčiar
8c9ea3fe06 Backport patch to add PyType_GetDict for Python 3.12 2023-07-25 10:33:58 +02:00
Maxwell G
787b7fcbf4 Remove bundled rust crates
%cargo_prep should override the vendoring config, but better safe than
sorry.
2023-07-25 10:33:34 +02:00
Maxwell G
c71bb9cc5f Update to 3.9.2. Fixes rhbz#2211703. 2023-07-25 10:33:32 +02:00
Maxwell G
d44e992892 Update license summary
Use the %{shrink:} macro to make the whole mess more readable.
Use the short license summary instead of pasting all of
LICENSE.dependencies.
2023-07-25 10:32:45 +02:00
Maxwell G
8882033808 Use pytest-forked to run tests 2023-07-25 10:32:45 +02:00
Maxwell G
0ceb97925f Remove setuptools_rust patch
maturin is now packaged for all stable Fedora releases.
2023-07-25 10:32:45 +02:00
Maxwell G
504e5ac66c Update to 3.8.14. 2023-07-25 10:32:42 +02:00
Fedora Release Engineering
94e5ae7e88 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-21 11:59:11 +00:00
Python Maint
c5fbacd3aa Rebuilt for Python 3.12 2023-06-27 22:49:01 +02:00
7 changed files with 236 additions and 170 deletions

24
.gitignore vendored
View file

@ -1,3 +1,27 @@
/orjson-3.8.10.tar.gz
/orjson-3.8.11.tar.gz
/orjson-3.8.12.tar.gz
/orjson-3.8.14.tar.gz
/orjson-3.9.2.tar.gz
/orjson-3.9.7.tar.gz
/orjson-3.9.8.tar.gz
/orjson-3.9.10.tar.gz
/orjson-3.9.12.tar.gz
/orjson-3.9.13.tar.gz
/orjson-3.10.1.tar.gz
/orjson-3.10.3.tar.gz
/orjson-3.10.6.tar.gz
/orjson-3.10.7.tar.gz
/orjson-3.10.10.tar.gz
/orjson-3.10.11.tar.gz
/orjson-3.10.12.tar.gz
/orjson-3.10.13.tar.gz
/orjson-3.10.14.tar.gz
/orjson-3.10.16.tar.gz
/orjson-3.10.18.tar.gz
/orjson-3.11.0.tar.gz
/orjson-3.11.0-filtered.tar.xz
/orjson-3.11.1-filtered.tar.xz
/orjson-3.11.2-filtered.tar.xz
/orjson-3.11.3-filtered.tar.xz
/orjson-3.11.4-filtered.tar.xz

View file

@ -1,30 +0,0 @@
From 8cb9c84fadfc490ec88665f0ab4871c2d7255738 Mon Sep 17 00:00:00 2001
From: Maxwell G <gotmax@e.email>
Date: Wed, 25 Jan 2023 20:30:13 -0600
Subject: [PATCH] Remove unstable-simd feature
This feature requires nightly Rust.
---
Cargo.toml | 6 ------
1 file changed, 6 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index fbd45a4..09724ce 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -32,12 +32,6 @@ crate-type = ["cdylib"]
[features]
default = []
-# Use SIMD intrinsics. This requires Rust on the nightly channel.
-unstable-simd = [
- "bytecount/generic-simd",
- "encoding_rs/simd-accel",
-]
-
# Build yyjson as a backend and panic if it fails. The default is to attempt
# to build and on failure fall back to another backend.
yyjson = []
--
2.40.1

View file

@ -1,81 +0,0 @@
From 37abb055e3435406156c6e4462b2a58923c9f11a Mon Sep 17 00:00:00 2001
From: Maxwell G <gotmax@e.email>
Date: Wed, 25 Jan 2023 13:47:35 -0600
Subject: [PATCH] Use setuptools-rust instead of maturin
Maturin is not packaged for Fedora. We can use setuptools-rust instead.
This requires setutpools >= 61.0 which is available on F37+. The
metadata in the [project] table can be translated to a setup.cfg or
added to setup.py for greater compatibility.
---
pyproject.toml | 9 ++++++---
setup.py | 28 ++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 3 deletions(-)
create mode 100644 setup.py
diff --git a/pyproject.toml b/pyproject.toml
index 8372fc8..1e48b88 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,5 @@
[project]
name = "orjson"
-repository = "https://github.com/ijl/orjson"
requires-python = ">=3.7"
classifiers = [
"Development Status :: 5 - Production/Stable",
@@ -22,10 +21,14 @@ classifiers = [
"Programming Language :: Rust",
"Typing :: Typed",
]
+dynamic = [
+ # version is dynamically defined in setup.py
+ "version",
+]
[build-system]
-build-backend = "maturin"
-requires = ["maturin>=0.13,<2"]
+build-backend = "setuptools.build_meta"
+requires = ["setuptools>=61.0", "setuptools-rust", "tomli; python_version<'3.11'"]
[tool.maturin]
python-source = "pysrc"
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..63f263d
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,28 @@
+import sys
+from pathlib import Path
+
+if sys.version_info[:2] >= (3, 11):
+ import tomllib
+else:
+ import tomli as tomllib
+
+from setuptools import setup
+from setuptools_rust import Binding, RustExtension
+
+HERE = Path(__file__).resolve().parent
+
+with (HERE / "Cargo.toml").open("rb") as fp:
+ DATA = tomllib.load(fp)["package"]
+
+setup(
+ # Can be removed once we no longer need a minimal build for setuptools < 61.
+ # This is duplicated in pyproject.toml's [project] table
+ name="orjson",
+ packages=["orjson"],
+ #
+ rust_extensions=[
+ RustExtension("orjson.orjson", binding=Binding.NoBinding, args=["--offline"])
+ ],
+ package_dir={"": "pysrc"},
+ version=DATA["version"],
+)
--
2.40.1

61
changelog Normal file
View file

@ -0,0 +1,61 @@
* Mon Jul 22 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 3.10.6-1
- Update to 3.10.6. Fixes rhbz#2291190.
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Sat Jun 08 2024 Python Maint <python-maint@redhat.com> - 3.10.3-2
- Rebuilt for Python 3.13
* Sat Jun 01 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 3.10.3-1
- Update to 3.10.3. Fixes rhbz#2278078.
* Fri May 24 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 3.10.1-2
- Rebuild with Rust 1.78 to fix incomplete debuginfo and backtraces
* Mon Apr 15 2024 Maxwell G <maxwell@gtmx.me> - 3.10.1-1
- Update to 3.10.1. Fixes rhbz#2264126.
* Tue Feb 6 2024 Maxwell G <maxwell@gtmx.me> - 3.9.13-1
- Update to 3.9.13. Fixes rhbz#2262570.
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jan 18 2024 Maxwell G <maxwell@gtmx.me> - 3.9.12-1
- Update to 3.9.12. Fixes rhbz#2259025.
* Wed Nov 22 2023 Maxwell G <maxwell@gtmx.me> - 3.9.10-1
- Update to 3.9.10. Fixes rhbz#2243767.
* Tue Oct 10 2023 Maxwell G <maxwell@gtmx.me> - 3.9.8-1
- Update to 3.9.8. Fixes rhbz#2229530.
* Tue Jul 25 2023 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.9.2-2
- Backport patch to add PyType_GetDict for Python 3.12
- Fixes: rhbz#2220383
* Fri Jul 21 2023 Maxwell G <maxwell@gtmx.me> - 3.9.2-1
- Update to 3.9.2. Fixes rhbz#2211703.
* Fri Jul 21 2023 Maxwell G <maxwell@gtmx.me> - 3.8.14-1
- Update to 3.8.14.
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jun 27 2023 Python Maint <python-maint@redhat.com> - 3.8.12-2
- Rebuilt for Python 3.12
* Thu May 18 2023 Maxwell G <maxwell@gtmx.me> - 3.8.12-1
- Update to 3.8.12.
- Use maturin as a build system when available
* Fri May 5 2023 Maxwell G <maxwell@gtmx.me> - 3.8.11-1
- Update to 3.8.11. Fixes rhbz#2193468.
* Wed Apr 12 2023 Maxwell G <maxwell@gtmx.me> - 3.8.10-1
- Initial package (rhbz#2184237).

49
get_source Executable file
View file

@ -0,0 +1,49 @@
#!/bin/sh
set -o errexit
set -o nounset
if [ "$#" != '1' ]
then
cat 1>&2 <<EOF
Usage: $0 VERSION
Downloads the requested version and creates a filtered source tarball.
EOF
exit 1
fi
VERSION="${1}"
OUTDIR="${PWD}"
TMPDIR="$(mktemp -d)"
trap "rm -rf '${TMPDIR}'" INT TERM EXIT
cd "${TMPDIR}"
REPO="https://github.com/ijl/orjson"
URL="${REPO}/archive/${VERSION}/orjson-${VERSION}.tar.gz"
echo "--> Downloading: ${URL}" 1>&2
curl -L -O "${URL}"
ARCHIVE="$(find . -mindepth 1 -maxdepth 1 -type f -name '*.tar.gz' -print -quit)"
echo "--> Extracting: $(basename "${ARCHIVE}")" 1>&2
tar -xzf "${ARCHIVE}"
echo '--> Removing data/ due to licensing issues' 1>&2
TARDIR="$(basename "${ARCHIVE}" '.tar.gz')"
MTIME="$(stat -c '%Y' "${TARDIR}")"
rm -rvf "${TARDIR}/data/"
# Make sure the original mtime is preserved even though we modified the base
# directory by removing something at the top level.
touch -d @"${MTIME}" "${TARDIR}"
FILTERED="$(basename "${ARCHIVE}" .tar.gz)-filtered.tar.xz"
echo "--> Re-archiving: ${FILTERED}" 1>&2
# https://www.gnu.org/software/tar/manual/html_section/Reproducibility.html
TZ=UTC LC_ALL=C tar \
--create --verbose \
--sort=name \
--format=posix \
--numeric-owner --owner=0 --group=0 \
--mode=go+u,go-w \
--pax-option='delete=atime,delete=ctime' \
"${TARDIR}/" |
xz -9e > "${FILTERED}"
mv -v "${FILTERED}" "${OUTDIR}"
echo 'Done.' 1>&2

View file

@ -6,29 +6,64 @@
# Specfile compatability: EPEL >= 9 or Fedora >= 37 and RPM >= 4.16
%bcond tests 1
%bcond maturin %[ 0%{?fedora} >= 39 ]
# Not yet in EPEL10: https://bugzilla.redhat.com/show_bug.cgi?id=2356387
%bcond pendulum %{undefined el10}
Name: python-orjson
Version: 3.8.12
Release: 1%{?dist}
Version: 3.11.4
Release: %autorelease
Summary: Fast, correct Python JSON library
License: Apache-2.0 OR MIT
# The entire source is (Apache-2.0 OR MIT), except:
#
# MIT:
# - include/yyjson/yyjson.c
# - include/yyjson/yyjson.h
#
# Apache-2.0:
# - src/serialize/writer/str/mod.rs
# - src/serialize/writer/str/sse2.rs
License: (Apache-2.0 OR MIT) AND Apache-2.0 AND MIT
URL: https://github.com/ijl/orjson
Source: %{pypi_source orjson}
# Ineligble for upstreaming
Patch: Remove-unstable-simd-feature.patch
# Ineligble for upstreaming
# Used when maturin bcond is disabled
Patch5000: Use-setuptools-rust-instead-of-maturin.patch
# We must be careful about the source archive.
#
# The PyPI releases have a vendored Rust dependency bundle in include/cargo/,
# which we would remove in %%prep, but which we must still check to make sure
# everything has a license acceptable for distribution in Fedora before
# uploading to the lookaside cache.
# Source: %%{pypi_source orjson}
# The GitHub archives from
# %%{url}/archive/%%{version}/orjson-%%{version}.tar.gz do not have the
# vendored crates, but they contain benchmark data in data/, some of which is
# lacking its license text (e.g. data/blns.txt.xz, which is from
# https://github.com/minimaxir/big-list-of-naughty-strings and should carry the
# corresponding MIT license text), and some of which looks like it might have
# at best unclear license status. Since the benchmark data is potentially
# problematic, we would need to filter the GitHub archives with a script.
Source0: orjson-%{version}-filtered.tar.xz
# ./get_source ${COMMIT} (or ${TAG})
Source1: get_source
BuildRequires: tomcli
BuildRequires: python3-devel
BuildRequires: rust-packaging
BuildRequires: %{py3_dist pytest-forked}
# Upstream restricts these test dependencies to particular Python interpreter
# versions and architectures, but we would like to run the corresponding tests
# everywhere.
BuildRequires: %{py3_dist numpy}
%if %{with pendulum}
BuildRequires: %{py3_dist pendulum}
%endif
# These are not in tests/requirements.txt, but they enable additional tests
%ifnarch %{ix86}
BuildRequires: %{py3_dist pandas}
%endif
BuildRequires: %{py3_dist psutil}
BuildRequires: cargo-rpm-macros >= 24
%global _description %{expand:
orjosn is a fast, correct Python JSON library supporting dataclasses,
orjson is a fast, correct Python JSON library supporting dataclasses,
datetimes, and numpy}
@ -36,47 +71,62 @@ datetimes, and numpy}
%package -n python3-orjson
Summary: %{summary}
# Apache-2.0 OR MIT: orjson itself
# (Apache-2.0 OR MIT) AND BSD-3-Clause: encoding_rs v0.8.32
# Apache-2.0 OR BSL-1.0: ryu v1.0.13
# Apache-2.0 OR MIT: bytecount v0.6.3
# Apache-2.0 OR MIT: orjson v3.8.12
# Apache-2.0: pyo3-ffi v0.18.3
# MIT OR Apache-2.0: ahash v0.8.3
# MIT OR Apache-2.0: arrayvec v0.7.2
# MIT OR Apache-2.0: associative-cache v1.0.1
# MIT OR Apache-2.0: beef v0.5.2
# MIT OR Apache-2.0: cfg-if v1.0.0
# MIT OR Apache-2.0: chrono v0.4.24
# MIT OR Apache-2.0: itoa v1.0.6
# MIT OR Apache-2.0: libc v0.2.144
# MIT OR Apache-2.0: num-integer v0.1.45
# MIT OR Apache-2.0: num-traits v0.2.15
# MIT OR Apache-2.0: once_cell v1.17.1
# MIT OR Apache-2.0: serde v1.0.162
# MIT OR Apache-2.0: serde_json v1.0.96
# MIT OR Apache-2.0: simdutf8 v0.1.4
# MIT OR Apache-2.0: smallvec v1.10.0
# MIT OR Apache-2.0: static_assertions v1.1.0
# MIT: castaway v0.2.2
# MIT: compact_str v0.7.0
# MIT: itoap v1.0.1
License: (Apache-2.0 OR MIT) AND (Apache-2.0 OR BSL-1.0) AND BSD-3-Clause AND Apache-2.0
# Output of %%{cargo_license_summary}:
#
# (Apache-2.0 OR MIT) AND BSD-3-Clause
# Apache-2.0 OR BSL-1.0
# Apache-2.0 OR MIT
# BSD-2-Clause OR Apache-2.0 OR MIT
# BSL-1.0
# MIT
# MIT OR Apache-2.0
# Unlicense OR MIT
#
# Note that this must include the terms of the base package License expression.
License: %{shrink:
(Apache-2.0 OR MIT) AND
Apache-2.0 AND
(Apache-2.0 OR BSL-1.0) AND
(Apache-2.0 OR BSD-2-Clause OR MIT) AND
BSD-3-Clause AND
BSL-1.0 AND
MIT AND
(Unlicense OR MIT)
}
# Version from YYJSON_VERSION_STRING in include/yyjson/yyjson.h
#
# Since version 3.11.4, orjson unconditionally uses a bundled copy of the C
# library yyjson, https://github.com/ibireme/yyjson, as the JSON
# deserialization backend. It is forked (customized) and compiled with a
# particular set of options via preprocessor defines (see build.rs), so it is
# not a candidate for unbundling. (Prior to version 3.11.4, this could be
# disabled, and the json crate from the Rust standard library,
# https://docs.rs/json, would be used instead, but this is no longer
# supported.)
Provides: bundled(yyjson) = 0.9.0
%description -n python3-orjson %{_description}
%prep
%autosetup -p1 -n orjson-%{version} -N
%autopatch -M 4999
%{!?with_maturin:%autopatch -m5000 -M5000 -p1}
# Remove bundled yyjson.
rm -rv include/yyjson/
%autosetup -p1 -n orjson-%{version}
%cargo_prep
# Remove unwind feature, which is not useful here: the comment above it says
# “Avoid bundling libgcc on musl.”
tomcli-set Cargo.toml del 'features.unwind'
tomcli-set Cargo.toml del 'dependencies.unwinding'
%if %{without pendulum}
sed -i '/^pendulum\b/d' test/requirements.txt
%endif
# Test dependency on arrow appears spurious
# https://github.com/ijl/orjson/issues/559
sed -i '/^arrow\b/d' test/requirements.txt
# Remove unpackaged PyPI plugin
sed -i '/pytest-random-order/d' test/requirements.txt
%generate_buildrequires
%pyproject_buildrequires %{?with_tests:test/requirements.txt}
@ -92,28 +142,21 @@ export RUSTFLAGS='%{build_rustflags}'
%install
%pyproject_install
%pyproject_save_files orjson
%pyproject_save_files -l orjson
%check
%pyproject_check_import
%if %{with tests}
%pytest -vv
# --forked: protect the pytest process against test segfaults
# -rs: print the reasons for skipped tests
%pytest --forked -rs
%endif
%files -n python3-orjson -f %{pyproject_files}
%license LICENSE-MIT LICENSE-APACHE LICENSES.dependencies
%doc README.md
%changelog
* Thu May 18 2023 Maxwell G <maxwell@gtmx.me> - 3.8.12-1
- Update to 3.8.12.
- Use maturin as a build system when available
* Fri May 5 2023 Maxwell G <maxwell@gtmx.me> - 3.8.11-1
- Update to 3.8.11. Fixes rhbz#2193468.
* Wed Apr 12 2023 Maxwell G <maxwell@gtmx.me> - 3.8.10-1
- Initial package (rhbz#2184237).
%autochangelog

View file

@ -1 +1 @@
SHA512 (orjson-3.8.12.tar.gz) = c2a6a106721e5c84d52ccc255b60fb3da67d442604c5dd5e2dea63a6d52eece87fd3d1d81a2691c1f93b4c21a0f608a8c1ea6b19d8ba4995584a562780ff39e9
SHA512 (orjson-3.11.4-filtered.tar.xz) = 1a457a91dfa1918341acfebcdb86ddf92b5776f166be9dbd16a4253f55140ae0bc90f911ceb3a9b33abd963be22f089aa2764b25e1701691298c0e8840c8225a