-
Notifications
You must be signed in to change notification settings - Fork 9
/
pyproject.toml
235 lines (210 loc) · 6.48 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
[project]
name = "weldx"
dynamic = [ # see: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata
"version", # version gets derived from git by setuptools_scm.
]
authors = [
{name="Cagtay Fabry", email="cagtay.fabry@bam.de"},
{name="Volker Hirthammer", email="volker.hirthammer@bam.de"},
{name="Martin K. Scherer", email="martin.scherer@bam.de"},
]
description = "Python API for the WelDX file format and standard"
readme = "README.md"
license = {file = "LICENSE", name="BSD License"}
keywords = [
"welding",
"weldx",
"bam", # TODO: add more keywords here! think of them as in a journal article.
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Physics", # TODO: add more topics here!
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
]
# Dependencies
requires-python = ">=3.9"
dependencies = [
"numpy >=1.20",
"asdf >=2.15.1",
"pandas >=1.5",
"xarray >=2022.9.0",
"scipy >=1.6.2",
"sympy >=1.6",
"pint >=0.18",
"pint-xarray >=0.3",
"bottleneck >=1.3.3",
"boltons",
"bidict",
"networkx >=2.8.2",
"fs",
"meshio",
"psutil",
"IPython",
]
[project.urls]
documentation = "https://weldx.readthedocs.io"
repository = "https://github.com/BAMweldx/weldx"
bug_tracker = "https://github.com/BAMweldx/weldx/issues"
changelog = "https://github.com/BAMweldx/weldx/blob/master/CHANGELOG.md"
[project.optional-dependencies]
test = [
"pytest >=6",
"pytest-cov",
"pytest-xdist",
"nbval",
]
vis = [
"weldx_widgets >=0.2",
]
media = [
"pims",
"av",
"dask-image",
# this is actually required by dask-image, but not listed in their requirements:
"tifffile",
]
# ASDF extension entry points.
[project.entry-points."asdf.extensions"]
weldx = "weldx.asdf.extension:get_extensions"
[project.entry-points."asdf.resource_mappings"]
weldx_schemas = "weldx.asdf.extension:get_resource_mappings"
# console scripts
[project.scripts]
welding_schema = "weldx.asdf.cli.welding_schema:main"
# Build system config, pip creates a temporary env with "requires" pkgs.
[build-system]
requires = [
"wheel",
"setuptools >= 40.9.0",
"setuptools_scm[toml]>=6.2",
]
build-backend = "setuptools.build_meta"
# Tool configs
[tool.setuptools.packages.find]
where = ["."]
[tool.setuptools_scm]
write_to = "weldx/_version.py"
write_to_template = '__version__ = "{version}"'
[tool.pytest.ini_options]
addopts = "--tb=short --color=yes -rsw --cov=weldx --cov-report=term-missing:skip-covered --doctest-modules"
#addopts = --tb=short --color=yes -rs -p no:cov
testpaths = "weldx"
# custom test markers, see https://docs.pytest.org/en/latest/example/markers.html#mark-examples
markers = "slow: marks tests as slow to run (skipped by default, enable with --runslow option)"
asdf_schema_root = "weldx/schemas/weldx.bam.de/weldx" # TODO: couldn't we just use the entry points to resolve this?
#asdf_schema_tests_enabled = true
#asdf_schema_skip_tests =
# weldx.bam.de/weldx/datamodels/single_pass_weld-1.0.0.schema.yaml
norecursedirs = [
"doc",
".ipynb_checkpoints",
]
filterwarnings = [
"ignore::DeprecationWarning:traittypes.*:",
"ignore:Passing method to :FutureWarning:xarray.*:",
"error::pint.UnitStrippedWarning",
#"error::FutureWarning", # todo: we want to enable this, as it notifies us about upcoming failures due to upstream changes.
]
[tool.coverage.run]
source = ["weldx"]
[tool.coverage.report]
omit = [
"weldx/_version.py",
"weldx/tests/*",
]
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# ignore class __repr__-like functions:
"def __repr__",
"def __str__",
"def _ipython_display_",
]
[tool.mypy]
python_version = "3.9"
files = "weldx"
ignore_missing_imports = true # TODO: this is bad!
strict_optional = false
pretty = true
allow_redefinition = true
show_error_context = true
show_error_codes = true
show_column_numbers = true
sqlite_cache = true
# MyPy per-module options:
[[tool.mypy.overrides]]
module = ["weldx.asdf.*", "weldx.tags.*", "weldx.tests.*", "weldx.welding.groove.*", "weldx.geometry.*" ]
ignore_errors = true
# this is a workaround for an xarray related mypy bug
# see https://github.com/python/mypy/pull/9495
# and https://github.com/space-physics/msise00/commit/8b59a9383dd6fcc54b7dac74eb95a350308d7b62
# TODO: is this still mandatory?
[[tool.mypy.overrides]]
module = "xarray"
follow_imports = "skip"
ignore_errors = true
[tool.ruff]
target-version = "py38" # designated Python version
exclude = [
"__init__.py",
"doc/src/conf.py",
]
# TODO: should be the following list, but Ruff does not yet impl all of them.
# W503,W504
# E203
# C408
ignore = [
"C408",
#"E203",
"E402",
#"W503",
#"W504",
"D203", "D211", "D213",
"UP006", "UP007", # see ruff GH#4427
]
line-length = 88
select = [
"B", # flake8-bugbear
"C", # flake8-comprehensions
#"D", # note: all relevant D's will be set by setting pydocstyle.convention=numpy!
"E", # pycodestyles
"F", # pyflakes
"W", # pycodestyle warnings
"UP", # pyupgrade
"T2", # flake8-print
"I001", # isort
"ICN", # import conventions, e.g. import numpy as np
#"B950", # not yet implemented by Ruff.
"RUF100", # ensure 'noqa' declarations are still valid.
]
# Allow pydocstyle violations in certain areas.
per-file-ignores."**/{tests,tags,asdf,devtools}/**" = ["D"]
per-file-ignores."conftest.py" = ["D"]
per-file-ignores."doc/src/tutorials/*" = ["D"]
per-file-ignores."doc/src/conf.py" = ["E501", # ignore long lines.
"RUF100", # do no check if 'noqa' is needed (circular import workaround)
]
# Allow prints in certain areas.
per-file-ignores."**/{cli,tests,tutorials,devtools}/**/*{.py,ipynb}" = ["T2"]
external = ["B950"]
pydocstyle = {convention = "numpy"}
mccabe = {max-complexity = 15} # max branches inside a function.
[tool.ruff.isort]
known-first-party = ["weldx"]
required-imports = ["from __future__ import annotations"]
[tool.ruff.flake8-import-conventions]
extend-aliases = {xarray = "xr"}
[tool.nbqa.addopts]
ruff = [
"--extend-ignore=B018"
]