Sync from SUSE:SLFO:Main python-cryptography revision 6fc21b13b166c01e15dbff57091c8b70

This commit is contained in:
2024-12-13 11:18:10 +01:00
parent cd76f157e6
commit bb42863a6e
7 changed files with 194 additions and 46 deletions

View File

@@ -27,7 +27,8 @@
%endif
%{?sle15_python_module_pythons}
Name: python-cryptography%{psuffix}
Version: 42.0.4
# ALWAYS KEEP IN SYNC WITH python-cryptography-vectors!
Version: 43.0.3
Release: 0
Summary: Python library which exposes cryptographic recipes and primitives
License: Apache-2.0 OR BSD-3-Clause
@@ -43,11 +44,13 @@ Patch4: no-pytest_benchmark.patch
BuildRequires: %{python_module cffi >= 1.12}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module exceptiongroup}
BuildRequires: %{python_module maturin}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools-rust >= 1.7.0}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: cargo >= 1.56.0
BuildRequires: cargo-packaging
BuildRequires: fdupes
BuildRequires: libopenssl-devel
BuildRequires: pkgconfig
@@ -57,8 +60,10 @@ BuildRequires: zstd
BuildRequires: pkgconfig(libffi)
# python-base is not enough, we need the _ssl module
Requires: python
Requires: python-bcrypt
%requires_eq python-cffi
%if %{with test}
BuildRequires: %{python_module bcrypt}
BuildRequires: %{python_module certifi}
BuildRequires: %{python_module cryptography >= %{version}}
BuildRequires: %{python_module cryptography-vectors = %{version}}
@@ -66,6 +71,7 @@ BuildRequires: %{python_module hypothesis >= 1.11.4}
BuildRequires: %{python_module iso8601}
BuildRequires: %{python_module pretend}
BuildRequires: %{python_module pytest > 6.0}
BuildRequires: %{python_module pytest-benchmark}
BuildRequires: %{python_module pytest-subtests}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytz}
@@ -85,9 +91,19 @@ functions.
%prep
%autosetup -a2 -p1 -n cryptography-%{version}
rm -v src/rust/Cargo.lock
%build
export CARGO_NET_OFFLINE=true
export CARGO_PROFILE_RELEASE_DEBUG=true
export CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO=off
# https://pyo3.rs/main/building-and-distribution#configuring-the-python-version
%python_expand export PYO3_PYTHON="%{_bindir}/$python"
cd src/rust
tar xfv %{S:2}
rm -v Cargo.lock
%cargo_build
cd -
# https://github.com/pyca/cryptography/issues/9023
%global _lto_cflags %{nil}
export RUSTFLAGS=%{rustflags}