summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBazaah2024-03-18 14:33:40 +0000
committerBazaah2024-03-23 10:36:24 +0000
commit8576de36db079548db41a5b170e8783a6b98ec3c (patch)
tree453018182265068a73f31922d5942c77d12c7414
parent246af22b29342b3a85fe989f2904f2721e8a2b12 (diff)
downloadaur-8576de36db079548db41a5b170e8783a6b98ec3c.tar.gz
repo: add python-bcrypt patches
- python-bcrypt-allow-subinterpreters.patch - python-bcrypt-prefix-ceph.patch Together, these allow us to build a renamed python-bcrypt package, as ceph_bcrypt. This will allow us to bypass the thorny pyo3 issues we have with various mgr modules exploding at runtime. References: https://github.com/bazaah/aur-ceph/issues/20
-rw-r--r--python-bcrypt-allow-subinterpreters.patch13
-rw-r--r--python-bcrypt-prefix-ceph.patch56
2 files changed, 69 insertions, 0 deletions
diff --git a/python-bcrypt-allow-subinterpreters.patch b/python-bcrypt-allow-subinterpreters.patch
new file mode 100644
index 000000000000..060532898f5b
--- /dev/null
+++ b/python-bcrypt-allow-subinterpreters.patch
@@ -0,0 +1,13 @@
+diff --git a/src/_bcrypt/Cargo.toml b/src/_bcrypt/Cargo.toml
+index a9c7f7c..02317c8 100644
+--- a/src/_bcrypt/Cargo.toml
++++ b/src/_bcrypt/Cargo.toml
+@@ -6,7 +6,7 @@ edition = "2018"
+ publish = false
+
+ [dependencies]
+-pyo3 = { version = "0.20.0", features = ["abi3"] }
++pyo3 = { git = "https://git.st8l.com/luxolus/pyo3", tag = "v0.20.3-subint+1", features = ["abi3", "unsafe-allow-subinterpreters"] }
+ bcrypt = "0.15"
+ bcrypt-pbkdf = "0.10.0"
+ base64 = "0.21.5"
diff --git a/python-bcrypt-prefix-ceph.patch b/python-bcrypt-prefix-ceph.patch
new file mode 100644
index 000000000000..f7d574fbc9e5
--- /dev/null
+++ b/python-bcrypt-prefix-ceph.patch
@@ -0,0 +1,56 @@
+diff --git a/pyproject.toml b/pyproject.toml
+index e365c8c..6e27a0d 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -10,7 +10,7 @@ requires = [
+ build-backend = "setuptools.build_meta"
+
+ [project]
+-name = "bcrypt"
++name = "ceph_bcrypt"
+ # When updating this, also update lib.rs
+ version = "4.1.2"
+ authors = [
+@@ -41,7 +41,7 @@ homepage = "https://github.com/pyca/bcrypt/"
+ [tool.setuptools]
+ zip-safe = false
+ package-dir = {"" = "src"}
+-packages = ["bcrypt"]
++packages = ["ceph_bcrypt"]
+
+ [tool.setuptools.dynamic]
+ readme = {file = "README.rst", content-type = "text/x-rst"}
+@@ -57,7 +57,7 @@ select = ['E', 'F', 'I', 'N', 'W', 'UP', 'RUF']
+ line-length = 79
+
+ [tool.ruff.isort]
+-known-first-party = ["bcrypt", "tests"]
++known-first-party = ["ceph_bcrypt", "tests"]
+
+ [tool.mypy]
+ show_error_codes = true
+diff --git a/setup.py b/setup.py
+index 13694c4..160abdd 100644
+--- a/setup.py
++++ b/setup.py
+@@ -35,7 +35,7 @@ try:
+ setup(
+ rust_extensions=[
+ RustExtension(
+- "bcrypt._bcrypt",
++ "ceph_bcrypt._bcrypt",
+ "src/_bcrypt/Cargo.toml",
+ py_limited_api="auto",
+ rust_version=(
+diff --git a/tests/test_bcrypt.py b/tests/test_bcrypt.py
+index 68c00fb..0661573 100644
+--- a/tests/test_bcrypt.py
++++ b/tests/test_bcrypt.py
+@@ -1,6 +1,6 @@
+ import pytest
+
+-import bcrypt
++import ceph_bcrypt as bcrypt
+
+ _test_vectors = [
+ (