|
| 1 | +# To use a consistent encoding |
| 2 | +import codecs |
| 3 | +import re |
| 4 | +from os import path |
| 5 | + |
| 6 | +# Always prefer setuptools over distutils |
| 7 | +from setuptools import setup, find_packages |
| 8 | + |
| 9 | +here = path.abspath(path.dirname(__file__)) |
| 10 | + |
| 11 | + |
| 12 | +def read(*parts): |
| 13 | + with codecs.open(path.join(here, *parts), 'r') as fp: |
| 14 | + return fp.read() |
| 15 | + |
| 16 | + |
| 17 | +def find_version(*file_paths): |
| 18 | + version_file = read(*file_paths) |
| 19 | + version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", |
| 20 | + version_file, re.M) |
| 21 | + if version_match: |
| 22 | + return version_match.group(1) |
| 23 | + raise RuntimeError("Unable to find version string.") |
| 24 | + |
| 25 | + |
| 26 | +# Get the long description from the README file |
| 27 | +with codecs.open(path.join(here, 'README.rst'), encoding='utf-8') as f: |
| 28 | + long_description = f.read() |
| 29 | + |
| 30 | +setup( |
| 31 | + name='floweaver', |
| 32 | + version=find_version('floweaver', '__init__.py'), |
| 33 | + description="View flow data as Sankey diagrams.", |
| 34 | + long_description=long_description, |
| 35 | + url='https://github.com/ricklupton/floweaver', |
| 36 | + author='Rick Lupton', |
| 37 | + |
| 38 | + classifiers=[ |
| 39 | + 'Development Status :: 4 - Beta', |
| 40 | + 'Intended Audience :: Developers', |
| 41 | + 'License :: OSI Approved :: MIT License', |
| 42 | + 'Programming Language :: Python :: 2', |
| 43 | + 'Programming Language :: Python :: 2.7', |
| 44 | + 'Programming Language :: Python :: 3', |
| 45 | + 'Programming Language :: Python :: 3.4', |
| 46 | + 'Programming Language :: Python :: 3.5', |
| 47 | + 'Programming Language :: Python :: 3.6', |
| 48 | + ], |
| 49 | + keywords='Sankey diagram flow data visualisation', |
| 50 | + packages=find_packages(exclude=['docs', 'tests']), |
| 51 | + install_requires=[ |
| 52 | + 'numpy', |
| 53 | + 'pandas', |
| 54 | + 'networkx (>=1,<2)', |
| 55 | + 'attrs', |
| 56 | + 'palettable', |
| 57 | + ], |
| 58 | + extras_require={ |
| 59 | + 'dev': [], |
| 60 | + 'test': [], |
| 61 | + }, |
| 62 | +) |
0 commit comments