Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Feb 2014 11:29:36 +0000 (UTC)
From:      Kubilay Kocak <koobs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r345962 - in head/security/py-cryptography: . files
Message-ID:  <201402251129.s1PBTaZk071287@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: koobs
Date: Tue Feb 25 11:29:36 2014
New Revision: 345962
URL: http://svnweb.freebsd.org/changeset/ports/345962
QAT: https://qat.redports.org/buildarchive/r345962/

Log:
  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

Added:
  head/security/py-cryptography/files/
  head/security/py-cryptography/files/patch-setup.py   (contents, props changed)
Modified:
  head/security/py-cryptography/Makefile

Modified: head/security/py-cryptography/Makefile
==============================================================================
--- head/security/py-cryptography/Makefile	Tue Feb 25 11:28:52 2014	(r345961)
+++ head/security/py-cryptography/Makefile	Tue Feb 25 11:29:36 2014	(r345962)
@@ -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>

Added: head/security/py-cryptography/files/patch-setup.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/py-cryptography/files/patch-setup.py	Tue Feb 25 11:29:36 2014	(r345962)
@@ -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,
+     }
+ )



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402251129.s1PBTaZk071287>