forked from rcv-legado/nbodypy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
99 lines (73 loc) · 2.1 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# -*- coding: utf-8 -*-
"""nbodypy setup.py."""
#############################################################################
# IMPORTS
import os
import io
import re
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from pkg_resources import get_distribution, DistributionNotFound
#############################################################################
# FUNCTIONS
def read(*names, **kwargs):
"""read."""
with io.open(
os.path.join(os.path.dirname(__file__), *names),
encoding=kwargs.get("encoding", "utf8"),
) as fp:
return fp.read()
# /def
def get_dist(pkgname):
"""Get distribution."""
try:
return get_distribution(pkgname)
except DistributionNotFound:
return None
# /def
def find_version(*file_paths):
"""Find version."""
version_file = read(*file_paths)
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M
)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
# /def
#############################################################################
# RUNNING
README = open('README').read()
HISTORY = open('HISTORY').read().replace('.. :changelog:', '')
VERSION = find_version(os.path.join('nbodypy/', '__init__.py'))
requirements = [
"numpy>=1.7",
"scipy>=0.14.0",
"galpy",
"numba",
"seaborn",
]
classifiers = [
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
]
setup(
name="nbodypy",
version=VERSION,
author="Jeremy Webb",
author_email="webb@astro.utoronto.ca",
url="https://github.com/webbjj/nbodypy.git",
description="Package to Analyze N-body Simulations of Star Clusters",
long_description=README + "\n\n" + HISTORY,
long_description_content_type="text/markdown",
license="BSD",
# Package info
packages=["nbodypy"],
zip_safe=True,
install_requires=requirements,
keywords="nbodypy",
)
#############################################################################
# END