Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

no import for setup.py

  • Loading branch information...
commit d5d5cb84f589eccce4402633faaefcd20eacb06c 1 parent 5912a82
Patrick Lauber authored April 02, 2013

Showing 1 changed file with 25 additions and 6 deletions. Show diff stats Hide diff stats

  1. 31  setup.py
31  setup.py
... ...
@@ -1,8 +1,27 @@
1 1
 from setuptools import setup, find_packages
  2
+import sys
  3
+
2 4
 import os
3  
-import cms
  5
+import re
  6
+
  7
+
  8
+def get_version(package):
  9
+    """
  10
+    Return package version as listed in `__version__` in `init.py`.
  11
+    """
  12
+    init_py = open(os.path.join(package, '__init__.py')).read()
  13
+    return re.search("__version__\s*=\s*(.*)", init_py).group(1)
  14
+
  15
+
  16
+version = get_version('cms')
  17
+
  18
+if sys.argv[-1] == 'publish':
  19
+    os.system("python setup.py sdist upload")
  20
+    print("You probably want to also tag the version now:")
  21
+    print("  git tag -a %s -m 'version %s'" % (version, version))
  22
+    print("  git push --tags")
  23
+    sys.exit()
4 24
 
5  
-        
6 25
 CLASSIFIERS = [
7 26
     'Development Status :: 5 - Production/Stable',
8 27
     'Environment :: Web Environment',
@@ -20,7 +39,7 @@
20 39
     author="Patrick Lauber",
21 40
     author_email="digi@treepy.com",
22 41
     name='django-cms',
23  
-    version=cms.__version__,
  42
+    version=version,
24 43
     description='An Advanced Django CMS',
25 44
     long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst')).read(),
26 45
     url='https://www.django-cms.org/',
@@ -43,8 +62,8 @@
43 62
         'Pygments==1.5',
44 63
         'dj-database-url==0.2.1',
45 64
     ],
46  
-    packages=find_packages(exclude=["project","project.*"]),
  65
+    packages=find_packages(),
47 66
     include_package_data=True,
48  
-    zip_safe = False,
49  
-    test_suite = 'runtests.main',
  67
+    zip_safe=False,
  68
+    test_suite='runtests.main',
50 69
 )

0 notes on commit d5d5cb8

Please sign in to comment.
Something went wrong with that request. Please try again.