Files
macports-ports/python/py-cryptography/files/patch-build-no-rust.diff
2024-06-24 10:48:00 +03:00

73 lines
2.2 KiB
Diff

--- setup.py 2021-08-25 01:01:04.000000000 +0800
+++ setup.py 2024-06-23 11:42:01.000000000 +0800
@@ -10,22 +10,6 @@
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 +25,9 @@
# `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]
+setup_requirements = install_requirements
-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",
- )
- ]
with open(os.path.join(base_dir, "README.rst")) as f:
long_description = f.read()
@@ -129,9 +95,6 @@
"twine >= 1.12.0",
"sphinxcontrib-spelling >= 4.0.1",
],
- "sdist": [
- setuptools_rust,
- ],
"pep8test": [
"black",
"flake8",
@@ -149,7 +112,6 @@
"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