Merge pull request #1468 from dstufft/move-to-src

Move the cryptography package into a src/ subdirectory
diff --git a/.coveragerc b/.coveragerc
index 8964f1c..a0a57b3 100644
--- a/.coveragerc
+++ b/.coveragerc
@@ -1,9 +1,14 @@
 [run]
 branch = True
 source =
-    cryptography/
+    cryptography
     tests/
 
+[paths]
+source =
+   src/cryptography
+   .tox/*/lib/python*/site-packages/cryptography
+
 [report]
 exclude_lines =
     @abc.abstractmethod
diff --git a/MANIFEST.in b/MANIFEST.in
index 41fb19b..b7e6559 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -7,7 +7,7 @@
 include README.rst
 
 recursive-include docs *
-recursive-include cryptography/hazmat/primitives/src *.c *.h
+recursive-include src/cryptography/hazmat/primitives/src *.c *.h
 prune docs/_build
 recursive-include tests *.py
 recursive-exclude vectors *
diff --git a/docs/conf.py b/docs/conf.py
index a924fa4..4ed2caf 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -87,7 +87,7 @@
 
 base_dir = os.path.join(os.path.dirname(__file__), os.pardir)
 about = {}
-with open(os.path.join(base_dir, "cryptography", "__about__.py")) as f:
+with open(os.path.join(base_dir, "src", "cryptography", "__about__.py")) as f:
     exec(f.read(), about)
 
 version = release = about["__version__"]
diff --git a/setup.py b/setup.py
index 2a6646d..d98ffdd 100644
--- a/setup.py
+++ b/setup.py
@@ -27,9 +27,14 @@
 
 
 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 @@
         "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,
diff --git a/cryptography/__about__.py b/src/cryptography/__about__.py
similarity index 100%
rename from cryptography/__about__.py
rename to src/cryptography/__about__.py
diff --git a/cryptography/__init__.py b/src/cryptography/__init__.py
similarity index 100%
rename from cryptography/__init__.py
rename to src/cryptography/__init__.py
diff --git a/cryptography/exceptions.py b/src/cryptography/exceptions.py
similarity index 100%
rename from cryptography/exceptions.py
rename to src/cryptography/exceptions.py
diff --git a/cryptography/fernet.py b/src/cryptography/fernet.py
similarity index 100%
rename from cryptography/fernet.py
rename to src/cryptography/fernet.py
diff --git a/cryptography/hazmat/__init__.py b/src/cryptography/hazmat/__init__.py
similarity index 100%
rename from cryptography/hazmat/__init__.py
rename to src/cryptography/hazmat/__init__.py
diff --git a/cryptography/hazmat/backends/__init__.py b/src/cryptography/hazmat/backends/__init__.py
similarity index 100%
rename from cryptography/hazmat/backends/__init__.py
rename to src/cryptography/hazmat/backends/__init__.py
diff --git a/cryptography/hazmat/backends/commoncrypto/__init__.py b/src/cryptography/hazmat/backends/commoncrypto/__init__.py
similarity index 100%
rename from cryptography/hazmat/backends/commoncrypto/__init__.py
rename to src/cryptography/hazmat/backends/commoncrypto/__init__.py
diff --git a/cryptography/hazmat/backends/commoncrypto/backend.py b/src/cryptography/hazmat/backends/commoncrypto/backend.py
similarity index 100%
rename from cryptography/hazmat/backends/commoncrypto/backend.py
rename to src/cryptography/hazmat/backends/commoncrypto/backend.py
diff --git a/cryptography/hazmat/backends/commoncrypto/ciphers.py b/src/cryptography/hazmat/backends/commoncrypto/ciphers.py
similarity index 100%
rename from cryptography/hazmat/backends/commoncrypto/ciphers.py
rename to src/cryptography/hazmat/backends/commoncrypto/ciphers.py
diff --git a/cryptography/hazmat/backends/commoncrypto/hashes.py b/src/cryptography/hazmat/backends/commoncrypto/hashes.py
similarity index 100%
rename from cryptography/hazmat/backends/commoncrypto/hashes.py
rename to src/cryptography/hazmat/backends/commoncrypto/hashes.py
diff --git a/cryptography/hazmat/backends/commoncrypto/hmac.py b/src/cryptography/hazmat/backends/commoncrypto/hmac.py
similarity index 100%
rename from cryptography/hazmat/backends/commoncrypto/hmac.py
rename to src/cryptography/hazmat/backends/commoncrypto/hmac.py
diff --git a/cryptography/hazmat/backends/interfaces.py b/src/cryptography/hazmat/backends/interfaces.py
similarity index 100%
rename from cryptography/hazmat/backends/interfaces.py
rename to src/cryptography/hazmat/backends/interfaces.py
diff --git a/cryptography/hazmat/backends/multibackend.py b/src/cryptography/hazmat/backends/multibackend.py
similarity index 100%
rename from cryptography/hazmat/backends/multibackend.py
rename to src/cryptography/hazmat/backends/multibackend.py
diff --git a/cryptography/hazmat/backends/openssl/__init__.py b/src/cryptography/hazmat/backends/openssl/__init__.py
similarity index 100%
rename from cryptography/hazmat/backends/openssl/__init__.py
rename to src/cryptography/hazmat/backends/openssl/__init__.py
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py
similarity index 100%
rename from cryptography/hazmat/backends/openssl/backend.py
rename to src/cryptography/hazmat/backends/openssl/backend.py
diff --git a/cryptography/hazmat/backends/openssl/ciphers.py b/src/cryptography/hazmat/backends/openssl/ciphers.py
similarity index 100%
rename from cryptography/hazmat/backends/openssl/ciphers.py
rename to src/cryptography/hazmat/backends/openssl/ciphers.py
diff --git a/cryptography/hazmat/backends/openssl/cmac.py b/src/cryptography/hazmat/backends/openssl/cmac.py
similarity index 100%
rename from cryptography/hazmat/backends/openssl/cmac.py
rename to src/cryptography/hazmat/backends/openssl/cmac.py
diff --git a/cryptography/hazmat/backends/openssl/dsa.py b/src/cryptography/hazmat/backends/openssl/dsa.py
similarity index 100%
rename from cryptography/hazmat/backends/openssl/dsa.py
rename to src/cryptography/hazmat/backends/openssl/dsa.py
diff --git a/cryptography/hazmat/backends/openssl/ec.py b/src/cryptography/hazmat/backends/openssl/ec.py
similarity index 100%
rename from cryptography/hazmat/backends/openssl/ec.py
rename to src/cryptography/hazmat/backends/openssl/ec.py
diff --git a/cryptography/hazmat/backends/openssl/hashes.py b/src/cryptography/hazmat/backends/openssl/hashes.py
similarity index 100%
rename from cryptography/hazmat/backends/openssl/hashes.py
rename to src/cryptography/hazmat/backends/openssl/hashes.py
diff --git a/cryptography/hazmat/backends/openssl/hmac.py b/src/cryptography/hazmat/backends/openssl/hmac.py
similarity index 100%
rename from cryptography/hazmat/backends/openssl/hmac.py
rename to src/cryptography/hazmat/backends/openssl/hmac.py
diff --git a/cryptography/hazmat/backends/openssl/rsa.py b/src/cryptography/hazmat/backends/openssl/rsa.py
similarity index 100%
rename from cryptography/hazmat/backends/openssl/rsa.py
rename to src/cryptography/hazmat/backends/openssl/rsa.py
diff --git a/cryptography/hazmat/backends/openssl/utils.py b/src/cryptography/hazmat/backends/openssl/utils.py
similarity index 100%
rename from cryptography/hazmat/backends/openssl/utils.py
rename to src/cryptography/hazmat/backends/openssl/utils.py
diff --git a/cryptography/hazmat/bindings/__init__.py b/src/cryptography/hazmat/bindings/__init__.py
similarity index 100%
rename from cryptography/hazmat/bindings/__init__.py
rename to src/cryptography/hazmat/bindings/__init__.py
diff --git a/cryptography/hazmat/bindings/commoncrypto/__init__.py b/src/cryptography/hazmat/bindings/commoncrypto/__init__.py
similarity index 100%
rename from cryptography/hazmat/bindings/commoncrypto/__init__.py
rename to src/cryptography/hazmat/bindings/commoncrypto/__init__.py
diff --git a/cryptography/hazmat/bindings/commoncrypto/binding.py b/src/cryptography/hazmat/bindings/commoncrypto/binding.py
similarity index 100%
rename from cryptography/hazmat/bindings/commoncrypto/binding.py
rename to src/cryptography/hazmat/bindings/commoncrypto/binding.py
diff --git a/cryptography/hazmat/bindings/commoncrypto/cf.py b/src/cryptography/hazmat/bindings/commoncrypto/cf.py
similarity index 100%
rename from cryptography/hazmat/bindings/commoncrypto/cf.py
rename to src/cryptography/hazmat/bindings/commoncrypto/cf.py
diff --git a/cryptography/hazmat/bindings/commoncrypto/common_cryptor.py b/src/cryptography/hazmat/bindings/commoncrypto/common_cryptor.py
similarity index 100%
rename from cryptography/hazmat/bindings/commoncrypto/common_cryptor.py
rename to src/cryptography/hazmat/bindings/commoncrypto/common_cryptor.py
diff --git a/cryptography/hazmat/bindings/commoncrypto/common_digest.py b/src/cryptography/hazmat/bindings/commoncrypto/common_digest.py
similarity index 100%
rename from cryptography/hazmat/bindings/commoncrypto/common_digest.py
rename to src/cryptography/hazmat/bindings/commoncrypto/common_digest.py
diff --git a/cryptography/hazmat/bindings/commoncrypto/common_hmac.py b/src/cryptography/hazmat/bindings/commoncrypto/common_hmac.py
similarity index 100%
rename from cryptography/hazmat/bindings/commoncrypto/common_hmac.py
rename to src/cryptography/hazmat/bindings/commoncrypto/common_hmac.py
diff --git a/cryptography/hazmat/bindings/commoncrypto/common_key_derivation.py b/src/cryptography/hazmat/bindings/commoncrypto/common_key_derivation.py
similarity index 100%
rename from cryptography/hazmat/bindings/commoncrypto/common_key_derivation.py
rename to src/cryptography/hazmat/bindings/commoncrypto/common_key_derivation.py
diff --git a/cryptography/hazmat/bindings/commoncrypto/secimport.py b/src/cryptography/hazmat/bindings/commoncrypto/secimport.py
similarity index 100%
rename from cryptography/hazmat/bindings/commoncrypto/secimport.py
rename to src/cryptography/hazmat/bindings/commoncrypto/secimport.py
diff --git a/cryptography/hazmat/bindings/commoncrypto/secitem.py b/src/cryptography/hazmat/bindings/commoncrypto/secitem.py
similarity index 100%
rename from cryptography/hazmat/bindings/commoncrypto/secitem.py
rename to src/cryptography/hazmat/bindings/commoncrypto/secitem.py
diff --git a/cryptography/hazmat/bindings/commoncrypto/seckey.py b/src/cryptography/hazmat/bindings/commoncrypto/seckey.py
similarity index 100%
rename from cryptography/hazmat/bindings/commoncrypto/seckey.py
rename to src/cryptography/hazmat/bindings/commoncrypto/seckey.py
diff --git a/cryptography/hazmat/bindings/commoncrypto/seckeychain.py b/src/cryptography/hazmat/bindings/commoncrypto/seckeychain.py
similarity index 100%
rename from cryptography/hazmat/bindings/commoncrypto/seckeychain.py
rename to src/cryptography/hazmat/bindings/commoncrypto/seckeychain.py
diff --git a/cryptography/hazmat/bindings/commoncrypto/sectransform.py b/src/cryptography/hazmat/bindings/commoncrypto/sectransform.py
similarity index 100%
rename from cryptography/hazmat/bindings/commoncrypto/sectransform.py
rename to src/cryptography/hazmat/bindings/commoncrypto/sectransform.py
diff --git a/cryptography/hazmat/bindings/openssl/__init__.py b/src/cryptography/hazmat/bindings/openssl/__init__.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/__init__.py
rename to src/cryptography/hazmat/bindings/openssl/__init__.py
diff --git a/cryptography/hazmat/bindings/openssl/aes.py b/src/cryptography/hazmat/bindings/openssl/aes.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/aes.py
rename to src/cryptography/hazmat/bindings/openssl/aes.py
diff --git a/cryptography/hazmat/bindings/openssl/asn1.py b/src/cryptography/hazmat/bindings/openssl/asn1.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/asn1.py
rename to src/cryptography/hazmat/bindings/openssl/asn1.py
diff --git a/cryptography/hazmat/bindings/openssl/bignum.py b/src/cryptography/hazmat/bindings/openssl/bignum.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/bignum.py
rename to src/cryptography/hazmat/bindings/openssl/bignum.py
diff --git a/cryptography/hazmat/bindings/openssl/binding.py b/src/cryptography/hazmat/bindings/openssl/binding.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/binding.py
rename to src/cryptography/hazmat/bindings/openssl/binding.py
diff --git a/cryptography/hazmat/bindings/openssl/bio.py b/src/cryptography/hazmat/bindings/openssl/bio.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/bio.py
rename to src/cryptography/hazmat/bindings/openssl/bio.py
diff --git a/cryptography/hazmat/bindings/openssl/cmac.py b/src/cryptography/hazmat/bindings/openssl/cmac.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/cmac.py
rename to src/cryptography/hazmat/bindings/openssl/cmac.py
diff --git a/cryptography/hazmat/bindings/openssl/cms.py b/src/cryptography/hazmat/bindings/openssl/cms.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/cms.py
rename to src/cryptography/hazmat/bindings/openssl/cms.py
diff --git a/cryptography/hazmat/bindings/openssl/conf.py b/src/cryptography/hazmat/bindings/openssl/conf.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/conf.py
rename to src/cryptography/hazmat/bindings/openssl/conf.py
diff --git a/cryptography/hazmat/bindings/openssl/crypto.py b/src/cryptography/hazmat/bindings/openssl/crypto.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/crypto.py
rename to src/cryptography/hazmat/bindings/openssl/crypto.py
diff --git a/cryptography/hazmat/bindings/openssl/dh.py b/src/cryptography/hazmat/bindings/openssl/dh.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/dh.py
rename to src/cryptography/hazmat/bindings/openssl/dh.py
diff --git a/cryptography/hazmat/bindings/openssl/dsa.py b/src/cryptography/hazmat/bindings/openssl/dsa.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/dsa.py
rename to src/cryptography/hazmat/bindings/openssl/dsa.py
diff --git a/cryptography/hazmat/bindings/openssl/ec.py b/src/cryptography/hazmat/bindings/openssl/ec.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/ec.py
rename to src/cryptography/hazmat/bindings/openssl/ec.py
diff --git a/cryptography/hazmat/bindings/openssl/ecdh.py b/src/cryptography/hazmat/bindings/openssl/ecdh.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/ecdh.py
rename to src/cryptography/hazmat/bindings/openssl/ecdh.py
diff --git a/cryptography/hazmat/bindings/openssl/ecdsa.py b/src/cryptography/hazmat/bindings/openssl/ecdsa.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/ecdsa.py
rename to src/cryptography/hazmat/bindings/openssl/ecdsa.py
diff --git a/cryptography/hazmat/bindings/openssl/engine.py b/src/cryptography/hazmat/bindings/openssl/engine.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/engine.py
rename to src/cryptography/hazmat/bindings/openssl/engine.py
diff --git a/cryptography/hazmat/bindings/openssl/err.py b/src/cryptography/hazmat/bindings/openssl/err.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/err.py
rename to src/cryptography/hazmat/bindings/openssl/err.py
diff --git a/cryptography/hazmat/bindings/openssl/evp.py b/src/cryptography/hazmat/bindings/openssl/evp.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/evp.py
rename to src/cryptography/hazmat/bindings/openssl/evp.py
diff --git a/cryptography/hazmat/bindings/openssl/hmac.py b/src/cryptography/hazmat/bindings/openssl/hmac.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/hmac.py
rename to src/cryptography/hazmat/bindings/openssl/hmac.py
diff --git a/cryptography/hazmat/bindings/openssl/nid.py b/src/cryptography/hazmat/bindings/openssl/nid.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/nid.py
rename to src/cryptography/hazmat/bindings/openssl/nid.py
diff --git a/cryptography/hazmat/bindings/openssl/objects.py b/src/cryptography/hazmat/bindings/openssl/objects.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/objects.py
rename to src/cryptography/hazmat/bindings/openssl/objects.py
diff --git a/cryptography/hazmat/bindings/openssl/opensslv.py b/src/cryptography/hazmat/bindings/openssl/opensslv.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/opensslv.py
rename to src/cryptography/hazmat/bindings/openssl/opensslv.py
diff --git a/cryptography/hazmat/bindings/openssl/osrandom_engine.py b/src/cryptography/hazmat/bindings/openssl/osrandom_engine.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/osrandom_engine.py
rename to src/cryptography/hazmat/bindings/openssl/osrandom_engine.py
diff --git a/cryptography/hazmat/bindings/openssl/pem.py b/src/cryptography/hazmat/bindings/openssl/pem.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/pem.py
rename to src/cryptography/hazmat/bindings/openssl/pem.py
diff --git a/cryptography/hazmat/bindings/openssl/pkcs12.py b/src/cryptography/hazmat/bindings/openssl/pkcs12.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/pkcs12.py
rename to src/cryptography/hazmat/bindings/openssl/pkcs12.py
diff --git a/cryptography/hazmat/bindings/openssl/pkcs7.py b/src/cryptography/hazmat/bindings/openssl/pkcs7.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/pkcs7.py
rename to src/cryptography/hazmat/bindings/openssl/pkcs7.py
diff --git a/cryptography/hazmat/bindings/openssl/rand.py b/src/cryptography/hazmat/bindings/openssl/rand.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/rand.py
rename to src/cryptography/hazmat/bindings/openssl/rand.py
diff --git a/cryptography/hazmat/bindings/openssl/rsa.py b/src/cryptography/hazmat/bindings/openssl/rsa.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/rsa.py
rename to src/cryptography/hazmat/bindings/openssl/rsa.py
diff --git a/cryptography/hazmat/bindings/openssl/ssl.py b/src/cryptography/hazmat/bindings/openssl/ssl.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/ssl.py
rename to src/cryptography/hazmat/bindings/openssl/ssl.py
diff --git a/cryptography/hazmat/bindings/openssl/x509.py b/src/cryptography/hazmat/bindings/openssl/x509.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/x509.py
rename to src/cryptography/hazmat/bindings/openssl/x509.py
diff --git a/cryptography/hazmat/bindings/openssl/x509_vfy.py b/src/cryptography/hazmat/bindings/openssl/x509_vfy.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/x509_vfy.py
rename to src/cryptography/hazmat/bindings/openssl/x509_vfy.py
diff --git a/cryptography/hazmat/bindings/openssl/x509name.py b/src/cryptography/hazmat/bindings/openssl/x509name.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/x509name.py
rename to src/cryptography/hazmat/bindings/openssl/x509name.py
diff --git a/cryptography/hazmat/bindings/openssl/x509v3.py b/src/cryptography/hazmat/bindings/openssl/x509v3.py
similarity index 100%
rename from cryptography/hazmat/bindings/openssl/x509v3.py
rename to src/cryptography/hazmat/bindings/openssl/x509v3.py
diff --git a/cryptography/hazmat/bindings/utils.py b/src/cryptography/hazmat/bindings/utils.py
similarity index 100%
rename from cryptography/hazmat/bindings/utils.py
rename to src/cryptography/hazmat/bindings/utils.py
diff --git a/cryptography/hazmat/primitives/__init__.py b/src/cryptography/hazmat/primitives/__init__.py
similarity index 100%
rename from cryptography/hazmat/primitives/__init__.py
rename to src/cryptography/hazmat/primitives/__init__.py
diff --git a/cryptography/hazmat/primitives/asymmetric/__init__.py b/src/cryptography/hazmat/primitives/asymmetric/__init__.py
similarity index 100%
rename from cryptography/hazmat/primitives/asymmetric/__init__.py
rename to src/cryptography/hazmat/primitives/asymmetric/__init__.py
diff --git a/cryptography/hazmat/primitives/asymmetric/dsa.py b/src/cryptography/hazmat/primitives/asymmetric/dsa.py
similarity index 100%
rename from cryptography/hazmat/primitives/asymmetric/dsa.py
rename to src/cryptography/hazmat/primitives/asymmetric/dsa.py
diff --git a/cryptography/hazmat/primitives/asymmetric/ec.py b/src/cryptography/hazmat/primitives/asymmetric/ec.py
similarity index 100%
rename from cryptography/hazmat/primitives/asymmetric/ec.py
rename to src/cryptography/hazmat/primitives/asymmetric/ec.py
diff --git a/cryptography/hazmat/primitives/asymmetric/padding.py b/src/cryptography/hazmat/primitives/asymmetric/padding.py
similarity index 100%
rename from cryptography/hazmat/primitives/asymmetric/padding.py
rename to src/cryptography/hazmat/primitives/asymmetric/padding.py
diff --git a/cryptography/hazmat/primitives/asymmetric/rsa.py b/src/cryptography/hazmat/primitives/asymmetric/rsa.py
similarity index 100%
rename from cryptography/hazmat/primitives/asymmetric/rsa.py
rename to src/cryptography/hazmat/primitives/asymmetric/rsa.py
diff --git a/cryptography/hazmat/primitives/ciphers/__init__.py b/src/cryptography/hazmat/primitives/ciphers/__init__.py
similarity index 100%
rename from cryptography/hazmat/primitives/ciphers/__init__.py
rename to src/cryptography/hazmat/primitives/ciphers/__init__.py
diff --git a/cryptography/hazmat/primitives/ciphers/algorithms.py b/src/cryptography/hazmat/primitives/ciphers/algorithms.py
similarity index 100%
rename from cryptography/hazmat/primitives/ciphers/algorithms.py
rename to src/cryptography/hazmat/primitives/ciphers/algorithms.py
diff --git a/cryptography/hazmat/primitives/ciphers/base.py b/src/cryptography/hazmat/primitives/ciphers/base.py
similarity index 100%
rename from cryptography/hazmat/primitives/ciphers/base.py
rename to src/cryptography/hazmat/primitives/ciphers/base.py
diff --git a/cryptography/hazmat/primitives/ciphers/modes.py b/src/cryptography/hazmat/primitives/ciphers/modes.py
similarity index 100%
rename from cryptography/hazmat/primitives/ciphers/modes.py
rename to src/cryptography/hazmat/primitives/ciphers/modes.py
diff --git a/cryptography/hazmat/primitives/cmac.py b/src/cryptography/hazmat/primitives/cmac.py
similarity index 100%
rename from cryptography/hazmat/primitives/cmac.py
rename to src/cryptography/hazmat/primitives/cmac.py
diff --git a/cryptography/hazmat/primitives/constant_time.py b/src/cryptography/hazmat/primitives/constant_time.py
similarity index 100%
rename from cryptography/hazmat/primitives/constant_time.py
rename to src/cryptography/hazmat/primitives/constant_time.py
diff --git a/cryptography/hazmat/primitives/hashes.py b/src/cryptography/hazmat/primitives/hashes.py
similarity index 100%
rename from cryptography/hazmat/primitives/hashes.py
rename to src/cryptography/hazmat/primitives/hashes.py
diff --git a/cryptography/hazmat/primitives/hmac.py b/src/cryptography/hazmat/primitives/hmac.py
similarity index 100%
rename from cryptography/hazmat/primitives/hmac.py
rename to src/cryptography/hazmat/primitives/hmac.py
diff --git a/cryptography/hazmat/primitives/interfaces.py b/src/cryptography/hazmat/primitives/interfaces.py
similarity index 100%
rename from cryptography/hazmat/primitives/interfaces.py
rename to src/cryptography/hazmat/primitives/interfaces.py
diff --git a/cryptography/hazmat/primitives/kdf/__init__.py b/src/cryptography/hazmat/primitives/kdf/__init__.py
similarity index 100%
rename from cryptography/hazmat/primitives/kdf/__init__.py
rename to src/cryptography/hazmat/primitives/kdf/__init__.py
diff --git a/cryptography/hazmat/primitives/kdf/hkdf.py b/src/cryptography/hazmat/primitives/kdf/hkdf.py
similarity index 100%
rename from cryptography/hazmat/primitives/kdf/hkdf.py
rename to src/cryptography/hazmat/primitives/kdf/hkdf.py
diff --git a/cryptography/hazmat/primitives/kdf/pbkdf2.py b/src/cryptography/hazmat/primitives/kdf/pbkdf2.py
similarity index 100%
rename from cryptography/hazmat/primitives/kdf/pbkdf2.py
rename to src/cryptography/hazmat/primitives/kdf/pbkdf2.py
diff --git a/cryptography/hazmat/primitives/padding.py b/src/cryptography/hazmat/primitives/padding.py
similarity index 100%
rename from cryptography/hazmat/primitives/padding.py
rename to src/cryptography/hazmat/primitives/padding.py
diff --git a/cryptography/hazmat/primitives/serialization.py b/src/cryptography/hazmat/primitives/serialization.py
similarity index 100%
rename from cryptography/hazmat/primitives/serialization.py
rename to src/cryptography/hazmat/primitives/serialization.py
diff --git a/cryptography/hazmat/primitives/src/constant_time.c b/src/cryptography/hazmat/primitives/src/constant_time.c
similarity index 100%
rename from cryptography/hazmat/primitives/src/constant_time.c
rename to src/cryptography/hazmat/primitives/src/constant_time.c
diff --git a/cryptography/hazmat/primitives/src/constant_time.h b/src/cryptography/hazmat/primitives/src/constant_time.h
similarity index 100%
rename from cryptography/hazmat/primitives/src/constant_time.h
rename to src/cryptography/hazmat/primitives/src/constant_time.h
diff --git a/cryptography/hazmat/primitives/twofactor/__init__.py b/src/cryptography/hazmat/primitives/twofactor/__init__.py
similarity index 100%
rename from cryptography/hazmat/primitives/twofactor/__init__.py
rename to src/cryptography/hazmat/primitives/twofactor/__init__.py
diff --git a/cryptography/hazmat/primitives/twofactor/hotp.py b/src/cryptography/hazmat/primitives/twofactor/hotp.py
similarity index 100%
rename from cryptography/hazmat/primitives/twofactor/hotp.py
rename to src/cryptography/hazmat/primitives/twofactor/hotp.py
diff --git a/cryptography/hazmat/primitives/twofactor/totp.py b/src/cryptography/hazmat/primitives/twofactor/totp.py
similarity index 100%
rename from cryptography/hazmat/primitives/twofactor/totp.py
rename to src/cryptography/hazmat/primitives/twofactor/totp.py
diff --git a/cryptography/utils.py b/src/cryptography/utils.py
similarity index 100%
rename from cryptography/utils.py
rename to src/cryptography/utils.py
diff --git a/tox.ini b/tox.ini
index d47beac..4d4ac20 100644
--- a/tox.ini
+++ b/tox.ini
@@ -11,7 +11,11 @@
     pytest
     ./vectors
 commands =
-    coverage run -m pytest --capture=no --strict {posargs}
+    # We use parallel mode and then combine here so that coverage.py will take
+    # the paths like .tox/py34/lib/python3.4/site-packages/cryptography/__init__.py
+    # and collapse them into src/cryptography/__init__.py.
+    coverage run --parallel-mode -m pytest --capture=no --strict {posargs}
+    coverage combine
     coverage report -m
 
 [testenv:docs]