aboutsummaryrefslogtreecommitdiffstats
path: root/security/py-cryptography
diff options
context:
space:
mode:
authorkoobs <koobs@FreeBSD.org>2014-02-25 19:29:36 +0800
committerkoobs <koobs@FreeBSD.org>2014-02-25 19:29:36 +0800
commit0fd6fe20238a4923c1984b441aa81fca580cc2bd (patch)
treef30a384b2e06b4819c65ab18896ab40243a44300 /security/py-cryptography
parente7babc48e7894a6aa567e0b0132117f8118825c8 (diff)
downloadfreebsd-ports-gnome-0fd6fe20238a4923c1984b441aa81fca580cc2bd.tar.gz
freebsd-ports-gnome-0fd6fe20238a4923c1984b441aa81fca580cc2bd.tar.zst
freebsd-ports-gnome-0fd6fe20238a4923c1984b441aa81fca580cc2bd.zip
security/py-cryptography: Tests fix, Depend on OpenSSL
- Backport python setup.py test integration PR [1] - Add OpenSSL as a dependency (Was py-openssl dependency) - Add TEST_DEPENDS and regression-test: target [1] https://github.com/pyca/cryptography/pull/678
Diffstat (limited to 'security/py-cryptography')
-rw-r--r--security/py-cryptography/Makefile9
-rw-r--r--security/py-cryptography/files/patch-setup.py56
2 files changed, 65 insertions, 0 deletions
diff --git a/security/py-cryptography/Makefile b/security/py-cryptography/Makefile
index 4be6e1798437..b7a9f9a1eaa7 100644
--- a/security/py-cryptography/Makefile
+++ b/security/py-cryptography/Makefile
@@ -3,6 +3,7 @@
PORTNAME= cryptography
PORTVERSION= 0.2.1
+PORTREVISION= 1
CATEGORIES= security python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -14,9 +15,17 @@ LICENSE= APACHE20
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cffi>=0.8:${PORTSDIR}/devel/py-cffi \
${PYTHON_PKGNAMEPREFIX}six>=1.4.1:${PORTSDIR}/devel/py-six
+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:${PORTSDIR}/devel/py-pytest
+USE_OPENSSL= yes
USE_PYTHON= yes
USE_PYDISTUTILS= yes
PYDISTUTILS_AUTOPLIST= yes
+CFLAGS+= -I${OPENSSLINC}
+LDFLAGS+= -L${OPENSSLLIB}
+
+regression-test: build
+ @cd ${WRKSRC} && ${PYTHON_CMD} ${PYSETUP} test
+
.include <bsd.port.mk>
diff --git a/security/py-cryptography/files/patch-setup.py b/security/py-cryptography/files/patch-setup.py
new file mode 100644
index 000000000000..4eed97f229b9
--- /dev/null
+++ b/security/py-cryptography/files/patch-setup.py
@@ -0,0 +1,56 @@
+--- ./setup.py.orig 2014-02-23 08:35:18.000000000 +1100
++++ ./setup.py 2014-02-24 19:34:58.741325597 +1100
+@@ -14,7 +14,8 @@
+ from distutils.command.build import build
+
+ from setuptools import setup, find_packages
+-
++from setuptools.command.test import test as TestCommand
++import sys
+
+ base_dir = os.path.dirname(__file__)
+
+@@ -31,6 +32,12 @@
+ SIX_DEPENDENCY
+ ]
+
++test_requirements = [
++ "pytest",
++ "pretend",
++ "iso8601"
++]
++
+
+ class cffi_build(build):
+ """
+@@ -63,6 +70,16 @@
+
+ build.finalize_options(self)
+
++class PyTest(TestCommand):
++ def finalize_options(self):
++ TestCommand.finalize_options(self)
++ self.test_args = []
++ self.test_suite = True
++ def run_tests(self):
++ #import here, cause outside the eggs aren't loaded
++ import pytest
++ errno = pytest.main(self.test_args)
++ sys.exit(errno)
+
+ with open(os.path.join(base_dir, "README.rst")) as f:
+ long_description = f.read()
+@@ -105,11 +122,12 @@
+
+ install_requires=requirements,
+ setup_requires=requirements,
+-
++ tests_require=test_requirements,
+ # for cffi
+ zip_safe=False,
+ ext_package="cryptography",
+ cmdclass={
+ "build": cffi_build,
++ "test": PyTest,
+ }
+ )