Permalink
Browse files

no import for setup.py

  • Loading branch information...
1 parent 5912a82 commit d5d5cb84f589eccce4402633faaefcd20eacb06c @digi604 committed Apr 1, 2013
Showing with 25 additions and 6 deletions.
  1. +25 −6 setup.py
View
@@ -1,8 +1,27 @@
from setuptools import setup, find_packages
+import sys
+
import os
-import cms
+import re
+
+
+def get_version(package):
+ """
+ Return package version as listed in `__version__` in `init.py`.
+ """
+ init_py = open(os.path.join(package, '__init__.py')).read()
+ return re.search("__version__\s*=\s*(.*)", init_py).group(1)
+
+
+version = get_version('cms')
+
+if sys.argv[-1] == 'publish':
+ os.system("python setup.py sdist upload")
+ print("You probably want to also tag the version now:")
+ print(" git tag -a %s -m 'version %s'" % (version, version))
+ print(" git push --tags")
+ sys.exit()
-
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
@@ -20,7 +39,7 @@
author="Patrick Lauber",
author_email="digi@treepy.com",
name='django-cms',
- version=cms.__version__,
+ version=version,
description='An Advanced Django CMS',
long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst')).read(),
url='https://www.django-cms.org/',
@@ -43,8 +62,8 @@
'Pygments==1.5',
'dj-database-url==0.2.1',
],
- packages=find_packages(exclude=["project","project.*"]),
+ packages=find_packages(),
include_package_data=True,
- zip_safe = False,
- test_suite = 'runtests.main',
+ zip_safe=False,
+ test_suite='runtests.main',
)

0 comments on commit d5d5cb8

Please sign in to comment.