| 1 |
|
| 2 |
import sys |
| 3 |
import os |
| 4 |
import json |
| 5 |
from setuptools import setup |
| 6 |
|
| 7 |
__author__ = 'Christian Kellner, Achilleas Koutsou' |
| 8 |
|
| 9 |
if sys.version_info.major < 3 or (sys.version_info.major > 2 and sys.version_info.minor < 6): |
| 10 |
sys.exit('Sorry, nixio requires python >= 3.6!') |
| 11 |
|
| 12 |
with open('README.rst') as f: |
| 13 |
description_text = f.read() |
| 14 |
|
| 15 |
with open('LICENSE') as f: |
| 16 |
license_text = f.read() |
| 17 |
|
| 18 |
|
| 19 |
is_win = os.name == 'nt' |
| 20 |
|
| 21 |
|
| 22 |
with open(os.path.join("nixio", "info.json")) as infofile: |
| 23 |
infodict = json.load(infofile) |
| 24 |
|
| 25 |
VERSION = infodict["VERSION"] |
| 26 |
AUTHOR = infodict["AUTHOR"] |
| 27 |
CONTACT = infodict["CONTACT"] |
| 28 |
BRIEF = infodict["BRIEF"] |
| 29 |
HOMEPAGE = infodict["HOMEPAGE"] |
| 30 |
|
| 31 |
|
| 32 |
if "dev" in VERSION: |
| 33 |
if is_win: |
| 34 |
colorcodes = ("", "") |
| 35 |
else: |
| 36 |
colorcodes = ("\033[93m", "\033[0m") |
| 37 |
sys.stderr.write("{}WARNING: You are building a development version " |
| 38 |
"of nixpy.{}\n".format(*colorcodes)) |
| 39 |
|
| 40 |
|
| 41 |
def get_wheel_data(): |
| 42 |
data = [] |
| 43 |
bin = os.environ.get('NIXPY_WHEEL_BINARIES', '') |
| 44 |
if bin and os.path.isdir(bin): |
| 45 |
data.append( |
| 46 |
('share/nixio/bin', |
| 47 |
[os.path.join(bin, f) for f in os.listdir(bin)])) |
| 48 |
return data |
| 49 |
|
| 50 |
|
| 51 |
classifiers = [ |
| 52 |
'Development Status :: 5 - Production/Stable', |
| 53 |
'Programming Language :: Python', |
| 54 |
'Programming Language :: Python :: 3.6', |
| 55 |
'Programming Language :: Python :: 3.7', |
| 56 |
'Topic :: Scientific/Engineering' |
| 57 |
] |
| 58 |
|
| 59 |
packages = ['nixio', |
| 60 |
'nixio.hdf5', |
| 61 |
'nixio.util', |
| 62 |
'nixio.exceptions', |
| 63 |
'nixio.cmd'] |
| 64 |
|
| 65 |
setup( |
| 66 |
name='nixio', |
| 67 |
version=VERSION, |
| 68 |
author=AUTHOR, |
| 69 |
author_email=CONTACT, |
| 70 |
url=HOMEPAGE, |
| 71 |
description=BRIEF, |
| 72 |
long_description=description_text, |
| 73 |
classifiers=classifiers, |
| 74 |
license='BSD', |
| 75 |
packages=packages, |
| 76 |
scripts=[], |
| 77 |
python_requires=">=3.6", |
| 78 |
tests_require=['pytest', 'scipy', 'pillow', 'matplotlib'], |
| 79 |
test_suite='pytest', |
| 80 |
setup_requires=['pytest-runner'], |
| 81 |
install_requires=['numpy', 'h5py'], |
| 82 |
package_data={'nixio': [license_text, description_text]}, |
| 83 |
include_package_data=True, |
| 84 |
zip_safe=False, |
| 85 |
data_files=get_wheel_data(), |
| •86 |
entry_points={'console_scripts': [ |
| 87 |
'nixio=nixio.cmd.main:main' |
| 88 |
]} |
| 89 |
) |