diff options
author | Tobias Brox <tobixen@gmail.com> | 2015-02-14 18:36:32 +0100 |
---|---|---|
committer | Tobias Brox <tobixen@gmail.com> | 2015-02-14 18:36:32 +0100 |
commit | 854948ddc057f0ce7cc047b3618e8d5f6a1a292c (patch) | |
tree | 536d01f8c22165b170a6a437c14ab23a55d4bcfc /setup.py | |
parent | f4d4dfb8a3b1fc2f45452014b1bd164a4172465f (diff) | |
download | calendar-cli-854948ddc057f0ce7cc047b3618e8d5f6a1a292c.zip |
loading some of the metadata from the script into setup.py, to avoid redundancy and make sure the version number needs to be bumped only one place. Ref http://stackoverflow.com/questions/28213267/design-pattern-for-setup-py-to-avoid-duplicated-metadata
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 28 |
1 files changed, 16 insertions, 12 deletions
@@ -3,32 +3,35 @@ import sys import os -try: - from setuptools import setup -except ImportError: - from distutils.core import setup +from setuptools import setup, find_packages + +## TODO: "import imp" will not work from python 3.3, ref +## http://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path. +## Since we depend on caldav which depends on vobject which currently +## doesn't support python3, it's not an issue right now. +import imp +my_script = imp.load_source('my_script', './calendar-cli.py') +metadata = {} +for attribute in ('version', 'author', 'author_email', 'license'): + if hasattr(my_script, '__%s__' % attribute): + metadata[attribute] = getattr(my_script, '__%s__' % attribute) setup( name='calendar-cli', - version='0.1', description='Simple command-line CalDav client, for adding and browsing calendar items, todo list items, etc.', url='https://github.com/tobixen/calendar-cli', #packages=['', # ], - license='GPLv3+', - author='Tobias Brox', - author_email='t-calendar-cli@tobixen.no', classifiers=[ - #"Development Status :: 5 - Production/Stable", + #"Development Status :: ..." "Environment :: Web Environment", - "Intended Audience :: Developers", - #"License :: OSI Approved :: Apache Software License", + #"Intended Audience :: Developers", + #"License :: OSI Approved :: ...", "Operating System :: POSIX", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries", - "Topic :: Software Development :: Libraries :: Python Modules", ], scripts=['calendar-cli.py'], install_requires=[ @@ -37,4 +40,5 @@ setup( 'pytz', 'tzlocal' ], + **metadata ) |