Skip to content

Commit

Permalink
Do not run the code this breaks it, instead use some string magic
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin van Wingerden committed Apr 28, 2015
1 parent af875ea commit 6b4a603
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion filechooser/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = '0.1.1'
__version__ = '0.1.2'

from filechooser.filechooser import FileChooser

Expand Down
13 changes: 9 additions & 4 deletions setup.py
Expand Up @@ -11,13 +11,18 @@
except ImportError:
from distutils.core import setup

version = filechooser.__version__
def get_metadata():
import re
with open(os.path.join("filechooser", "__init__.py")) as f:
return dict(re.findall("__([a-z]+)__ = ['\"]([^'\"]+)['\"]", f.read()))

metadata = get_metadata()

if sys.argv[-1] == 'publish':
os.system('cd docs && make html')
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 tag -a %s -m 'version %s'" % (metadata['version'], metadata['version']))
print(" git push --tags")
sys.exit()

Expand All @@ -29,13 +34,13 @@

setup(
name='django-filechooser',
version=version,
version=metadata['version'],
description="""jQuery Filechooser for Django projects""",
long_description=readme + '\n\n' + history,
author='Martin van Wingerden',
author_email='martinvw@gmail.com',
url='https://github.com/martinvw/django-filechooser',
download_url="https://github.com/martinvw/django-filechooser/archive/v0.1.0.tar.gz",
download_url="https://github.com/martinvw/django-filechooser/archive/v"+metadata['version']+".tar.gz",
packages=[
'filechooser',
],
Expand Down

0 comments on commit 6b4a603

Please sign in to comment.