Skip to content

Commit

Permalink
A better setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
synasius committed Dec 1, 2016
1 parent ea8faf5 commit 52d2665
Showing 1 changed file with 35 additions and 33 deletions.
68 changes: 35 additions & 33 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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='[email protected]',
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='[email protected]',
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,
)

0 comments on commit 52d2665

Please sign in to comment.