Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Another stab at fixing #50, #57 and #58

  • Loading branch information...
commit 9b0783940358c9db9559a71e4cf18a490de5266d 1 parent 45a41e3
@matthiask matthiask authored
Showing with 16 additions and 3 deletions.
  1. +16 −3 setup.py
View
19 setup.py
@@ -3,11 +3,24 @@
import os
from setuptools import setup, find_packages
from setuptools.dist import Distribution
+import pkg_resources
+
+
+add_django_dependency = True
+# See issues #50, #57 and #58 for why this is necessary
+try:
+ pkg_resources.get_distribution('Django')
+ add_django_dependency = False
+except pkg_resources.DistributionNotFound:
+ try:
+ import django
+ if django.VERSION[0] >= 1 and django.VERSION[1] >= 1 and django.VERSION[2] >= 1:
+ add_django_dependency = False
+ except ImportError:
+ pass
Distribution({
- "setup_requires": [
- #'Django >=1.1.1' # See http://github.com/matthiask/feincms/issues/closed#issue/50
- ]
+ "setup_requires": add_django_dependency and ['Django >=1.1.1'] or []
})
import feincms
Please sign in to comment.
Something went wrong with that request. Please try again.