-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
182 lines (152 loc) · 5.73 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
"""Sets up the utopya package, test dependencies, and command line scripts"""
from setuptools import find_packages, setup
# .. Dependency lists .........................................................
INSTALL_DEPS = [
"numpy",
"scipy",
"matplotlib",
"seaborn",
"ruamel.yaml",
"coloredlogs",
"colorama",
"click",
"pydantic >= 2.0",
"python-git-info",
#
# first-party packages
"yayaml>=0.2.2",
"paramspace>=2.8",
"dantro>=0.20.2",
]
# NOTE When adding a new dependency, make sure to denote it in the isort
# configuration, see pyproject.toml.
# Dependencies for running tests and general development of utopya
TEST_DEPS = [
"pytest",
"pytest-cov",
"pytest-order",
"pre-commit",
]
# Dependencies for building the utopya documentation
DOC_DEPS = [
"sphinx>=5.3",
"sphinx-book-theme",
"sphinx-togglebutton",
"ipython>=7.0",
"myst-parser[linkify]",
"sphinx-click",
"pytest",
]
# Optional dependencies
OPTIONAL_DEPS = [
"networkx",
"pygraphviz",
]
# .. Description ..............................................................
DESCRIPTION = "A simulation management and evaluation framework"
LONG_DESCRIPTION = """
``utopya``: A simulation management and evaluation framework
============================================================
The ``utopya`` package provides a simulation management and evaluation
framework with the following feature set:
- **Run model simulations** in parallel and on cluster architectures
- Conveniently perform parameter sweeps of arbitrary parameters with the help
of the `paramspace <https://gitlab.com/blsqr/paramspace>`_ package.
- A **powerful CLI** to run and evaluate models, including interactive plotting
- Integrates the `dantro <https://gitlab.com/utopia-project/dantro>`_
**data processing pipeline**:
- Loads data into a hierarchical data tree, supplying a uniform interface
- Gives access to a configuration-based **data transformation framework**,
separating data preprocessing from visualization for increased generality
- Easy extensibility of plot creators via model-specific plot implementations
- A **versatile configuration interface** for both simulation and evaluation:
- Assembling multi-level model configurations, including several default
levels
- Assembling plot configurations with multiple inheritance, reducing
redundant definitions
- Model, project, and framework registration and handling
- Managing data output directories
- Tools to simplify model test implementations or working without a CLI
- ... and more
The ``utopya`` package evolved as part of the
`Utopia Project <https://utopia-project.org>`_ and provides the frontend of
the `Utopia modelling framework <https://gitlab.com/utopia-project/utopia>`_.
Having been outsourced from that project, it can be used with arbitrary model
implementations with a very low barrier for entry: in the simplest case, only
the path to an executable is required to run simulations.
With more compliance to the utopya interface, more features become available.
The ``utopya`` package is **open source software** released under the
`LGPLv3+ <https://www.gnu.org/licenses/lgpl-3.0.html>`_ license.
Visit the `utopya project website <https://gitlab.com/utopia-project/utopya>`_
or the `documentation page <https://utopya.readthedocs.io/>`_ for more
information about utopya.
"""
# .............................................................................
def find_version(*file_paths) -> str:
"""Tries to extract a version from the given path sequence"""
import codecs
import os
import re
def read(*parts):
"""Reads a file from the given path sequence, relative to this file"""
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, *parts), "r") as fp:
return fp.read()
# Read the file and match the __version__ string
file = read(*file_paths)
match = re.search(r"^__version__\s?=\s?['\"]([^'\"]*)['\"]", file, re.M)
if match:
return match.group(1)
raise RuntimeError("Unable to find version string in " + str(file_paths))
# .............................................................................
setup(
name="utopya",
#
# Package information
version=find_version("utopya", "__init__.py"),
#
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
url="https://gitlab.com/utopia-project/utopya",
author="utopya developers",
author_email=("Yunus Sevinchan <[email protected]>"),
classifiers=[
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
#
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
#
"Topic :: Utilities",
"Topic :: Scientific/Engineering",
],
#
# Package content
packages=find_packages(exclude=("demo", "tests")),
package_data=dict(utopya=["cfg/*.yml"]),
data_files=[
("", ["COPYING", "COPYING.LESSER", "README.md", "CHANGELOG.md"]),
],
#
# Dependencies
install_requires=INSTALL_DEPS,
extras_require=dict(
test=TEST_DEPS,
doc=DOC_DEPS,
opt=OPTIONAL_DEPS,
dev=TEST_DEPS + DOC_DEPS + OPTIONAL_DEPS,
),
#
# Command line scripts
entry_points={
"console_scripts": [
"utopya = utopya_cli.cli:cli",
"utopia = utopya_cli.cli:cli",
],
},
)