summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos J. Puga Medina <cpm@FreeBSD.org>2017-04-30 14:26:41 +0000
committerCarlos J. Puga Medina <cpm@FreeBSD.org>2017-04-30 14:26:41 +0000
commitbd251adcb6a393657c39b0696f200ee64bacb408 (patch)
tree19a2d3bf91b85fddf246a4326292ef8d9db52987
parent85be9c0c6703d0666f750a8203b92f7d71f8ea15 (diff)
downloadfreebsd-ports-bd251adcb6a393657c39b0696f200ee64bacb408.zip
security/py-{acme,certbot}: Make argparse a conditional dependency
Backport an upstream patch [1][2] to setup.py making argparse a conditional dependency. Without this change, the following error is observed at run-time: pkg_resources.DistributionNotFound: The 'argparse' distribution was not found and is required by certbot This is due to the separate argparse distribution (via PyPI) no longer being required for Python versions >= 2.7 and >= 3.2, as they contain the argparse module in the standard library. Since FreeBSD only supports Python versions with the argparse module built in, *and* having removed the devel/py-argparse port, the install_requires=argparse dependency cannot be satisfied, as install_requires is only relevant for non standard library (PyPI) packages/dependencies. [1] https://github.com/certbot/certbot/pull/4554 [2] https://github.com/certbot/certbot/issues/4485 PR: 218973 Reported by: olgeni Approved by: koobs (py-certbot, maintainer) Obtained from: https://github.com/certbot/certbot/commit/89af460792fcdfb23c7dc4f9fcdec1bfa07a2656 Differential Revision: https://reviews.freebsd.org/D10546
-rw-r--r--security/py-acme/Makefile1
-rw-r--r--security/py-acme/files/patch-setup.py21
-rw-r--r--security/py-certbot/Makefile1
-rw-r--r--security/py-certbot/files/patch-setup.py21
4 files changed, 44 insertions, 0 deletions
diff --git a/security/py-acme/Makefile b/security/py-acme/Makefile
index eea49a0edc00..9f0e75252d09 100644
--- a/security/py-acme/Makefile
+++ b/security/py-acme/Makefile
@@ -3,6 +3,7 @@
PORTNAME= acme
PORTVERSION= 0.13.0
+PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= security python
MASTER_SITES= CHEESESHOP
diff --git a/security/py-acme/files/patch-setup.py b/security/py-acme/files/patch-setup.py
new file mode 100644
index 000000000000..1730527f5365
--- /dev/null
+++ b/security/py-acme/files/patch-setup.py
@@ -0,0 +1,21 @@
+--- setup.py.orig 2017-04-30 10:29:55 UTC
++++ setup.py
+@@ -8,7 +8,6 @@ version = '0.13.0'
+
+ # Please update tox.ini when modifying dependency version requirements
+ install_requires = [
+- 'argparse',
+ # load_pem_private/public_key (>=0.6)
+ # rsa_recover_prime_factors (>=0.8)
+ 'cryptography>=0.8',
+@@ -28,6 +27,10 @@ install_requires = [
+ 'six',
+ ]
+
++# env markers cause problems with older pip and setuptools
++if sys.version_info < (2, 7):
++ install_requires.append('argparse')
++
+ dev_extras = [
+ 'nose',
+ 'tox',
diff --git a/security/py-certbot/Makefile b/security/py-certbot/Makefile
index 34b94ec1221d..f9b4c2ed04c5 100644
--- a/security/py-certbot/Makefile
+++ b/security/py-certbot/Makefile
@@ -3,6 +3,7 @@
PORTNAME= certbot
PORTVERSION= 0.13.0
+PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= security python
MASTER_SITES= CHEESESHOP
diff --git a/security/py-certbot/files/patch-setup.py b/security/py-certbot/files/patch-setup.py
new file mode 100644
index 000000000000..3f0c35db5b0b
--- /dev/null
+++ b/security/py-certbot/files/patch-setup.py
@@ -0,0 +1,21 @@
+--- setup.py.orig 2017-04-30 10:33:38 UTC
++++ setup.py
+@@ -36,7 +36,6 @@ version = meta['version']
+ # https://github.com/pypa/pip/issues/988 for more info.
+ install_requires = [
+ 'acme=={0}'.format(version),
+- 'argparse',
+ # We technically need ConfigArgParse 0.10.0 for Python 2.6 support, but
+ # saying so here causes a runtime error against our temporary fork of 0.9.3
+ # in which we added 2.6 support (see #2243), so we relax the requirement.
+@@ -56,6 +55,10 @@ install_requires = [
+ 'zope.interface',
+ ]
+
++# env markers cause problems with older pip and setuptools
++if sys.version_info < (2, 7):
++ install_requires.append('argparse')
++
+ dev_extras = [
+ # Pin astroid==1.3.5, pylint==1.4.2 as a workaround for #289
+ 'astroid==1.3.5',