-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
187 lines (166 loc) · 4.73 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
[build-system]
requires = ["hatchling>=1.8.0", "hatch-vcs", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "PyStemmusScope/__init__.py"
[tool.hatch.build.targets.sdist]
exclude = [
"/.github", "/.mypy_cache", "/.pytest_cache", "/.githooks",
"sonar-project.properties", "tests",
]
[tool.hatch.build.targets.wheel]
packages = ["PyStemmusScope"]
[tool.hatch.publish.index]
disable = true # Requires confirmation when publishing to pypi.
[project]
name = "PyStemmusScope"
description = "Python modules for running the STEMMUS-SCOPE model."
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.9, <3.12"
authors = [
{email = "[email protected]"},
{name = "Sarah Alidoost, Bart Schilperoort, Yang Liu"}
]
maintainers = [
{name = "Sarah Alidoost", email= "[email protected]"},
{name = "Yang Liu", email = "[email protected]"},
{name = "Bart Schilperoort", email = "[email protected]"},
]
keywords = [
"STEMMUS-SCOPE",
"py",
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"h5py",
"hdf5storage",
"netcdf4==1.6.4", # 1.7.1 conflicts with h5py github.com/Unidata/netcdf4-python/issues/1343
"numpy<2", # hdf5storage does not support numpy 2 (yet)
"pandas<2",
"xarray",
"rioxarray", # required for interacting with .tiff files
"scipy", # required for xarray's interpolate
"dask", # required for xarray.open_mfdataset lazy loading
"bmipy",
"matplotlib",
]
dynamic = ["version"]
[project.optional-dependencies]
docker = [
"docker",
]
dev = [
"bump2version",
"hatch",
"ruff",
"black==23.12.1", # pin until switching to ruff formatter
"isort",
"mypy",
"pytest",
"pytest-cov",
"types-requests", # type stubs
]
docs = [
"mkdocs",
"mkdocs-material",
"mkdocs-jupyter",
"mkdocstrings[python]",
"mkdocs-gen-files",
]
[tool.hatch.envs.default]
features = ["dev", "docker"]
installer = "uv"
[tool.hatch.envs.default.scripts]
lint = [
"ruff check .",
"mypy .",
"isort --check-only --diff .",
"black --check --diff .",
]
format = ["isort .", "black .", "lint",]
test = ["pytest ./PyStemmusScope/ ./tests/ --doctest-modules",]
coverage = [
"pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml tests/",
]
[tool.hatch.envs.docs]
features = ["docs"]
[tool.hatch.envs.docs.scripts]
build = ["mkdocs build"]
serve = ["mkdocs serve"]
[tool.pytest.ini_options]
testpaths = ["tests"]
[tool.mypy]
ignore_missing_imports = true
python_version = "3.9"
[tool.black]
line-length = 88
target-version = ['py39', 'py310', 'py311']
include = '\.pyi?$'
[tool.ruff]
select = [
"E", # pycodestyle
"F", # pyflakes
"B", # flake8-bugbear
"D", # pydocstyle
"C90", # mccabe complexity
"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)
"PTH", # Enforce use of Pathlib
]
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 (PEP8 recommendation).
]
ignore = [
"E501", # Line length: fails on many docstrings (needs fixing).
"PLR2004", # magic value used in comparsion (i.e. `if ndays == 28: month_is_feb`).
"B009", # getattr is useful to not mess with typing.
]
line-length = 88
exclude = ["docs", "build", "global_data/data_analysis_notebooks"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
target-version = "py39"
[tool.ruff.per-file-ignores]
"tests/**" = ["D"]
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.mccabe]
max-complexity = 10
[tool.isort]
py_version=39
skip = [".gitignore", ".dockerignore"]
skip_glob = ["docs/*"]
force_single_line = true
lines_after_imports = 2
no_lines_before = ["FUTURE","STDLIB","THIRDPARTY","FIRSTPARTY","LOCALFOLDER"]
known_first_party = ["lilio"]
src_paths = ["lilio", "tests"]
line_length = 120
[tool.coverage.run]
branch = true
source = ["PyStemmusScope"]
command_line = "-m pytest"
[tool.coverage.report]
exclude_also = [
"pragma: no cover",
"@overload",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:"
]