-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·120 lines (88 loc) · 3.15 KB
/
setup.py
File metadata and controls
executable file
·120 lines (88 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/env python
""" Setup script. Used by easy_install and pip. """
import os
import sys
import re
import textwrap
from setuptools import setup, find_packages
from setuptools import Extension as Ext
"""Some functions for checking and showing errors and warnings."""
def _print_admonition(kind, head, body):
tw = textwrap.TextWrapper(initial_indent=' ', subsequent_indent=' ')
print(".. {0}:: {1}".format(kind.upper(), head))
for line in tw.wrap(body):
print(line)
def exit_with_error(head, body=''):
_print_admonition('error', head, body)
sys.exit(1)
def print_warning(head, body=''):
_print_admonition('warning', head, body)
def check_import(pkgname, pkgver):
""" Check for required Python packages. """
try:
mod = __import__(pkgname)
if mod.__version__ < pkgver:
raise ImportError
except ImportError:
exit_with_error(f"Can't find a local {pkgname} installation"
f" with version >= {pkgver}. "
f"Crossflow needs {pkgname} {pkgname} or greater"
" to compile and run! "
"Please see the ``README`` file.")
print(f"* Found {pkgname} {mod.__version__} package installed.")
globals()[pkgname] = mod
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
"""Discover the package version"""
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
VERSIONFILE = "crossflow/_version.py"
verstrline = open(VERSIONFILE, "rt").read()
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
raise RuntimeError(f"Cannot find version string in {VERSIONFILE}.")
"""Check Python version"""
print("* Checking Python version...")
if sys.version_info[:2] < (3, 4):
exit_with_error("You need Python 3.4+ to install crossflow!")
print("* Python version OK!")
"""Set up crossflow."""
class Extension(Ext, object):
pass
setup_args = {
'name': "crossflow",
'version': verstr,
'description': "A Python workflows system",
'long_description': read('README.md'),
'author': "Charlie Laughton",
'author_email': "charles.laughton@nottingham.ac.uk",
'url': "",
'license': "MIT license.",
'classifiers': [
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'Environment :: Console',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Scientific/Engineering',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
'Operating System :: Unix'
],
'packages': find_packages(),
'scripts': [
],
'install_requires': [
'dask',
'distributed',
'fsspec',
],
'zip_safe': False,
}
setup(**setup_args)