# HG changeset patch # User Peter Sanchez # Date 1429660057 25200 # Tue Apr 21 16:47:37 2015 -0700 # Node ID ffabecbbd3b40b8a1a4f3f8ba470b025cc27430e # Parent 78b5cd1ef28001b81c41f4b273d1af0bcd18c873 Adding setup.py file diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -6,3 +6,6 @@ *.*~ .coverage .coveragerc +dist/ +*.egg-info/ +*.egg diff --git a/setup.py b/setup.py new file mode 100644 --- /dev/null +++ b/setup.py @@ -0,0 +1,33 @@ +import os +from setuptools import setup, find_packages + + +if os.path.exists('README.rst'): + long_description = open('README.rst', 'r').read() +else: + long_description = 'See https://bitbucket.org/netlandish/pytinder/' + + +setup( + name='pytinder', + version=__import__('tinder').get_version(), + packages=find_packages(), + description='Python Interface for the Tinder API', + author='Netlandish Inc.', + author_email='hello@netlandish.com', + url='http://bitbucket.org/netlandish/pytinder/', + long_description=long_description, + platforms=['any'], + install_requires=['requests>=2.6.0'], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Environment :: Web Environment', + ], + include_package_data=True, +) diff --git a/tinder/__init__.py b/tinder/__init__.py --- a/tinder/__init__.py +++ b/tinder/__init__.py @@ -0,0 +1,24 @@ +VERSION = (0, 1, 0, 'final', 0) + + +# taken from django-registration + +def get_version(): + "Returns a PEP 386-compliant version number from VERSION." + assert len(VERSION) == 5 + assert VERSION[3] in ('alpha', 'beta', 'rc', 'final') + + # Now build the two parts of the version number: + # main = X.Y[.Z] + # sub = .devN - for pre-alpha releases + # | {a|b|c}N - for alpha, beta and rc releases + + parts = 2 if VERSION[2] == 0 else 3 + main = '.'.join(str(x) for x in VERSION[:parts]) + + sub = '' + if VERSION[3] != 'final': + mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'} + sub = mapping[VERSION[3]] + str(VERSION[4]) + + return str(main + sub)