-
Notifications
You must be signed in to change notification settings - Fork 54
/
setup.py
101 lines (87 loc) · 3.03 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
100
101
"""
This code is from the python documentation and is
designed to read in the version number.
See: https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
"""
from setuptools import setup
from pathlib import Path
def read(pkg_name):
init_fname = Path(__file__).parent / pkg_name / "__init__.py"
with open(init_fname, "r") as fp:
return fp.read()
def get_version(pkg_name):
for line in read(pkg_name).splitlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")
def get_requirements(requirements_filename):
requirements_file = Path(__file__).parent / requirements_filename
assert requirements_file.exists()
with open(requirements_file) as f:
requirements = [
line.strip() for line in f.readlines() if not line.startswith("#")
]
# Iris has a different name on PyPI...
if "iris" in requirements:
requirements.remove("iris")
requirements.append("scitools-iris")
return requirements
def get_packages(package_name):
package = Path(package_name)
packages = [
str(path.parent).replace("/", ".") for path in package.rglob("__init__.py")
]
return packages
PACKAGE_NAME = "tobac"
# See classifiers list at: https://pypi.org/classifiers/
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Atmospheric Science",
]
setup(
name=PACKAGE_NAME,
version=get_version(PACKAGE_NAME),
description="Tracking and object-based analysis of clouds",
url="http://github.com/tobac-project/tobac",
classifiers=CLASSIFIERS,
author=[
"Max Heikenfeld",
"William Jones",
"Fabian Senf",
"Sean Freeman",
"Julia Kukulies",
"Peter Marinescu",
],
author_email=[
],
license="BSD-3-Clause License",
packages=get_packages(PACKAGE_NAME),
install_requires=get_requirements("requirements.txt"),
test_requires=["pytest"],
zip_safe=False,
)