aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2014-03-14 20:03:12 +0000
committerAlex Stapleton <alexs@prol.etari.at>2014-03-24 09:46:47 +0000
commita39a319b096b1b2b1775ae1a91117c19422a6c81 (patch)
treeda7d4dbf73d815f835dcf38a4d62d73b742480d2 /setup.py
parent68e77c752b94c2531f83589c1bb2060c5ed0d886 (diff)
downloadcryptography-a39a319b096b1b2b1775ae1a91117c19422a6c81.tar.gz
cryptography-a39a319b096b1b2b1775ae1a91117c19422a6c81.tar.bz2
cryptography-a39a319b096b1b2b1775ae1a91117c19422a6c81.zip
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.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py18
1 files changed, 16 insertions, 2 deletions
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,