setup.py

Fri, 22 Sep 2017 15:02:53 +0300

author
Victor Nicolae <victor.nicolae@inoe.ro>
date
Fri, 22 Sep 2017 15:02:53 +0300
changeset 76
e59cdc4fd4c0
parent 66
51b799247d67
child 94
7e2ab78dffd9
permissions
-rwxr-xr-x

Include all parameters from the NetCDF parameters file in the final output file.

Better inform the user if any mandatory parameter misses from the file.

In case of extra (optional) parameters, allow missing values in the output file.

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

mercurial