diff --git a/setup.py b/setup.py index c484964..dcf4002 100644 --- a/setup.py +++ b/setup.py @@ -1,55 +1,57 @@ -# -*- coding: utf-8 -*- #!/usr/bin/env python +# -*- coding: utf-8 -*- +from setuptools import setup, find_packages import os -import sys +import re + -import djmoney_rates +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.match("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) -try: - from setuptools import setup -except ImportError: - from distutils.core import setup -version = djmoney_rates.__version__ +version = get_version('djmoney_rates') -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() -readme = open('README.rst').read() -history = open('HISTORY.rst').read().replace('.. :changelog:', '') +LONG_DESCRIPTION = open('README.rst').read() setup( name='django-money-rates', version=version, description='Currency conversion for money', - long_description=readme + '\n\n' + history, - author='Federico Frenguelli', - author_email='synasius@gmail.com', - url='https://github.com/evonove/django-money-rates', - packages=[ - 'djmoney_rates', - ], - include_package_data=True, - install_requires=[ - ], - license="BSD", - zip_safe=False, - keywords='django-money-rates', + long_description=LONG_DESCRIPTION, classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', - "Programming Language :: Python :: 2", - 'Programming Language :: Python :: 2.6', + "Operating System :: OS Independent", 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', + "Programming Language :: Python :: 3.2", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Topic :: Software Development :: Libraries :: Python Modules", + "Framework :: Django", + "Framework :: Django :: 1.8", + "Framework :: Django :: 1.9", + "Framework :: Django :: 1.10", ], + keywords='django-money-rates', + author='Federico Frenguelli', + author_email='synasius@gmail.com', + url='https://github.com/evonove/django-money-rates', + license="BSD", + packages=find_packages(), + include_package_data=True, + test_suite='runtests', + install_requires=[ + 'py-moneyed==0.5.0' + ], + zip_safe=False, )