From f084bf1c06e1ba80a69575dcb6372539cdf31d0f Mon Sep 17 00:00:00 2001
From: Donald Stufft <donald@stufft.io>
Date: Tue, 24 Sep 2013 22:04:41 -0400
Subject: [PATCH] Fix running tests when cffi isn't available by default

---
 setup.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/setup.py b/setup.py
index 57267f81..856be621 100644
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,11 @@
 #!/usr/bin/env python
+import glob
 import os
 import os.path
 import shlex
 import shutil
 import subprocess
+import sys
 import tarfile
 import tempfile
 
@@ -37,6 +39,11 @@ def which(name, flags=os.X_OK):  # Taken from twisted
                 result.append(pext)
     return result
 
+
+# This hack exists so that we can import nacl here
+sys.path += glob.glob("*.egg")
+
+
 try:
     import nacl.nacl
 except ImportError:
@@ -179,6 +186,9 @@ setup(
     author=nacl.__author__,
     author_email=nacl.__email__,
 
+    setup_requires=[
+        "cffi",
+    ],
     install_requires=[
         "cffi",
     ],
-- 
GitLab