-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
75 lines (64 loc) · 1.92 KB
/
setup.py
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
#!/usr/bin/env python
"""Setup script."""
from __future__ import print_function
import glob
import sys
import os
import re
import setuptools
from setuptools import setup, find_packages
# Print some useful information in case there are problems, this info will help troubleshoot.
print("Using setuptools version", setuptools.__version__)
print("Python version = ", sys.version)
with open("README.rst") as f:
long_description = f.read()
# Read in the version from treegp/_version.py
# cf. http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package
version_file = os.path.join("treegp", "_version.py")
with open(version_file, "rt") as f:
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
txt = f.read()
mo = re.search(VSRE, txt, re.M)
if mo:
treegp_version = mo.group(1)
else:
raise RuntimeError("Unable to find version string in %s." % (version_file,))
print("treegp version is %s" % (treegp_version))
# Package name
name = "treegp"
# Packages
packages = find_packages()
# Scripts (none yet, but if we make any, they will live in scripts/)
scripts = glob.glob("scripts/*.py")
# Dependencies
dependencies = [
"numpy",
"scipy",
"treecorr>=4.2",
"fitsio>=0.9.12",
"scikit-learn>=0.18",
]
if sys.version >= "3.0":
dependencies += ["iminuit>2"]
else:
# iminuit 1.4 fails on python 2.7
dependencies += ["iminuit>=1.3,<1.4"]
package_data = {}
setup(
name=name,
description="treegp",
long_description=long_description,
license="BSD License",
classifiers=[
"Topic :: Scientific/Engineering :: Astronomy",
"Intended Audience :: Science/Research",
],
author="PFLeget",
url="https://github.com/PFLeget/treegp",
download_url="https://github.com/PFLeget/treegp/releases/tag/v%s.zip"
% treegp_version,
install_requires=dependencies,
version=treegp_version,
packages=packages,
scripts=scripts,
)