Преглед на файлове

Only add django to requirements if it's not importable

Ask Solem преди 15 години
родител
ревизия
2988037aa9
променени са 1 файла, в които са добавени 8 реда и са изтрити 3 реда
  1. 8 3
      setup.py

+ 8 - 3
setup.py

@@ -40,14 +40,19 @@ class RunTests(Command):
             __file__, "test"])
         os.chdir(this_dir)
 
+install_requires = []
 
-install_requires = [
-    "django",
+try:
+    import django
+except ImportError:
+    install_requires.append("django")
+
+install_requires.extend([
     "python-dateutil",
     "anyjson",
     "carrot>=0.8.0",
     "django-picklefield",
-    "billiard>=0.2.0"]
+    "billiard>=0.2.0"])
 
 # python-daemon doesn't run on windows, so check current platform
 if platform.system() == "Windows":