-
Notifications
You must be signed in to change notification settings - Fork 29
/
pyproject.toml
209 lines (185 loc) · 4.91 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "krotov"
dynamic = ["version"]
description = "Python implementation of Krotov's method for quantum optimal control"
readme = "README.md"
license = {file = "LICENSE"}
authors = [
{name = "Michael Goerz", email = "mail@michaelgoerz.net"}
]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: Jupyter",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics"
]
dependencies = [
"glom",
"numpy",
"scipy",
"qutip>=4.3.1,<5.0",
"threadpoolctl",
"grapheme"
]
[tool.hatch.version]
path = "src/krotov/__init__.py"
[project.urls]
Documentation = "https://qucontrol.github.io/krotov/"
Issues = "https://github.com/qucontrol/krotov/issues"
Source = "https://github.com/qucontrol/krotov"
[project.optional-dependencies]
dev = [
"codecov",
"coverage<5.0",
"jupyter",
"loky~=2.9",
"pytest==7.4.4",
"pytest-cov<=2.6.1",
"pytest-xdist",
"nbval==0.11.0",
"weylchamber>=0.5.0",
"ipython",
]
docs = [
"pybtex==0.24.0",
"gitpython==3.1.43",
"better-apidoc==0.3.2",
"docs-versions-menu==0.5.2",
"sphinx==7.3.7",
"sphinx-autobuild==2024.4.16",
"sphinx-copybutton==0.5.2",
"sphinx_rtd_theme==2.0.0",
"sphinxcontrib-bibtex==2.6.2",
"nbsphinx==0.9.4",
"Jinja2==3.1.4",
"docutils==0.20.1",
"matplotlib==3.9.0",
"watermark==2.4.3",
"zip-files==0.4.1",
"ipython",
]
lint = [
'setuptools; python_version >= "3.12"',
"flake8",
"flake8-pyproject",
"isort==4.3.*",
"pylint~=2.6.0",
"black==22.1.0",
"click==8.0.4",
]
[tool.hatch.envs.default]
description = "Testing and other dev tasks (Python 3.12)"
features = [
"dev",
"docs",
"lint",
]
python = "3.12"
[tool.hatch.envs.default.scripts]
test = "pytest -vvv --doctest-modules --nbval --nbval-cell-timeout=3000 --sanitize-with docs/nbval_sanitize.cfg --ignore docs/_build/ --ignore docs/conf.py --durations=10 -x -s {args:src tests docs}"
cov = "pytest -vvv --doctest-modules --cov=krotov --nbval --nbval-cell-timeout=3000 --sanitize-with docs/nbval_sanitize.cfg --ignore docs/_build/ --ignore docs/conf.py --durations=10 -x -s {args:src tests docs}"
cov-html = [
"coverage html",
]
[tool.hatch.envs.docs]
description = "Generate the docs (Python 3.12)"
template = "docs"
features = [
"dev",
"docs",
]
python = "3.12"
[tool.hatch.envs.docs.scripts]
build = [
"""python -c 'import shutil; from pathlib import Path; shutil.rmtree(Path("docs")/ "notebooks" / ".ipynb_checkpoints", ignore_errors=True)'""",
"sphinx-build -v -W -b html docs docs/_build/html -d docs/_build/doctree",
]
serve = "python -m http.server -d docs/_build/html"
[tool.hatch.envs.lint]
description = "Lint the code (Python 3.12)"
template = "lint"
features = ["lint"]
skip-install = true
python = "3.12"
[tool.hatch.envs.lint.scripts]
flake8 = "python -m flake8 {args:src tests}"
pylint = "python -m pylint -j 0 {args:src}"
black = "python -m black {args:src tests}"
black-check = "python -m black --check --diff {args:src tests}"
isort = "python -m isort --recursive {args:src tests}"
isort-check = "python -m isort --recursive --check-only --diff {args:src tests}"
[tool.hatch.envs.release]
description = "Release tools (Python 3.12)"
template = "release"
features = []
dependencies = [
"click==8.0.4",
"gitpython==3.1.43",
"packaging==24.0",
"pytest==7.4.4",
"twine",
]
skip-install = true
python = "3.12"
[tool.hatch.envs.py310]
description = "Testing on Python 3.10"
features = []
dependencies = [
"numpy",
"scipy",
"qutip",
"krotov[dev]",
]
python = "3.10"
[tool.hatch.envs.py311]
description = "Testing on Python 3.11"
features = ["dev"]
python = "3.11"
[tool.hatch.envs.py312]
description = "Testing on Python 3.12"
features = ["dev"]
python = "3.12"
[tool.hatch.metadata]
allow-direct-references = true
[tool.flake8]
exclude = ["docs"]
max-line-length = 79
extend-ignore = [
# See https://github.com/PyCQA/pycodestyle/issues/373
"E203",
# don't care about "ambiguous variable names"
"E741",
# when I use lambdas, I know what I'm doing
"E731",
]
[tool.pytest.ini_options]
collect_ignore = ["setup.py"]
[tool.rstcheck]
ignore_directives = ["doctest"]
ignore_messages = ["Hyperlink target \"[^\"]+\" is not referenced\\.$"]
ignore_roles = ["cite"]
[tool.isort]
known_first_party = ["krotov"]
force_single_line = false
lines_after_imports = 2
line_length = 79
use_parentheses = true
multi_line_output = 3
include_trailing_comma = true
skip = ["src/krotov/__init__.py"]
[tool.black]
line-length = 79
skip-string-normalization = true
target-version = ["py310"]