From 0bd20e264c7e7dfc1ee722664c8b545a4ea64b38 Mon Sep 17 00:00:00 2001 From: Alex Stapleton Date: Fri, 14 Mar 2014 19:58:07 +0000 Subject: cryptography.vectors --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 1dfb80db..1051b424 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,8 @@ requirements = [ test_requirements = [ "pytest", "pretend", - "iso8601" + "iso8601", + "cryptography.vectors=={0}".format(about['__version__']) ] @@ -127,6 +128,7 @@ setup( ], packages=find_packages(exclude=["tests", "tests.*"]), + namespace_packages=['cryptography'], install_requires=requirements, setup_requires=requirements, -- cgit v1.2.3 From a39a319b096b1b2b1775ae1a91117c19422a6c81 Mon Sep 17 00:00:00 2001 From: Alex Stapleton Date: Fri, 14 Mar 2014 20:03:12 +0000 Subject: Move cryptography.vectors to cryptography_vectors All vectors are now stored in the subpackage in the vectors/ folder. This package is automatically installed by setup.py test and will also be uploaded with a matching version number by the PyPI upload task. --- setup.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 1051b424..eb1b3d37 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,9 @@ from __future__ import absolute_import, division, print_function import os import sys from distutils.command.build import build +import subprocess + +import pkg_resources from setuptools import find_packages, setup from setuptools.command.test import test @@ -30,6 +33,7 @@ with open(os.path.join(base_dir, "cryptography", "__about__.py")) as f: CFFI_DEPENDENCY = "cffi>=0.8" SIX_DEPENDENCY = "six>=1.4.1" +VECTORS_DEPENDENCY = "cryptography_vectors=={0}".format(about['__version__']) requirements = [ CFFI_DEPENDENCY, @@ -40,9 +44,13 @@ test_requirements = [ "pytest", "pretend", "iso8601", - "cryptography.vectors=={0}".format(about['__version__']) ] +# If there's no vectors locally that probably means we are in a tarball and +# need to go and get the matching vectors package from PyPi +if not os.path.exists(os.path.join(base_dir, "vectors/setup.py")): + test_requirements.append(VECTORS_DEPENDENCY) + class CFFIBuild(build): """ @@ -82,6 +90,13 @@ class PyTest(test): self.test_args = [] self.test_suite = True + # This means there's a vectors/ folder with the package in here. + # cd into it, install the vectors package and then refresh sys.path + if VECTORS_DEPENDENCY not in test_requirements: + subprocess.Popen([sys.executable, "setup.py", "install"], + cwd="vectors").communicate() + pkg_resources.get_distribution("cryptography_vectors").activate() + def run_tests(self): # Import here because in module scope the eggs are not loaded. import pytest @@ -128,7 +143,6 @@ setup( ], packages=find_packages(exclude=["tests", "tests.*"]), - namespace_packages=['cryptography'], install_requires=requirements, setup_requires=requirements, -- cgit v1.2.3