summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAdam Chainz <adam@adamj.eu>2016-01-14 17:18:39 +0000
committerJonathan Slenders <jonathan@slenders.be>2016-01-14 23:11:53 +0100
commit8a0e11e6ef77a129dc795469aefa36f3ad10ce00 (patch)
tree3e9f41a29cd33888fab9bfb5bb14c71c7fd18fe9 /setup.py
parent9f877324c232456d2b0be001237f9a7852d2f9f5 (diff)
setup.py - add trove classifiers and version parsing
Found that `prompt_toolkit` is not listed as Python 3 compatible by `caniusepython3`, because it's lacking Trove Classifiers. Added them. Due to adding a License Trove Classifier, it's no longer necessary to provide the `license` argument to `setup`. Whilst I was at it I saw you have the version defined in two files with a comment to remind you about updating both. I have adapted some code I use on a number of projects to ease this burden so the version is only stored in `__init__`. Conflicts: setup.py
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py29
1 files changed, 26 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 36b7117b..05ba5183 100755
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
import os
+import re
from setuptools import setup, find_packages
@@ -11,14 +12,22 @@ long_description = open(
).read()
-# Don't forget to update in `prompt_toolkit.__init__` and `docs/conf.py`!
-version = '0.57'
+def get_version(package):
+ """
+ Return package version as listed in `__version__` in `__init__.py`.
+ """
+ path = os.path.join(os.path.dirname(__file__), package, '__init__.py')
+ with open(path) as f:
+ init_py = f.read()
+ return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
+
+
+version = get_version('prompt_toolkit')
setup(
name='prompt_toolkit',
author='Jonathan Slenders',
version=version,
- license='LICENSE.txt',
url='https://github.com/jonathanslenders/python-prompt-toolkit',
description='Library for building powerful interactive command lines in Python',
long_description=long_description,
@@ -28,4 +37,18 @@ setup(
'six>=1.9.0',
'wcwidth',
],
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: BSD License',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python',
+ 'Topic :: Software Development',
+ ],
)