-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpyproject.toml
272 lines (229 loc) · 10.8 KB
/
pyproject.toml
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# This file establishes the info needed to install simmate via pip, how to
# upload it to PyPI, and how to run python packages like pytest and coverage.
# For more information on this file and how to make similar ones, see:
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
# https://github.com/pypa/sampleproject
# For the details on conda-forge installation see:
# https://github.com/conda-forge/simmate-feedstock
# Note, for utilities like pytest and coverage, we prefer to use this file
# over files like "pytest.ini" because pyproject.toml has more uses that
# we may need in the future (i.e. it can use other modules).
# -----------------------------------------------------------------------------
[build-system]
# These are the assumed default build requirements from pip:
# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
requires = ["setuptools>=64.0.0", "wheel"]
build-backend = "setuptools.build_meta"
# -----------------------------------------------------------------------------
[project]
# published name for pip install to use
name="simmate"
# Versions should comply with PEP 440:
# https://www.python.org/dev/peps/pep-0440/
# https://semver.org/
version="0.17.0"
# Maintainer info
authors = [{name = "Jack D. Sundberg", email = "[email protected]"}]
# a quick summary and then README
# NOTE: instead of our main README, I tell users to move directly to github
description="Simmate is a toolbox for computational materials research."
readme = ".github/README_for_PyPI.md"
# General name for our LICENSE file
license = {text = "BSD 3-Clause License"}
# Classifiers help users find your project by categorizing it.
# For a list of valid classifiers, see https://pypi.org/classifiers/
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.11",
"Operating System :: OS Independent",
]
# Specify which Python versions are supported.
requires-python=">=3.10"
# This field lists other packages that your project depends on to run.
dependencies=[
# Core dependencies
"numpy >=1.22.0, <1.24.2",
"pandas >=2.0.0, <2.1.4",
"dask >=2023.6.1, <2024.4.3",
"distributed >=2023.6.1, <2023.11.1", # part of dask
"django >=4.0.0, <4.2.8",
"typer >=0.6.0, <0.7.1",
#
# Extra (smaller) dependencies & utilities
"django-allauth >=0.56.0, <=0.63.3", # for website accounts and google/github sign-ins
"django-contrib-comments >=2.2.0, <=2.2.0", # for tracking user comments in web
"django-crispy-forms >=1.13.0, <=1.14.0", # for formatting of online forms
"dj-database-url >=0.5.0, <1.4.0", # for DigitalOcean URL conversion
"django-simple-history >=3.3.0, <=3.3.0", # for tracking changes to data
"djangorestframework >=3.13.1, <3.15.2", # for our REST API
"django-filter >=21.1, <=22.1", # sets up automatic filters for our REST API
"pyyaml >=6.0, <=6.0.1", # for yaml configuration files
"plotly >=5.4.0, <5.19.0", # for interactive plots and visualization
"markdown >=3.4.1, <=3.5.1", # for docs and markdown rendering in html templates
"requests >=2.28.1, <=2.32.3", # for quick web queries and downloads
"scikit-learn >=1.1.1, <1.5.1", # machine-learning methods
"cloudpickle >=2.1.0, <=3.0.0", # for serializing complex python objects
"rich >=11.0, <13.5.2", # for coloring and styling the CLI outputs
"toml >=0.10.2, <=0.10.2", # for toml configuration files
"schedule >=1.2.0, <=1.2.0", # for running periodic tasks (prefect alternative)
"xmltodict >=0.13.0, <=0.13.0", # for reading XML files (QE outputs)
#
# These are from the MP stack and I want to phase them out over time.
# Some of these could be optional, but we add them for convenience.
"pymatgen >=2022.1.9, <2023.5.32",
"pymatgen-analysis-diffusion >=2021.4.29, <=2023.8.15", # pymatgen-diffusion on conda
"matminer >=0.9.3, <=0.9.3",
"ase >=3.22.1, <=3.23.0",
#
# Molecule-based dependencies are broken with pip, so we limit them to conda installs
# "rdkit", # cheminformatics library # BUG: install is broken on pypi
# "ipython", # for rendering molecules in output
# "umap-learn", # for chemspace mapping
#
# A fork of django-unicorn was made, which we now use + its deps
# "django-unicorn >=0.59.0, <=0.59.0", # for responsive web UI (AJAX calls)
"beautifulsoup4 >=4.8.0",
"orjson >=3.6.0",
"shortuuid >=1.0.1",
"cachetools >=4.1.1",
"decorator >=4.4.2",
]
# optional dependencies that are not installed by default
[project.optional-dependencies]
# For development and testing
DEV = [
"pytest >=6.2.5, <7.3.2",
"pytest-django >=4.5.2, <=4.8.0",
"pytest-mock >=3.7.0, <3.14.1",
"pytest-xdist >=2.5.0, <3.4.0",
"black >=24.0.0, <24.2.0",
"coverage >=6.2, <7.4.4",
"isort >=5.10.1, <5.12.1",
"mkdocs-material >=8.4.1, <9.4.15",
"mkdocstrings >=0.19.0, <=0.24.0",
"mkdocstrings-python >=0.7.1, <1.10.1",
]
EXE = [
"prefect >=2.0.0, <2.16.2", # for extra workflow orchestration
"dask-jobqueue >=0.7.3, <=0.8.2", # for submitting on HPC clusters
"anyio >=3.6.1", # for async utilities when using Prefect
"nest_asyncio >=1.5.5, <1.5.9", # to allow async calls in Spyder/iPython/Jupyter
]
# These are packages that I commonly use alongside simmate. I plan to
# organize these into optional dependencies and/or documentation. But until
# then, I keep them here for my own reference.
EXTRAS = [
"numba >=0.53.0", # for speed-up of basic calcs
"psycopg2-binary >=2.9.2", # for Postgres connections (added -binary to fix bug)
"selenium", # for web scraping (slow but robust)
"spyder", # IDE for writing/editting
"gunicorn", # for website server (Django+DigitalOcean) # NOT WINDOWS
"graphviz ==1.7", # python-graphviz on conda. for viewing prefect flows
"pygraphviz ==1.11", # pygraphviz on conda. for viewing django tables
"scikit-learn >=1.0.1", # for machine-learning
"fabric >=2.6.0", # for remote ssh connections
"django-extensions >=3.1.5", # simple tools to help with django development
"bokeh >=2.1.1", # for the dask dashboard
"h5py >=3.10.0, <=3.10.0", # for reading QE's binary output files
# OpenEye needs to point to a different source & a license is required
# pip install -i https://pypi.anaconda.org/OpenEye/simple OpenEye-toolkits
"OpenEye-toolkits @ https://pypi.anaconda.org/OpenEye/simple",
]
# For downloading third-party data directly from source instead of Simmate
DATA = [
"mp-api >=0.26.3, <0.39.2", # materials project
]
# Specific dependencies needed for optional simmate apps
BADELF = [
"mp-pyrho >=0.3.0, <=0.3.0",
"pybader >= 0.3.12, <=0.3.12",
]
CLEASE = [
"clease >=1.0.3, <=1.0.6", # for cluster expansion calcs
]
# Link to our homepage. Use github for now.
[project.urls]
homepage = "https://simmate.org/"
repository = "https://github.com/jacksund/simmate"
documentation = "https://jacksund.github.io/simmate/home/"
# Register command line interface
[project.scripts]
simmate = "simmate.command_line.base_command:simmate_app"
simmate-vasp = "simmate.apps.vasp.command_line.base_command:vasp_app"
simmate-qe = "simmate.apps.quantum_espresso.command_line.base_command:qe_app"
# -----------------------------------------------------------------------------
# Indicate which directory the source coude is in
[tool.setuptools.packages.find]
where = ["src"]
# All files that aren't *.py need to be defined explicitly. Don't "automate"
# this to grab all files because this could break installation. This can
# be effectively the opposite of .gitignore.
[tool.setuptools]
include-package-data = true
[tool.setuptools.package-data]
simmate = [
"**/*.md",
"**/*.rst",
"**/*.json",
"**/*.csv",
"**/*.yaml",
"**/*.html",
"**/*.svg",
"**/*.toml",
"**/*.css",
"**/*.js",
]
# Note, the default is to include everything, but I don't want to ship test
# files. I could switch this to use exclude-package-data in the future.
# https://setuptools.pypa.io/en/latest/userguide/datafiles.html#exclude-package-data
# -----------------------------------------------------------------------------
# These settings initialize pytest and django-pytest.
[tool.pytest.ini_options]
# Tell django-pytest settings for a dummy database and also website interaction.
# To disable django-pytest, add "-p no:django" to your pytest command
DJANGO_SETTINGS_MODULE = "simmate.configuration.django.settings_test"
# We classify all tests so that we can run different subgroups of tests. You can
# run the tests marked with "slow"... "pytest -m slow"
markers = [
"blender: requires blender installed",
"vasp: requires vasp installed",
"pymatgen: runs a pymatgen-compatibility test",
"prefect_db: requires access to the prefect database",
"slow: test is slow (>30s) and unstable in in the CI",
]
# By default, we only want to run unmarked tests. The simplest way to do this
# without adding extra files is to just list "not <marker1> and not <marker2"
# for all of them. We also want migrations to be built from scratch, not past
# migration folders.
# I manually remove -m when testing coverage, but am unsure if there's a better
# way to do this.
addopts = "--no-migrations --durations=15 -m 'not blender and not vasp'"
# There are a number of warnings that are expected when running our tests.
# We remove these from our output for clarity.
filterwarnings = [
"ignore:cannot collect test class*:Warning",
"ignore:Issues encountered while parsing CIF*:Warning",
"ignore:No POTCAR file with matching TITEL fields*:Warning",
"ignore:The input structure does not match the expected standard primitive!*:Warning",
"ignore:Maximum iteration number is reached*:Warning",
# "ignore:*is an unconverged VASP run*:Warning", BUG: why won't this regex work?
]
# -----------------------------------------------------------------------------
# These settings initialize the python coverage module. With this file, you can
# just use "coverage run" in the base directory without configuring any
# other settings in the command.
[tool.coverage.run]
# all tests are written using pytest, so we always need this module set
command_line = "-m pytest"
# when testing coverage, we want to ignore the test files themselves.
omit = ["*/test_*", "*/conftest.py", "*/*_test.py"]
# consider adding for coverage of templates
# plugins = django_coverage_plugin
# -----------------------------------------------------------------------------
# isort is a tool for organizing imports at the top of python files. By default,
# it conflicts with the black formatter we use, so we need to configure it here.
[tool.isort]
profile = "black"
# -----------------------------------------------------------------------------