mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-09-20 21:21:51 +02:00
82 lines
2.5 KiB
Diff
82 lines
2.5 KiB
Diff
Reason: This version optionally need rust compiler, but doesn't build without some rust deps even when rust is not used.
|
|
Source: https://salsa.debian.org/python-team/packages/python-cryptography/-/blob/708682ad640c18f3bc7bae12937ef3540d172913/debian/patches/no-rust.patch
|
|
|
|
--- a/setup.py
|
|
+++ b/setup.py
|
|
@@ -5,28 +5,10 @@
|
|
# for complete details.
|
|
|
|
import os
|
|
-import platform
|
|
import sys
|
|
|
|
from setuptools import find_packages, setup
|
|
|
|
-try:
|
|
- from setuptools_rust import RustExtension
|
|
-except ImportError:
|
|
- print(
|
|
- """
|
|
- =============================DEBUG ASSISTANCE==========================
|
|
- If you are seeing an error here please try the following to
|
|
- successfully install cryptography:
|
|
-
|
|
- Upgrade to the latest pip and try again. This will fix errors for most
|
|
- users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
|
|
- =============================DEBUG ASSISTANCE==========================
|
|
- """
|
|
- )
|
|
- raise
|
|
-
|
|
-
|
|
base_dir = os.path.dirname(__file__)
|
|
src_dir = os.path.join(base_dir, "src")
|
|
|
|
@@ -41,27 +23,8 @@
|
|
|
|
# `install_requirements` and `setup_requirements` must be kept in sync with
|
|
# `pyproject.toml`
|
|
-setuptools_rust = "setuptools-rust>=0.11.4"
|
|
install_requirements = ["cffi>=1.12"]
|
|
-setup_requirements = install_requirements + [setuptools_rust]
|
|
-
|
|
-if os.environ.get("CRYPTOGRAPHY_DONT_BUILD_RUST"):
|
|
- rust_extensions = []
|
|
-else:
|
|
- rust_extensions = [
|
|
- RustExtension(
|
|
- "_rust",
|
|
- "src/rust/Cargo.toml",
|
|
- py_limited_api=True,
|
|
- # Enable abi3 mode if we're not using PyPy.
|
|
- features=(
|
|
- []
|
|
- if platform.python_implementation() == "PyPy"
|
|
- else ["pyo3/abi3-py36"]
|
|
- ),
|
|
- rust_version=">=1.41.0",
|
|
- )
|
|
- ]
|
|
+setup_requirements = install_requirements
|
|
|
|
with open(os.path.join(base_dir, "README.rst")) as f:
|
|
long_description = f.read()
|
|
@@ -130,7 +93,6 @@
|
|
"sphinxcontrib-spelling >= 4.0.1",
|
|
],
|
|
"sdist": [
|
|
- setuptools_rust,
|
|
],
|
|
"pep8test": [
|
|
"black",
|
|
@@ -148,8 +110,7 @@
|
|
cffi_modules=[
|
|
"src/_cffi_src/build_openssl.py:ffi",
|
|
"src/_cffi_src/build_padding.py:ffi",
|
|
- ],
|
|
- rust_extensions=rust_extensions,
|
|
+ ]
|
|
)
|
|
except: # noqa: E722
|
|
# Note: This is a bare exception that re-raises so that we don't interfere
|