File disable-RustExtension.patch of Package python-cryptography

Index: cryptography-3.4.8/setup.py
===================================================================
--- cryptography-3.4.8.orig/setup.py
+++ cryptography-3.4.8/setup.py
@@ -13,18 +13,9 @@ from setuptools import find_packages, se
 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
+    print("Could not find setuptools_rust."
+          "Set CRYPTOGRAPHY_DONT_BUILD_RUST in order to not build with Rust")
+    RustExtension = None
 
 
 base_dir = os.path.dirname(__file__)
@@ -41,9 +32,9 @@ with open(os.path.join(src_dir, "cryptog
 
 # `install_requirements` and `setup_requirements` must be kept in sync with
 # `pyproject.toml`
-setuptools_rust = "setuptools-rust>=0.11.4"
+setuptools_rust = ["setuptools-rust>=0.11.4"] if RustExtension else []
 install_requirements = ["cffi>=1.12"]
-setup_requirements = install_requirements + [setuptools_rust]
+setup_requirements = install_requirements + setuptools_rust
 
 if os.environ.get("CRYPTOGRAPHY_DONT_BUILD_RUST"):
     rust_extensions = []
@@ -129,9 +120,7 @@ try:
                 "twine >= 1.12.0",
                 "sphinxcontrib-spelling >= 4.0.1",
             ],
-            "sdist": [
-                setuptools_rust,
-            ],
+            "sdist": setuptools_rust,
             "pep8test": [
                 "black",
                 "flake8",
openSUSE Build Service is sponsored by