diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-03-24 19:25:02 -0430 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-03-24 19:25:02 -0430 |
commit | 8573916ba3ea3b403f51ec4de4051db09fa91cda (patch) | |
tree | a56661e8b5df1377e9a59c6a72a70e12fef97e57 /setup.py | |
parent | eb98d47b925071acb3f0b1df6146a533525520fc (diff) | |
parent | 3888a84c2b7fc45adf3fa665880d554c1766165e (diff) | |
download | cryptography-8573916ba3ea3b403f51ec4de4051db09fa91cda.tar.gz cryptography-8573916ba3ea3b403f51ec4de4051db09fa91cda.tar.bz2 cryptography-8573916ba3ea3b403f51ec4de4051db09fa91cda.zip |
Merge pull request #795 from public/split-vectors
Split vectors into cryptography_vectors
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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, @@ -39,9 +43,14 @@ requirements = [ test_requirements = [ "pytest", "pretend", - "iso8601" + "iso8601", ] +# 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): """ @@ -81,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 |