setup.py

Fri, 15 Dec 2017 22:51:47 +0200

author
Iannis <i.binietoglou@impworks.gr>
date
Fri, 15 Dec 2017 22:51:47 +0200
changeset 13
493067e1bfbb
parent 7
415d034b0864
child 42
c95ee9720e7b
permissions
-rw-r--r--

Moved __version__ to __init__

victor@7 1 #!/usr/bin/env python
victor@7 2
victor@7 3 from setuptools import setup
victor@7 4 import os
victor@7 5 import re
victor@7 6 import io
victor@7 7
victor@7 8 # Read the long description from the readme file
victor@7 9 with open("README.rst", "rb") as f:
victor@7 10 long_description = f.read().decode("utf-8")
victor@7 11
victor@7 12
victor@7 13 # Read the version parameters from the __init__.py file. In this way
victor@7 14 # we keep the version information in a single place.
victor@7 15 def read(*names, **kwargs):
victor@7 16 with io.open(
victor@7 17 os.path.join(os.path.dirname(__file__), *names),
victor@7 18 encoding=kwargs.get("encoding", "utf8")
victor@7 19 ) as fp:
victor@7 20 return fp.read()
victor@7 21
victor@7 22
victor@7 23 def find_version(*file_paths):
victor@7 24 version_file = read(*file_paths)
victor@7 25 version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
victor@7 26 version_file, re.M)
victor@7 27 if version_match:
victor@7 28 return version_match.group(1)
victor@7 29 raise RuntimeError("Unable to find version string.")
victor@7 30
victor@7 31
victor@7 32 # Run setup
victor@7 33 setup(name='scc_access',
victor@7 34 packages=['scc_access'],
i@13 35 version=find_version("scc_access", "__init__.py"),
victor@7 36 description='Package for interacting with the Single Calculus Chain through the command line.',
victor@7 37 long_description=long_description,
victor@7 38 url='https://bitbucket.org/iannis_b/scc-access/',
victor@7 39 author='Ioannis Binietoglou',
victor@7 40 author_email='ioannis@inoe.ro',
victor@7 41 license='MIT',
victor@7 42 classifiers=[
victor@7 43 'Development Status :: 3 - Alpha',
victor@7 44 'License :: OSI Approved :: MIT License',
victor@7 45 'Programming Language :: Python :: 2',
victor@7 46 'Intended Audience :: Science/Research',
victor@7 47 'Topic :: Scientific/Engineering :: Atmospheric Science',
victor@7 48 ],
victor@7 49 keywords='lidar aerosol SCC',
victor@7 50 install_requires=[
i@13 51 "requests",
i@13 52 "pyyaml",
victor@7 53 ],
victor@7 54 entry_points={
victor@7 55 'console_scripts': ['scc_access = scc_access.scc_access:main'],
victor@7 56 },
victor@7 57 )

mercurial