Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] python-cryptography: split python2 package
@ 2021-02-08 19:26 ahesford
  2021-02-08 19:37 ` [PR PATCH] [Updated] " ahesford
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: ahesford @ 2021-02-08 19:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 928 bytes --]

There is a new pull request by ahesford against master on the void-packages repository

https://github.com/ahesford/void-packages cryptography
https://github.com/void-linux/void-packages/pull/28595

python-cryptography: split python2 package
If we wanted to, we could set CRYPTOGRAPHY_DONT_BUILD_RUST for "this release only" (which probably means this minor version only) and delay the `python3-setuptools_rust` addition. That would also prevent the installation of the no-op `cryptography.hazmat.bindings._rust` module. However, given that Rust is about to become a hard requirement for this package, we might as well just get it done with now.

The `python3-pytest-subtests` package is only required for checks in `python3-cryptography` but, given the importance of `cryptography`, I think it's worth ensuring that those tests pass.

A patch file from https://github.com/void-linux/void-packages/pull/28595.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cryptography-28595.patch --]
[-- Type: text/x-diff, Size: 12762 bytes --]

From 1b2cce3bdea8cb273ce5f64bd0d8756b4d3ac2df Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 8 Feb 2021 10:35:05 -0500
Subject: [PATCH 1/4] New package: python3-setuptools-rust-0.11.6

---
 .../patches/preserve_rustflags.patch          | 27 +++++++++++++++++++
 srcpkgs/python3-setuptools-rust/template      | 23 ++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch
 create mode 100644 srcpkgs/python3-setuptools-rust/template

diff --git a/srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch b/srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch
new file mode 100644
index 00000000000..00be144d52c
--- /dev/null
+++ b/srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch
@@ -0,0 +1,27 @@
+From cbd30fda8c6f7cc0d304728413f2cbf488da096b Mon Sep 17 00:00:00 2001
+From: "Andrew J. Hesford" <ajh@sideband.org>
+Date: Mon, 8 Feb 2021 12:58:58 -0500
+Subject: [PATCH] Augment, rather than replace, existing RUSTFLAGS when
+ building
+
+Some complex environments, like Void's cross-compilation environment,
+use RUSTFLAGS to control the behavior of rust compilation. Rather than
+overwriting RUSTFLAGS with custom flags, augment any existing RUSTFLAGS
+to preserve these environments.
+---
+ setuptools_rust/build.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git setuptools_rust/build.py setuptools_rust/build.py
+index 40d8e42..60eddfa 100644
+--- setuptools_rust/build.py
++++ setuptools_rust/build.py
+@@ -186,7 +186,7 @@ def build_extension(self, ext):
+             rustflags += " -C target-cpu=native"
+ 
+         if rustflags:
+-            env["RUSTFLAGS"] = rustflags
++            env["RUSTFLAGS"] = (env.get("RUSTFLAGS", "") + " " + rustflags).strip()
+ 
+         # Execute cargo
+         try:
diff --git a/srcpkgs/python3-setuptools-rust/template b/srcpkgs/python3-setuptools-rust/template
new file mode 100644
index 00000000000..07ad5d97d1b
--- /dev/null
+++ b/srcpkgs/python3-setuptools-rust/template
@@ -0,0 +1,23 @@
+# Template file for 'python3-setuptools-rust'
+pkgname=python3-setuptools-rust
+version=0.11.6
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools_scm python3-toml"
+depends="python3-semanticversion python3-toml python3-setuptools"
+short_desc="Setuptools plugin for Rust support"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="MIT"
+homepage="https://github.com/PyO3/setuptools-rust"
+changelog="https://raw.githubusercontent.com/PyO3/setuptools-rust/master/CHANGELOG.md"
+distfiles="${PYPI_SITE}/s/setuptools-rust/setuptools-rust-${version}.tar.gz"
+checksum=a5b5954909cbc5d66b914ee6763f81fa2610916041c7266105a469f504a7c4ca
+
+do_check() {
+	echo "Tests have unpackaged dependencies; skipping"
+}
+
+post_install() {
+	vlicense LICENSE
+}

From 7109b8026058df91b73743fa67385d687a853f78 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 8 Feb 2021 11:33:57 -0500
Subject: [PATCH 2/4] New package: python3-pytest-subtests-0.4.0

---
 srcpkgs/python3-pytest-subtests/template | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 srcpkgs/python3-pytest-subtests/template

diff --git a/srcpkgs/python3-pytest-subtests/template b/srcpkgs/python3-pytest-subtests/template
new file mode 100644
index 00000000000..078df4a28ef
--- /dev/null
+++ b/srcpkgs/python3-pytest-subtests/template
@@ -0,0 +1,19 @@
+# Template file for 'python3-pytest-subtests'
+pkgname=python3-pytest-subtests
+version=0.4.0
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools_scm"
+depends="python3-pytest"
+checkdepends="$depends"
+short_desc="Subtest fixture for python3-pytest"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="MIT"
+homepage="https://github.com/pytest-dev/pytest-subtests"
+distfiles="${PYPI_SITE}/p/pytest-subtests/pytest-subtests-${version}.tar.gz"
+checksum=8d9e2c1d1dce11f7b7d2c9d09202ebfc7757b7ff0cac9b72ad328edfe7ee037b
+
+post_install() {
+	vlicense LICENSE
+}

From 428900d4b83a84ccca1cc61ff0f7dec4352c7db4 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 8 Feb 2021 11:09:36 -0500
Subject: [PATCH 3/4] python-cryptography_vectors: update to 3.3.2, split
 package

New package: python3-cryptography_vectors-3.4.1
---
 srcpkgs/python-cryptography_vectors/template  | 17 ++++-------------
 srcpkgs/python-cryptography_vectors/update    |  2 ++
 srcpkgs/python3-cryptography_vectors          |  1 -
 srcpkgs/python3-cryptography_vectors/template | 18 ++++++++++++++++++
 4 files changed, 24 insertions(+), 14 deletions(-)
 create mode 100644 srcpkgs/python-cryptography_vectors/update
 delete mode 120000 srcpkgs/python3-cryptography_vectors
 create mode 100644 srcpkgs/python3-cryptography_vectors/template

diff --git a/srcpkgs/python-cryptography_vectors/template b/srcpkgs/python-cryptography_vectors/template
index 8d705f4c322..41152144236 100644
--- a/srcpkgs/python-cryptography_vectors/template
+++ b/srcpkgs/python-cryptography_vectors/template
@@ -1,27 +1,18 @@
 # Template file for 'python-cryptography_vectors'
 pkgname=python-cryptography_vectors
-version=3.3.1
+version=3.3.2
 revision=1
 wrksrc="cryptography_vectors-${version}"
-build_style=python-module
-hostmakedepends="python-setuptools python3-setuptools"
+build_style=python2-module
+hostmakedepends="python-setuptools"
 short_desc="Test vectors for python-cryptography"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
 license="BSD-3-Clause, Apache-2.0"
 homepage="https://github.com/pyca/cryptography"
 distfiles="${PYPI_SITE}/c/cryptography_vectors/cryptography_vectors-${version}.tar.gz"
-checksum=03789c305dda8dccb4b8c9c019963a742469d88365abbc82e8e898ac478f5ca4
+checksum=8c9d5afada647a6c937c6392c975f204b540c31f25fd4acd925ec0e180be0afa
 
 post_install() {
 	vlicense LICENSE
 	vlicense LICENSE.BSD
 }
-
-python3-cryptography_vectors_package() {
-	short_desc="${short_desc/python/python3}"
-	pkg_install() {
-		vmove usr/lib/python3*
-		vlicense LICENSE
-		vlicense LICENSE.BSD
-	}
-}
diff --git a/srcpkgs/python-cryptography_vectors/update b/srcpkgs/python-cryptography_vectors/update
new file mode 100644
index 00000000000..051a14b7a81
--- /dev/null
+++ b/srcpkgs/python-cryptography_vectors/update
@@ -0,0 +1,2 @@
+# cryptography >= 3.4 does not support Python 2
+pattern="cryptography_vectors-\K3\.3\.[0-9.]+(?=.tar.gz)"
diff --git a/srcpkgs/python3-cryptography_vectors b/srcpkgs/python3-cryptography_vectors
deleted file mode 120000
index 321bb702bd9..00000000000
--- a/srcpkgs/python3-cryptography_vectors
+++ /dev/null
@@ -1 +0,0 @@
-python-cryptography_vectors
\ No newline at end of file
diff --git a/srcpkgs/python3-cryptography_vectors/template b/srcpkgs/python3-cryptography_vectors/template
new file mode 100644
index 00000000000..b4471132798
--- /dev/null
+++ b/srcpkgs/python3-cryptography_vectors/template
@@ -0,0 +1,18 @@
+# Template file for 'python3-cryptography_vectors'
+pkgname=python3-cryptography_vectors
+version=3.4.1
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+short_desc="Test vectors for python3-cryptography"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="BSD-3-Clause, Apache-2.0"
+homepage="https://github.com/pyca/cryptography"
+distfiles="${PYPI_SITE}/c/cryptography_vectors/cryptography_vectors-${version}.tar.gz"
+checksum=9d101cfa34a558705d5bf9f57db049aed058105a463302d3ccc9ec84d33b9c7d
+
+post_install() {
+	vlicense LICENSE
+	vlicense LICENSE.BSD
+}

From 4614da000136c526e08c93b993d28f1aa0a2a953 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 8 Feb 2021 10:58:28 -0500
Subject: [PATCH 4/4] python-cryptography: update to 3.3.2, split package

New package: python3-cryptography-3.4.1
---
 srcpkgs/python-cryptography/template  | 30 ++++++----------------
 srcpkgs/python-cryptography/update    |  2 ++
 srcpkgs/python3-cryptography          |  1 -
 srcpkgs/python3-cryptography/template | 36 +++++++++++++++++++++++++++
 4 files changed, 46 insertions(+), 23 deletions(-)
 create mode 100644 srcpkgs/python-cryptography/update
 delete mode 120000 srcpkgs/python3-cryptography
 create mode 100644 srcpkgs/python3-cryptography/template

diff --git a/srcpkgs/python-cryptography/template b/srcpkgs/python-cryptography/template
index 6579b004e38..2363ec3042d 100644
--- a/srcpkgs/python-cryptography/template
+++ b/srcpkgs/python-cryptography/template
@@ -1,42 +1,28 @@
 # Template file for 'python-cryptography'
 pkgname=python-cryptography
-version=3.3.1
+version=3.3.2
 revision=1
 wrksrc="cryptography-${version}"
-build_style=python-module
-hostmakedepends="python-setuptools python3-setuptools libressl-devel
- python-enum34 python-ipaddress python-six python3-six
- python-cffi python3-cffi python-idna python3-idna"
-makedepends="libressl-devel python-devel python3-devel"
+build_style=python2-module
+hostmakedepends="python-setuptools libressl-devel python-enum34
+ python-ipaddress python-six python-cffi python-idna"
+makedepends="libressl-devel python-devel"
 depends="python-cffi python-six python-enum34 python-idna python-ipaddress"
 checkdepends="python-cryptography_vectors python-hypothesis python-pretend
- python-pytest python-pytz python-iso8601 python3-cryptography_vectors
- python3-hypothesis python3-pretend python3-pytest python3-pytz python3-iso8601
- ${depends}"
+ python-pytest python-pytz python-iso8601 ${depends}"
 short_desc="Python2 library that provides cryptographic recipes and primitives"
 maintainer="Alessio Sergi <al3hex@gmail.com>"
 license="BSD-3-Clause, Apache-2.0"
 homepage="https://github.com/pyca/cryptography"
 changelog="https://raw.githubusercontent.com/pyca/cryptography/master/CHANGELOG.rst"
 distfiles="${PYPI_SITE}/c/cryptography/cryptography-${version}.tar.gz"
-checksum=7e177e4bea2de937a584b13645cab32f25e3d96fc0bc4a4cf99c27dc77682be6
+checksum=5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed
 
 do_check() {
-	PYTHONPATH="$(cd build-2.7/lib* && pwd)" python2.7 -m pytest tests
-	PYTHONPATH="$(cd build-${py3_ver}/lib* && pwd)" python${py3_ver} -m pytest tests
+	PYTHONPATH="$(cd build/lib* && pwd)" python2.7 -m pytest tests
 }
 
 post_install() {
 	vlicense LICENSE
 	vlicense LICENSE.BSD
 }
-
-python3-cryptography_package() {
-	depends="python3-cffi python3-six python3-idna"
-	short_desc="${short_desc/Python2/Python3}"
-	pkg_install() {
-		vmove usr/lib/python3*
-		vlicense LICENSE
-		vlicense LICENSE.BSD
-	}
-}
diff --git a/srcpkgs/python-cryptography/update b/srcpkgs/python-cryptography/update
new file mode 100644
index 00000000000..b128c2f3bcf
--- /dev/null
+++ b/srcpkgs/python-cryptography/update
@@ -0,0 +1,2 @@
+# cryptography >= 3.4 does not support Python 2
+pattern="cryptography-\K3\.3\.[0-9.]+(?=.tar.gz)"
diff --git a/srcpkgs/python3-cryptography b/srcpkgs/python3-cryptography
deleted file mode 120000
index 056dc2d1d9b..00000000000
--- a/srcpkgs/python3-cryptography
+++ /dev/null
@@ -1 +0,0 @@
-python-cryptography
\ No newline at end of file
diff --git a/srcpkgs/python3-cryptography/template b/srcpkgs/python3-cryptography/template
new file mode 100644
index 00000000000..44c67908817
--- /dev/null
+++ b/srcpkgs/python3-cryptography/template
@@ -0,0 +1,36 @@
+# Template file for 'python3-cryptography'
+pkgname=python3-cryptography
+version=3.4.1
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+build_helper="rust"
+hostmakedepends="python3-setuptools-rust python3-cffi cargo"
+makedepends="python3-devel libressl-devel"
+depends="python3-cffi"
+checkdepends="python3-pytest-subtests python3-pytz python3-iso8601
+ python3-cryptography_vectors python3-pretend python3-hypothesis $depends"
+short_desc="Python3 library that provides cryptographic recipes and primitives"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="BSD-3-Clause, Apache-2.0"
+homepage="https://github.com/pyca/cryptography"
+changelog="https://raw.githubusercontent.com/pyca/cryptography/master/CHANGELOG.rst"
+distfiles="${PYPI_SITE}/c/cryptography/cryptography-${version}.tar.gz"
+checksum=be70bdaa29bcacf70896dae3a6f3eef91daf51bfba8a49dbfb9c23bb2cc914ba
+
+if [ "$CROSS_BUILD" ]; then
+	makedepends+=" rust-std"
+	export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
+	export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
+fi
+
+do_check() {
+	PYTHONPATH="$(cd build/lib* && pwd)" python3 -m pytest
+}
+
+post_install() {
+	vlicense LICENSE
+	vlicense LICENSE.BSD
+
+	chmod 755 ${DESTDIR}/${py3_sitelib}/cryptography/hazmat/bindings/*.so
+}

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR PATCH] [Updated] python-cryptography: split python2 package
  2021-02-08 19:26 [PR PATCH] python-cryptography: split python2 package ahesford
@ 2021-02-08 19:37 ` ahesford
  2021-02-08 19:39 ` ahesford
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2021-02-08 19:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

There is an updated pull request by ahesford against master on the void-packages repository

https://github.com/ahesford/void-packages cryptography
https://github.com/void-linux/void-packages/pull/28595

python-cryptography: split python2 package
If we wanted to, we could set CRYPTOGRAPHY_DONT_BUILD_RUST for "this release only" (which probably means this minor version only) and delay the `python3-setuptools_rust` addition. That would also prevent the installation of the no-op `cryptography.hazmat.bindings._rust` module. However, given that Rust is about to become a hard requirement for this package, we might as well just get it done with now.

The `python3-pytest-subtests` package is only required for checks in `python3-cryptography` but, given the importance of `cryptography`, I think it's worth ensuring that those tests pass.

A patch file from https://github.com/void-linux/void-packages/pull/28595.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cryptography-28595.patch --]
[-- Type: text/x-diff, Size: 12762 bytes --]

From 1b2cce3bdea8cb273ce5f64bd0d8756b4d3ac2df Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 8 Feb 2021 10:35:05 -0500
Subject: [PATCH 1/4] New package: python3-setuptools-rust-0.11.6

---
 .../patches/preserve_rustflags.patch          | 27 +++++++++++++++++++
 srcpkgs/python3-setuptools-rust/template      | 23 ++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch
 create mode 100644 srcpkgs/python3-setuptools-rust/template

diff --git a/srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch b/srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch
new file mode 100644
index 00000000000..00be144d52c
--- /dev/null
+++ b/srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch
@@ -0,0 +1,27 @@
+From cbd30fda8c6f7cc0d304728413f2cbf488da096b Mon Sep 17 00:00:00 2001
+From: "Andrew J. Hesford" <ajh@sideband.org>
+Date: Mon, 8 Feb 2021 12:58:58 -0500
+Subject: [PATCH] Augment, rather than replace, existing RUSTFLAGS when
+ building
+
+Some complex environments, like Void's cross-compilation environment,
+use RUSTFLAGS to control the behavior of rust compilation. Rather than
+overwriting RUSTFLAGS with custom flags, augment any existing RUSTFLAGS
+to preserve these environments.
+---
+ setuptools_rust/build.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git setuptools_rust/build.py setuptools_rust/build.py
+index 40d8e42..60eddfa 100644
+--- setuptools_rust/build.py
++++ setuptools_rust/build.py
+@@ -186,7 +186,7 @@ def build_extension(self, ext):
+             rustflags += " -C target-cpu=native"
+ 
+         if rustflags:
+-            env["RUSTFLAGS"] = rustflags
++            env["RUSTFLAGS"] = (env.get("RUSTFLAGS", "") + " " + rustflags).strip()
+ 
+         # Execute cargo
+         try:
diff --git a/srcpkgs/python3-setuptools-rust/template b/srcpkgs/python3-setuptools-rust/template
new file mode 100644
index 00000000000..07ad5d97d1b
--- /dev/null
+++ b/srcpkgs/python3-setuptools-rust/template
@@ -0,0 +1,23 @@
+# Template file for 'python3-setuptools-rust'
+pkgname=python3-setuptools-rust
+version=0.11.6
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools_scm python3-toml"
+depends="python3-semanticversion python3-toml python3-setuptools"
+short_desc="Setuptools plugin for Rust support"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="MIT"
+homepage="https://github.com/PyO3/setuptools-rust"
+changelog="https://raw.githubusercontent.com/PyO3/setuptools-rust/master/CHANGELOG.md"
+distfiles="${PYPI_SITE}/s/setuptools-rust/setuptools-rust-${version}.tar.gz"
+checksum=a5b5954909cbc5d66b914ee6763f81fa2610916041c7266105a469f504a7c4ca
+
+do_check() {
+	echo "Tests have unpackaged dependencies; skipping"
+}
+
+post_install() {
+	vlicense LICENSE
+}

From 7109b8026058df91b73743fa67385d687a853f78 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 8 Feb 2021 11:33:57 -0500
Subject: [PATCH 2/4] New package: python3-pytest-subtests-0.4.0

---
 srcpkgs/python3-pytest-subtests/template | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 srcpkgs/python3-pytest-subtests/template

diff --git a/srcpkgs/python3-pytest-subtests/template b/srcpkgs/python3-pytest-subtests/template
new file mode 100644
index 00000000000..078df4a28ef
--- /dev/null
+++ b/srcpkgs/python3-pytest-subtests/template
@@ -0,0 +1,19 @@
+# Template file for 'python3-pytest-subtests'
+pkgname=python3-pytest-subtests
+version=0.4.0
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools_scm"
+depends="python3-pytest"
+checkdepends="$depends"
+short_desc="Subtest fixture for python3-pytest"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="MIT"
+homepage="https://github.com/pytest-dev/pytest-subtests"
+distfiles="${PYPI_SITE}/p/pytest-subtests/pytest-subtests-${version}.tar.gz"
+checksum=8d9e2c1d1dce11f7b7d2c9d09202ebfc7757b7ff0cac9b72ad328edfe7ee037b
+
+post_install() {
+	vlicense LICENSE
+}

From 774f3c982cd510d5c9e42385df12767e746e252f Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 8 Feb 2021 11:09:36 -0500
Subject: [PATCH 3/4] python-cryptography_vectors: update to 3.3.2, split
 package

New package: python3-cryptography_vectors-3.4.2
---
 srcpkgs/python-cryptography_vectors/template  | 17 ++++-------------
 srcpkgs/python-cryptography_vectors/update    |  2 ++
 srcpkgs/python3-cryptography_vectors          |  1 -
 srcpkgs/python3-cryptography_vectors/template | 18 ++++++++++++++++++
 4 files changed, 24 insertions(+), 14 deletions(-)
 create mode 100644 srcpkgs/python-cryptography_vectors/update
 delete mode 120000 srcpkgs/python3-cryptography_vectors
 create mode 100644 srcpkgs/python3-cryptography_vectors/template

diff --git a/srcpkgs/python-cryptography_vectors/template b/srcpkgs/python-cryptography_vectors/template
index 8d705f4c322..41152144236 100644
--- a/srcpkgs/python-cryptography_vectors/template
+++ b/srcpkgs/python-cryptography_vectors/template
@@ -1,27 +1,18 @@
 # Template file for 'python-cryptography_vectors'
 pkgname=python-cryptography_vectors
-version=3.3.1
+version=3.3.2
 revision=1
 wrksrc="cryptography_vectors-${version}"
-build_style=python-module
-hostmakedepends="python-setuptools python3-setuptools"
+build_style=python2-module
+hostmakedepends="python-setuptools"
 short_desc="Test vectors for python-cryptography"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
 license="BSD-3-Clause, Apache-2.0"
 homepage="https://github.com/pyca/cryptography"
 distfiles="${PYPI_SITE}/c/cryptography_vectors/cryptography_vectors-${version}.tar.gz"
-checksum=03789c305dda8dccb4b8c9c019963a742469d88365abbc82e8e898ac478f5ca4
+checksum=8c9d5afada647a6c937c6392c975f204b540c31f25fd4acd925ec0e180be0afa
 
 post_install() {
 	vlicense LICENSE
 	vlicense LICENSE.BSD
 }
-
-python3-cryptography_vectors_package() {
-	short_desc="${short_desc/python/python3}"
-	pkg_install() {
-		vmove usr/lib/python3*
-		vlicense LICENSE
-		vlicense LICENSE.BSD
-	}
-}
diff --git a/srcpkgs/python-cryptography_vectors/update b/srcpkgs/python-cryptography_vectors/update
new file mode 100644
index 00000000000..051a14b7a81
--- /dev/null
+++ b/srcpkgs/python-cryptography_vectors/update
@@ -0,0 +1,2 @@
+# cryptography >= 3.4 does not support Python 2
+pattern="cryptography_vectors-\K3\.3\.[0-9.]+(?=.tar.gz)"
diff --git a/srcpkgs/python3-cryptography_vectors b/srcpkgs/python3-cryptography_vectors
deleted file mode 120000
index 321bb702bd9..00000000000
--- a/srcpkgs/python3-cryptography_vectors
+++ /dev/null
@@ -1 +0,0 @@
-python-cryptography_vectors
\ No newline at end of file
diff --git a/srcpkgs/python3-cryptography_vectors/template b/srcpkgs/python3-cryptography_vectors/template
new file mode 100644
index 00000000000..a2d85142aea
--- /dev/null
+++ b/srcpkgs/python3-cryptography_vectors/template
@@ -0,0 +1,18 @@
+# Template file for 'python3-cryptography_vectors'
+pkgname=python3-cryptography_vectors
+version=3.4.2
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+short_desc="Test vectors for python3-cryptography"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="BSD-3-Clause, Apache-2.0"
+homepage="https://github.com/pyca/cryptography"
+distfiles="${PYPI_SITE}/c/cryptography_vectors/cryptography_vectors-${version}.tar.gz"
+checksum=9ab2118e80bc587d9dfcf11b83ccd4857cd1aa22d90a772435211ceb72460845
+
+post_install() {
+	vlicense LICENSE
+	vlicense LICENSE.BSD
+}

From 1a573dc7beded2f580be52d4d22f335f0365d2b4 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 8 Feb 2021 10:58:28 -0500
Subject: [PATCH 4/4] python-cryptography: update to 3.3.2, split package

New package: python3-cryptography-3.4.2
---
 srcpkgs/python-cryptography/template  | 30 ++++++----------------
 srcpkgs/python-cryptography/update    |  2 ++
 srcpkgs/python3-cryptography          |  1 -
 srcpkgs/python3-cryptography/template | 36 +++++++++++++++++++++++++++
 4 files changed, 46 insertions(+), 23 deletions(-)
 create mode 100644 srcpkgs/python-cryptography/update
 delete mode 120000 srcpkgs/python3-cryptography
 create mode 100644 srcpkgs/python3-cryptography/template

diff --git a/srcpkgs/python-cryptography/template b/srcpkgs/python-cryptography/template
index 6579b004e38..2363ec3042d 100644
--- a/srcpkgs/python-cryptography/template
+++ b/srcpkgs/python-cryptography/template
@@ -1,42 +1,28 @@
 # Template file for 'python-cryptography'
 pkgname=python-cryptography
-version=3.3.1
+version=3.3.2
 revision=1
 wrksrc="cryptography-${version}"
-build_style=python-module
-hostmakedepends="python-setuptools python3-setuptools libressl-devel
- python-enum34 python-ipaddress python-six python3-six
- python-cffi python3-cffi python-idna python3-idna"
-makedepends="libressl-devel python-devel python3-devel"
+build_style=python2-module
+hostmakedepends="python-setuptools libressl-devel python-enum34
+ python-ipaddress python-six python-cffi python-idna"
+makedepends="libressl-devel python-devel"
 depends="python-cffi python-six python-enum34 python-idna python-ipaddress"
 checkdepends="python-cryptography_vectors python-hypothesis python-pretend
- python-pytest python-pytz python-iso8601 python3-cryptography_vectors
- python3-hypothesis python3-pretend python3-pytest python3-pytz python3-iso8601
- ${depends}"
+ python-pytest python-pytz python-iso8601 ${depends}"
 short_desc="Python2 library that provides cryptographic recipes and primitives"
 maintainer="Alessio Sergi <al3hex@gmail.com>"
 license="BSD-3-Clause, Apache-2.0"
 homepage="https://github.com/pyca/cryptography"
 changelog="https://raw.githubusercontent.com/pyca/cryptography/master/CHANGELOG.rst"
 distfiles="${PYPI_SITE}/c/cryptography/cryptography-${version}.tar.gz"
-checksum=7e177e4bea2de937a584b13645cab32f25e3d96fc0bc4a4cf99c27dc77682be6
+checksum=5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed
 
 do_check() {
-	PYTHONPATH="$(cd build-2.7/lib* && pwd)" python2.7 -m pytest tests
-	PYTHONPATH="$(cd build-${py3_ver}/lib* && pwd)" python${py3_ver} -m pytest tests
+	PYTHONPATH="$(cd build/lib* && pwd)" python2.7 -m pytest tests
 }
 
 post_install() {
 	vlicense LICENSE
 	vlicense LICENSE.BSD
 }
-
-python3-cryptography_package() {
-	depends="python3-cffi python3-six python3-idna"
-	short_desc="${short_desc/Python2/Python3}"
-	pkg_install() {
-		vmove usr/lib/python3*
-		vlicense LICENSE
-		vlicense LICENSE.BSD
-	}
-}
diff --git a/srcpkgs/python-cryptography/update b/srcpkgs/python-cryptography/update
new file mode 100644
index 00000000000..b128c2f3bcf
--- /dev/null
+++ b/srcpkgs/python-cryptography/update
@@ -0,0 +1,2 @@
+# cryptography >= 3.4 does not support Python 2
+pattern="cryptography-\K3\.3\.[0-9.]+(?=.tar.gz)"
diff --git a/srcpkgs/python3-cryptography b/srcpkgs/python3-cryptography
deleted file mode 120000
index 056dc2d1d9b..00000000000
--- a/srcpkgs/python3-cryptography
+++ /dev/null
@@ -1 +0,0 @@
-python-cryptography
\ No newline at end of file
diff --git a/srcpkgs/python3-cryptography/template b/srcpkgs/python3-cryptography/template
new file mode 100644
index 00000000000..a7d0c8683c8
--- /dev/null
+++ b/srcpkgs/python3-cryptography/template
@@ -0,0 +1,36 @@
+# Template file for 'python3-cryptography'
+pkgname=python3-cryptography
+version=3.4.2
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+build_helper="rust"
+hostmakedepends="python3-setuptools-rust python3-cffi cargo"
+makedepends="python3-devel libressl-devel"
+depends="python3-cffi"
+checkdepends="python3-pytest-subtests python3-pytz python3-iso8601
+ python3-cryptography_vectors python3-pretend python3-hypothesis $depends"
+short_desc="Python3 library that provides cryptographic recipes and primitives"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="BSD-3-Clause, Apache-2.0"
+homepage="https://github.com/pyca/cryptography"
+changelog="https://raw.githubusercontent.com/pyca/cryptography/master/CHANGELOG.rst"
+distfiles="${PYPI_SITE}/c/cryptography/cryptography-${version}.tar.gz"
+checksum=c460e296c8cb3a796cdcc7d56c62a78fcd0a09409ccd9c658ace4f987ce935c4
+
+if [ "$CROSS_BUILD" ]; then
+	makedepends+=" rust-std"
+	export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
+	export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
+fi
+
+do_check() {
+	PYTHONPATH="$(cd build/lib* && pwd)" python3 -m pytest
+}
+
+post_install() {
+	vlicense LICENSE
+	vlicense LICENSE.BSD
+
+	chmod 755 ${DESTDIR}/${py3_sitelib}/cryptography/hazmat/bindings/*.so
+}

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: python-cryptography: split python2 package
  2021-02-08 19:26 [PR PATCH] python-cryptography: split python2 package ahesford
  2021-02-08 19:37 ` [PR PATCH] [Updated] " ahesford
@ 2021-02-08 19:39 ` ahesford
  2021-02-08 19:39 ` ahesford
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2021-02-08 19:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/28595#issuecomment-775393349

Comment:
If `setuptools_rust` upstream rejects the patch to honor RUSTFLAGS in the environment, either we patch anyway or we work around its tendency to overwrite that variable by wrapping `cargo` for cross builds:
```bash
pre_configure() {
	if [ "$CROSS_BUILD" ]; then
		cat > ${XBPS_WRAPPERDIR}/cargo <<-EOF
		#!/bin/bash
		if [[ ! "\$RUSTFLAGS" =~ "--sysroot" ]]; then
		    export RUSTFLAGS="\$RUSTFLAGS --sysroot=${XBPS_CROSS_BASE}/usr"
		fi
		exec /usr/bin/cargo "\$@"
		EOF
		chmod 755 ${XBPS_WRAPPERDIR}/cargo
	fi
}
```

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: python-cryptography: split python2 package
  2021-02-08 19:26 [PR PATCH] python-cryptography: split python2 package ahesford
  2021-02-08 19:37 ` [PR PATCH] [Updated] " ahesford
  2021-02-08 19:39 ` ahesford
@ 2021-02-08 19:39 ` ahesford
  2021-02-08 19:39 ` ericonr
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2021-02-08 19:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/28595#issuecomment-775393349

Comment:
If `setuptools_rust` upstream rejects the patch to honor RUSTFLAGS in the environment, either we patch anyway or we work around its tendency to overwrite that variable by wrapping `cargo` for cross builds of `python3-cryptography`:
```bash
pre_configure() {
	if [ "$CROSS_BUILD" ]; then
		cat > ${XBPS_WRAPPERDIR}/cargo <<-EOF
		#!/bin/bash
		if [[ ! "\$RUSTFLAGS" =~ "--sysroot" ]]; then
		    export RUSTFLAGS="\$RUSTFLAGS --sysroot=${XBPS_CROSS_BASE}/usr"
		fi
		exec /usr/bin/cargo "\$@"
		EOF
		chmod 755 ${XBPS_WRAPPERDIR}/cargo
	fi
}
```

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: python-cryptography: split python2 package
  2021-02-08 19:26 [PR PATCH] python-cryptography: split python2 package ahesford
                   ` (2 preceding siblings ...)
  2021-02-08 19:39 ` ahesford
@ 2021-02-08 19:39 ` ericonr
  2021-02-09  3:28 ` ericonr
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2021-02-08 19:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 190 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/28595#issuecomment-775393861

Comment:
I strongly prefer the patch to `setuptools_rust`.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: python-cryptography: split python2 package
  2021-02-08 19:26 [PR PATCH] python-cryptography: split python2 package ahesford
                   ` (3 preceding siblings ...)
  2021-02-08 19:39 ` ericonr
@ 2021-02-09  3:28 ` ericonr
  2021-02-10 14:56 ` [PR PATCH] [Updated] " ahesford
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2021-02-09  3:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/28595#issuecomment-775633125

Comment:
We might not have to patch the package, https://github.com/PyO3/setuptools-rust/pull/103 can be included in the next release :)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR PATCH] [Updated] python-cryptography: split python2 package
  2021-02-08 19:26 [PR PATCH] python-cryptography: split python2 package ahesford
                   ` (4 preceding siblings ...)
  2021-02-09  3:28 ` ericonr
@ 2021-02-10 14:56 ` ahesford
  2021-02-11 14:38 ` ahesford
  2021-02-11 14:38 ` [PR PATCH] [Closed]: " ahesford
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2021-02-10 14:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

There is an updated pull request by ahesford against master on the void-packages repository

https://github.com/ahesford/void-packages cryptography
https://github.com/void-linux/void-packages/pull/28595

python-cryptography: split python2 package
If we wanted to, we could set CRYPTOGRAPHY_DONT_BUILD_RUST for "this release only" (which probably means this minor version only) and delay the `python3-setuptools_rust` addition. That would also prevent the installation of the no-op `cryptography.hazmat.bindings._rust` module. However, given that Rust is about to become a hard requirement for this package, we might as well just get it done with now.

The `python3-pytest-subtests` package is only required for checks in `python3-cryptography` but, given the importance of `cryptography`, I think it's worth ensuring that those tests pass.

A patch file from https://github.com/void-linux/void-packages/pull/28595.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cryptography-28595.patch --]
[-- Type: text/x-diff, Size: 12762 bytes --]

From dbb8ccaafbaf897bb460f1c163783a1e93e30705 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 8 Feb 2021 10:35:05 -0500
Subject: [PATCH 1/4] New package: python3-setuptools-rust-0.11.6

---
 .../patches/preserve_rustflags.patch          | 27 +++++++++++++++++++
 srcpkgs/python3-setuptools-rust/template      | 23 ++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch
 create mode 100644 srcpkgs/python3-setuptools-rust/template

diff --git a/srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch b/srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch
new file mode 100644
index 00000000000..00be144d52c
--- /dev/null
+++ b/srcpkgs/python3-setuptools-rust/patches/preserve_rustflags.patch
@@ -0,0 +1,27 @@
+From cbd30fda8c6f7cc0d304728413f2cbf488da096b Mon Sep 17 00:00:00 2001
+From: "Andrew J. Hesford" <ajh@sideband.org>
+Date: Mon, 8 Feb 2021 12:58:58 -0500
+Subject: [PATCH] Augment, rather than replace, existing RUSTFLAGS when
+ building
+
+Some complex environments, like Void's cross-compilation environment,
+use RUSTFLAGS to control the behavior of rust compilation. Rather than
+overwriting RUSTFLAGS with custom flags, augment any existing RUSTFLAGS
+to preserve these environments.
+---
+ setuptools_rust/build.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git setuptools_rust/build.py setuptools_rust/build.py
+index 40d8e42..60eddfa 100644
+--- setuptools_rust/build.py
++++ setuptools_rust/build.py
+@@ -186,7 +186,7 @@ def build_extension(self, ext):
+             rustflags += " -C target-cpu=native"
+ 
+         if rustflags:
+-            env["RUSTFLAGS"] = rustflags
++            env["RUSTFLAGS"] = (env.get("RUSTFLAGS", "") + " " + rustflags).strip()
+ 
+         # Execute cargo
+         try:
diff --git a/srcpkgs/python3-setuptools-rust/template b/srcpkgs/python3-setuptools-rust/template
new file mode 100644
index 00000000000..07ad5d97d1b
--- /dev/null
+++ b/srcpkgs/python3-setuptools-rust/template
@@ -0,0 +1,23 @@
+# Template file for 'python3-setuptools-rust'
+pkgname=python3-setuptools-rust
+version=0.11.6
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools_scm python3-toml"
+depends="python3-semanticversion python3-toml python3-setuptools"
+short_desc="Setuptools plugin for Rust support"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="MIT"
+homepage="https://github.com/PyO3/setuptools-rust"
+changelog="https://raw.githubusercontent.com/PyO3/setuptools-rust/master/CHANGELOG.md"
+distfiles="${PYPI_SITE}/s/setuptools-rust/setuptools-rust-${version}.tar.gz"
+checksum=a5b5954909cbc5d66b914ee6763f81fa2610916041c7266105a469f504a7c4ca
+
+do_check() {
+	echo "Tests have unpackaged dependencies; skipping"
+}
+
+post_install() {
+	vlicense LICENSE
+}

From 55b3975c8272a269e3faaa041fd1ab0801d2df6d Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 8 Feb 2021 11:33:57 -0500
Subject: [PATCH 2/4] New package: python3-pytest-subtests-0.4.0

---
 srcpkgs/python3-pytest-subtests/template | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 srcpkgs/python3-pytest-subtests/template

diff --git a/srcpkgs/python3-pytest-subtests/template b/srcpkgs/python3-pytest-subtests/template
new file mode 100644
index 00000000000..078df4a28ef
--- /dev/null
+++ b/srcpkgs/python3-pytest-subtests/template
@@ -0,0 +1,19 @@
+# Template file for 'python3-pytest-subtests'
+pkgname=python3-pytest-subtests
+version=0.4.0
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools_scm"
+depends="python3-pytest"
+checkdepends="$depends"
+short_desc="Subtest fixture for python3-pytest"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="MIT"
+homepage="https://github.com/pytest-dev/pytest-subtests"
+distfiles="${PYPI_SITE}/p/pytest-subtests/pytest-subtests-${version}.tar.gz"
+checksum=8d9e2c1d1dce11f7b7d2c9d09202ebfc7757b7ff0cac9b72ad328edfe7ee037b
+
+post_install() {
+	vlicense LICENSE
+}

From 94ac5b4bfd52ff990024175f5ac341246080b5e9 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 8 Feb 2021 11:09:36 -0500
Subject: [PATCH 3/4] python-cryptography_vectors: update to 3.3.2, split
 package

New package: python3-cryptography_vectors-3.4.4
---
 srcpkgs/python-cryptography_vectors/template  | 17 ++++-------------
 srcpkgs/python-cryptography_vectors/update    |  2 ++
 srcpkgs/python3-cryptography_vectors          |  1 -
 srcpkgs/python3-cryptography_vectors/template | 18 ++++++++++++++++++
 4 files changed, 24 insertions(+), 14 deletions(-)
 create mode 100644 srcpkgs/python-cryptography_vectors/update
 delete mode 120000 srcpkgs/python3-cryptography_vectors
 create mode 100644 srcpkgs/python3-cryptography_vectors/template

diff --git a/srcpkgs/python-cryptography_vectors/template b/srcpkgs/python-cryptography_vectors/template
index 8d705f4c322..41152144236 100644
--- a/srcpkgs/python-cryptography_vectors/template
+++ b/srcpkgs/python-cryptography_vectors/template
@@ -1,27 +1,18 @@
 # Template file for 'python-cryptography_vectors'
 pkgname=python-cryptography_vectors
-version=3.3.1
+version=3.3.2
 revision=1
 wrksrc="cryptography_vectors-${version}"
-build_style=python-module
-hostmakedepends="python-setuptools python3-setuptools"
+build_style=python2-module
+hostmakedepends="python-setuptools"
 short_desc="Test vectors for python-cryptography"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
 license="BSD-3-Clause, Apache-2.0"
 homepage="https://github.com/pyca/cryptography"
 distfiles="${PYPI_SITE}/c/cryptography_vectors/cryptography_vectors-${version}.tar.gz"
-checksum=03789c305dda8dccb4b8c9c019963a742469d88365abbc82e8e898ac478f5ca4
+checksum=8c9d5afada647a6c937c6392c975f204b540c31f25fd4acd925ec0e180be0afa
 
 post_install() {
 	vlicense LICENSE
 	vlicense LICENSE.BSD
 }
-
-python3-cryptography_vectors_package() {
-	short_desc="${short_desc/python/python3}"
-	pkg_install() {
-		vmove usr/lib/python3*
-		vlicense LICENSE
-		vlicense LICENSE.BSD
-	}
-}
diff --git a/srcpkgs/python-cryptography_vectors/update b/srcpkgs/python-cryptography_vectors/update
new file mode 100644
index 00000000000..051a14b7a81
--- /dev/null
+++ b/srcpkgs/python-cryptography_vectors/update
@@ -0,0 +1,2 @@
+# cryptography >= 3.4 does not support Python 2
+pattern="cryptography_vectors-\K3\.3\.[0-9.]+(?=.tar.gz)"
diff --git a/srcpkgs/python3-cryptography_vectors b/srcpkgs/python3-cryptography_vectors
deleted file mode 120000
index 321bb702bd9..00000000000
--- a/srcpkgs/python3-cryptography_vectors
+++ /dev/null
@@ -1 +0,0 @@
-python-cryptography_vectors
\ No newline at end of file
diff --git a/srcpkgs/python3-cryptography_vectors/template b/srcpkgs/python3-cryptography_vectors/template
new file mode 100644
index 00000000000..362d89acdf8
--- /dev/null
+++ b/srcpkgs/python3-cryptography_vectors/template
@@ -0,0 +1,18 @@
+# Template file for 'python3-cryptography_vectors'
+pkgname=python3-cryptography_vectors
+version=3.4.4
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+short_desc="Test vectors for python3-cryptography"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="BSD-3-Clause, Apache-2.0"
+homepage="https://github.com/pyca/cryptography"
+distfiles="${PYPI_SITE}/c/cryptography_vectors/cryptography_vectors-${version}.tar.gz"
+checksum=b0b53e3eaac12c8d8a0d373b35b43813406e884fcdac3c30f358c40e9f77093a
+
+post_install() {
+	vlicense LICENSE
+	vlicense LICENSE.BSD
+}

From 1bab27ac60150e929b85e4d0b9c16cd12d60a2a0 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 8 Feb 2021 10:58:28 -0500
Subject: [PATCH 4/4] python-cryptography: update to 3.3.2, split package

New package: python3-cryptography-3.4.4
---
 srcpkgs/python-cryptography/template  | 30 ++++++----------------
 srcpkgs/python-cryptography/update    |  2 ++
 srcpkgs/python3-cryptography          |  1 -
 srcpkgs/python3-cryptography/template | 36 +++++++++++++++++++++++++++
 4 files changed, 46 insertions(+), 23 deletions(-)
 create mode 100644 srcpkgs/python-cryptography/update
 delete mode 120000 srcpkgs/python3-cryptography
 create mode 100644 srcpkgs/python3-cryptography/template

diff --git a/srcpkgs/python-cryptography/template b/srcpkgs/python-cryptography/template
index 6579b004e38..2363ec3042d 100644
--- a/srcpkgs/python-cryptography/template
+++ b/srcpkgs/python-cryptography/template
@@ -1,42 +1,28 @@
 # Template file for 'python-cryptography'
 pkgname=python-cryptography
-version=3.3.1
+version=3.3.2
 revision=1
 wrksrc="cryptography-${version}"
-build_style=python-module
-hostmakedepends="python-setuptools python3-setuptools libressl-devel
- python-enum34 python-ipaddress python-six python3-six
- python-cffi python3-cffi python-idna python3-idna"
-makedepends="libressl-devel python-devel python3-devel"
+build_style=python2-module
+hostmakedepends="python-setuptools libressl-devel python-enum34
+ python-ipaddress python-six python-cffi python-idna"
+makedepends="libressl-devel python-devel"
 depends="python-cffi python-six python-enum34 python-idna python-ipaddress"
 checkdepends="python-cryptography_vectors python-hypothesis python-pretend
- python-pytest python-pytz python-iso8601 python3-cryptography_vectors
- python3-hypothesis python3-pretend python3-pytest python3-pytz python3-iso8601
- ${depends}"
+ python-pytest python-pytz python-iso8601 ${depends}"
 short_desc="Python2 library that provides cryptographic recipes and primitives"
 maintainer="Alessio Sergi <al3hex@gmail.com>"
 license="BSD-3-Clause, Apache-2.0"
 homepage="https://github.com/pyca/cryptography"
 changelog="https://raw.githubusercontent.com/pyca/cryptography/master/CHANGELOG.rst"
 distfiles="${PYPI_SITE}/c/cryptography/cryptography-${version}.tar.gz"
-checksum=7e177e4bea2de937a584b13645cab32f25e3d96fc0bc4a4cf99c27dc77682be6
+checksum=5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed
 
 do_check() {
-	PYTHONPATH="$(cd build-2.7/lib* && pwd)" python2.7 -m pytest tests
-	PYTHONPATH="$(cd build-${py3_ver}/lib* && pwd)" python${py3_ver} -m pytest tests
+	PYTHONPATH="$(cd build/lib* && pwd)" python2.7 -m pytest tests
 }
 
 post_install() {
 	vlicense LICENSE
 	vlicense LICENSE.BSD
 }
-
-python3-cryptography_package() {
-	depends="python3-cffi python3-six python3-idna"
-	short_desc="${short_desc/Python2/Python3}"
-	pkg_install() {
-		vmove usr/lib/python3*
-		vlicense LICENSE
-		vlicense LICENSE.BSD
-	}
-}
diff --git a/srcpkgs/python-cryptography/update b/srcpkgs/python-cryptography/update
new file mode 100644
index 00000000000..b128c2f3bcf
--- /dev/null
+++ b/srcpkgs/python-cryptography/update
@@ -0,0 +1,2 @@
+# cryptography >= 3.4 does not support Python 2
+pattern="cryptography-\K3\.3\.[0-9.]+(?=.tar.gz)"
diff --git a/srcpkgs/python3-cryptography b/srcpkgs/python3-cryptography
deleted file mode 120000
index 056dc2d1d9b..00000000000
--- a/srcpkgs/python3-cryptography
+++ /dev/null
@@ -1 +0,0 @@
-python-cryptography
\ No newline at end of file
diff --git a/srcpkgs/python3-cryptography/template b/srcpkgs/python3-cryptography/template
new file mode 100644
index 00000000000..dff0d3b211f
--- /dev/null
+++ b/srcpkgs/python3-cryptography/template
@@ -0,0 +1,36 @@
+# Template file for 'python3-cryptography'
+pkgname=python3-cryptography
+version=3.4.4
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+build_helper="rust"
+hostmakedepends="python3-setuptools-rust python3-cffi cargo"
+makedepends="python3-devel libressl-devel"
+depends="python3-cffi"
+checkdepends="python3-pytest-subtests python3-pytz python3-iso8601
+ python3-cryptography_vectors python3-pretend python3-hypothesis $depends"
+short_desc="Python3 library that provides cryptographic recipes and primitives"
+maintainer="Andrew J. Hesford <ajh@sideband.org>"
+license="BSD-3-Clause, Apache-2.0"
+homepage="https://github.com/pyca/cryptography"
+changelog="https://raw.githubusercontent.com/pyca/cryptography/master/CHANGELOG.rst"
+distfiles="${PYPI_SITE}/c/cryptography/cryptography-${version}.tar.gz"
+checksum=ee5e19f0856b6fbbdbab15c2787ca65d203801d2d65d0b8de6218f424206c848
+
+if [ "$CROSS_BUILD" ]; then
+	makedepends+=" rust-std"
+	export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
+	export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
+fi
+
+do_check() {
+	PYTHONPATH="$(cd build/lib* && pwd)" python3 -m pytest
+}
+
+post_install() {
+	vlicense LICENSE
+	vlicense LICENSE.BSD
+
+	chmod 755 ${DESTDIR}/${py3_sitelib}/cryptography/hazmat/bindings/*.so
+}

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: python-cryptography: split python2 package
  2021-02-08 19:26 [PR PATCH] python-cryptography: split python2 package ahesford
                   ` (5 preceding siblings ...)
  2021-02-10 14:56 ` [PR PATCH] [Updated] " ahesford
@ 2021-02-11 14:38 ` ahesford
  2021-02-11 14:38 ` [PR PATCH] [Closed]: " ahesford
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2021-02-11 14:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 165 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/28595#issuecomment-777507500

Comment:
Closed in 76988cd6c9bba

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR PATCH] [Closed]: python-cryptography: split python2 package
  2021-02-08 19:26 [PR PATCH] python-cryptography: split python2 package ahesford
                   ` (6 preceding siblings ...)
  2021-02-11 14:38 ` ahesford
@ 2021-02-11 14:38 ` ahesford
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2021-02-11 14:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

There's a closed pull request on the void-packages repository

python-cryptography: split python2 package
https://github.com/void-linux/void-packages/pull/28595

Description:
If we wanted to, we could set CRYPTOGRAPHY_DONT_BUILD_RUST for "this release only" (which probably means this minor version only) and delay the `python3-setuptools_rust` addition. That would also prevent the installation of the no-op `cryptography.hazmat.bindings._rust` module. However, given that Rust is about to become a hard requirement for this package, we might as well just get it done with now.

The `python3-pytest-subtests` package is only required for checks in `python3-cryptography` but, given the importance of `cryptography`, I think it's worth ensuring that those tests pass.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-11 14:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 19:26 [PR PATCH] python-cryptography: split python2 package ahesford
2021-02-08 19:37 ` [PR PATCH] [Updated] " ahesford
2021-02-08 19:39 ` ahesford
2021-02-08 19:39 ` ahesford
2021-02-08 19:39 ` ericonr
2021-02-09  3:28 ` ericonr
2021-02-10 14:56 ` [PR PATCH] [Updated] " ahesford
2021-02-11 14:38 ` ahesford
2021-02-11 14:38 ` [PR PATCH] [Closed]: " ahesford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).