|
| 1 | +from setuptools import setup, find_packages |
| 2 | +import os |
| 3 | +import re |
| 4 | +import codecs |
| 5 | +# get py3 compatible open |
| 6 | +from io import open |
| 7 | + |
| 8 | +here = os.path.abspath(os.path.dirname(__file__)) |
| 9 | + |
| 10 | +# Read the version number from a source file. |
| 11 | +# Code taken from pip's setup.py |
| 12 | +def find_version(*file_paths): |
| 13 | + # Open in Latin-1 so that we avoid encoding errors. |
| 14 | + # Use codecs.open for Python 2 compatibility |
| 15 | + with codecs.open(os.path.join(here, *file_paths), 'r', 'latin1') as f: |
| 16 | + version_file = f.read() |
| 17 | + |
| 18 | + # The version line must have the form |
| 19 | + # __version__ = 'ver' |
| 20 | + version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", |
| 21 | + version_file, re.M) |
| 22 | + if version_match: |
| 23 | + return version_match.group(1) |
| 24 | + raise RuntimeError("Unable to find version string.") |
| 25 | + |
| 26 | + |
| 27 | +# Get the long description from the relevant file |
| 28 | +with open('DESCRIPTION.rst', encoding='utf-8') as f: |
| 29 | + long_description = f.read() |
| 30 | + |
| 31 | +setup( |
| 32 | + name="mmi", |
| 33 | + version=find_version('mmi', '__init__.py'), |
| 34 | + description="Model Message Interface", |
| 35 | + long_description=long_description, |
| 36 | + |
| 37 | + # The project URL. |
| 38 | + url='http://github.com/pfmoore/sampleproject', |
| 39 | + |
| 40 | + # Author details |
| 41 | + author='Fedor Baart', |
| 42 | + |
| 43 | + |
| 44 | + # Choose your license |
| 45 | + license='GPLv3+', |
| 46 | + |
| 47 | + classifiers=[ |
| 48 | + # How mature is this project? Common values are |
| 49 | + # 3 - Alpha |
| 50 | + # 4 - Beta |
| 51 | + # 5 - Production/Stable |
| 52 | + 'Development Status :: 3 - Alpha', |
| 53 | + |
| 54 | + # Indicate who your project is intended for |
| 55 | + 'Intended Audience :: Science/Research', |
| 56 | + 'Intended Audience :: Developers', |
| 57 | + 'Topic :: Scientific/Engineering', |
| 58 | + 'Topic :: System :: Distributed Computing', |
| 59 | + |
| 60 | + # Pick your license as you wish (should match "license" above) |
| 61 | + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)" |
| 62 | + |
| 63 | + # Specify the Python versions you support here. In particular, ensure |
| 64 | + # that you indicate whether you support Python 2, Python 3 or both. |
| 65 | + 'Programming Language :: Python :: 2', |
| 66 | + 'Programming Language :: Python :: 2.7', |
| 67 | + 'Programming Language :: Python :: 3', |
| 68 | + 'Programming Language :: Python :: 3.1', |
| 69 | + 'Programming Language :: Python :: 3.2', |
| 70 | + 'Programming Language :: Python :: 3.3', |
| 71 | + ], |
| 72 | + |
| 73 | + # What does your project relate to? |
| 74 | + keywords='array messages model', |
| 75 | + |
| 76 | + # You can just specify the packages manually here if your project is |
| 77 | + # simple. Or you can use find_packages. |
| 78 | + packages=find_packages(exclude=["contrib", "docs", "tests*"]), |
| 79 | + # If there are data files included in your packages, specify them here. |
| 80 | + package_data={ |
| 81 | + # 'sample': ['*.dat'], |
| 82 | + }, |
| 83 | + |
| 84 | + install_requires = [ |
| 85 | + 'numpy', |
| 86 | + 'zmq' |
| 87 | + ], |
| 88 | + # To provide executable scripts, use entry points in preference to the |
| 89 | + # "scripts" keyword. Entry points provide cross-platform support and allow |
| 90 | + # pip to create the appropriate form of executable for the target platform. |
| 91 | + entry_points={ |
| 92 | + 'console_scripts': [ |
| 93 | + # 'runner=runner:main', |
| 94 | + ], |
| 95 | + }, |
| 96 | +) |
0 commit comments