-
Notifications
You must be signed in to change notification settings - Fork 18
/
pyproject.toml
207 lines (183 loc) · 5.31 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
[build-system]
requires = ["hatchling>=1.8.0", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "src/dtscalibration/__init__.py"
[tool.hatch.build.targets.sdist]
exclude = [
"/.github", "/.mypy_cache", "/.pytest_cache", "/.githooks",
"sonar-project.properties"
]
[tool.hatch.build.targets.wheel]
packages = ["src/dtscalibration"]
[tool.hatch.publish.index]
disable = true # Requires confirmation when publishing to pypi.
[project]
name = "dtscalibration"
version = "3.1.0"
description = "Load Distributed Temperature Sensing (DTS) files, calibrate the temperature and estimate its uncertainty."
readme = "README.rst"
license = "BSD-3-Clause"
requires-python = ">=3.9, <3.13"
authors = [
{name = "Bas des Tombe, Bart Schilperoort"},
]
maintainers = [
{name = "Bas des Tombe, Bart Schilperoort"},
]
keywords = [
"DTS",
"distributed temperature sensing",
"calibration",
"confidence intervals",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: Unix",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Utilities",
]
dependencies = [
"numpy",
"xarray[accel]",
"dask[distributed]",
"pandas",
"pyyaml>=6.0.1",
"xmltodict",
"scipy",
"matplotlib",
"netCDF4>=1.6.4",
"nc-time-axis>=1.4.1" # plot dependency of xarray
]
[project.optional-dependencies]
dev = [
"hatch",
"bump2version",
"ruff",
"black[jupyter]", # for formatting
"mypy", # for type checking
"types-PyYAML", # for pyyaml types
"types-xmltodict", # for xmltodict types
"pandas-stubs", # for pandas types
"pytest",
"pytest-cov", # for coverage
"pytest-xdist", # for parallel testing
"jupyter",
"nbformat", # Needed to run the tests
]
docs = [ # Required for ReadTheDocs
"IPython",
"myst_parser",
"matplotlib>=3.0.0",
"sphinx",
"sphinx_rtd_theme",
"sphinx-autoapi",
"sphinx-automodapi",
"sphinx-autosummary-accessors",
"coverage[toml]",
"nbsphinx",
"ipykernel",
'recommonmark',
'sphinx-automodapi',
'pypandoc',
'jupyter_client',
]
[tool.hatch.envs.default]
features = ["dev"]
[tool.hatch.envs.default.scripts]
lint = [
"ruff check src/ tests/ examples/",
"black --check docs/notebooks",
"mypy src/",
]
format = ["ruff check src/ tests/ examples/ --fix", "ruff format src/ tests/ examples/", "black docs/notebooks", "lint",]
test = ["pytest ./src/ ./tests/",]
fast-test = ["pytest ./tests/ -m \"not slow\"",]
coverage = [
"pytest --cov --cov-report term --cov-report xml --cov-branch --junitxml=xunit-result.xml tests/",
]
[tool.hatch.envs.docs]
features = ["docs"]
[tool.hatch.envs.docs.scripts]
build = [
"sphinx-build -E -c docs -b html docs dist/docs", #"python docs/nb_examples_to_docs.py",
]
[tool.hatch.envs.matrix_test]
features = ["dev"]
[[tool.hatch.envs.matrix_test.matrix]]
python = ["3.9", "3.10", "3.11", "3.12"]
[tool.hatch.envs.matrix_test.scripts]
test = ["pytest ./src/ ./tests/",] # --doctest-modules
fast-test = ["pytest ./tests/ -m \"not slow\"",]
[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
[tool.ruff]
select = [ # It would be nice to have the commented out checks working.
"E", # pycodestyle
"F", # pyflakes
# "B", # flake8-bugbear
# "D", # pydocstyle
# "C90", # mccabe complexity
# "N", # PEP8-naming
"UP", # pyupgrade (upgrade syntax to current syntax)
"PLE", # Pylint error https://github.com/charliermarsh/ruff#error-ple
# "PLR", # Pylint refactor (e.g. too-many-arguments)
"PLW", # Pylint warning (useless-else-on-loop)
"I", # isort
"SIM", # flake8-simplify
]
extend-select = [
#"D401", # First line should be in imperative mood
"D400", # First line should end in a period.
"D404", # First word of the docstring should not be "This"
"TID252", # No relative imports (not pep8 compliant)
]
ignore = [
"PLR2004", # magic value used in comparson
"E501", # Line too long (want to have fixed
]
line-length = 88
exclude = ["docs", "build", "tests/data"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Minimum supported Python version
target-version = "py39"
[tool.ruff.per-file-ignores]
"tests/**" = ["D"]
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.mccabe]
max-complexity = 10
[tool.ruff.isort]
known-first-party = ["dtscalibration"]
force-single-line = true
[tool.black]
line-length = 88
target-version = ['py39', 'py310', 'py311']
extend-exclude = ".venv"
[tool.mypy]
ignore_missing_imports = true # Preferably false, but matplotlib, scipy and statsmodels are missing typing stubs
python_version = "3.9"
[tool.coverage.run]
branch = true
source = ["src/dtscalibration"]
command_line = "-m pytest"
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"@overload",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:"
]