aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 2a6646db..d98ffdd3 100644
--- a/setup.py
+++ b/setup.py
@@ -27,9 +27,14 @@ from setuptools.command.test import test
base_dir = os.path.dirname(__file__)
+src_dir = os.path.join(base_dir, "src")
+
+# When executing the setup.py, we need to be able to import ourselves, this
+# means that we need to add the src/ directory to the sys.path.
+sys.path.insert(0, src_dir)
about = {}
-with open(os.path.join(base_dir, "cryptography", "__about__.py")) as f:
+with open(os.path.join(src_dir, "cryptography", "__about__.py")) as f:
exec(f.read(), about)
@@ -324,7 +329,8 @@ setup(
"Topic :: Security :: Cryptography",
],
- packages=find_packages(exclude=["tests", "tests.*"]),
+ package_dir={"": "src"},
+ packages=find_packages(where="src", exclude=["tests", "tests.*"]),
include_package_data=True,
install_requires=requirements,