-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
178 lines (158 loc) · 4.57 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
[tool.poetry]
name = "climate-data"
version = "0.0.1"
description = "Pipelines to extract, format, and downscale ERA5 and CMIP6 data."
authors = [
"James Collins <[email protected]>",
]
license = "BSD-3-Clause"
readme = "README.md"
documentation = "https://.github.io/climate-data"
homepage = "https://.github.io/climate-data"
repository = "https://github.com//climate-data"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
packages = [
{ include = "climate_data", from = "src" }
]
[tool.poetry.dependencies]
python = ">=3.10, <3.13"
click = "*"
numpy = "^2.1.0"
pandas = "^2.2.2"
rasterra = "^0.6.0"
shapely = "^2.0.4"
geopandas = "^1.0.1"
xarray = "^2024.11.0"
cdsapi = "^0.7.5"
matplotlib = "^3.8.4"
scikit-learn = "^1.4.2"
rra-tools = "^1.0.22"
netcdf4 = "^1.7.2"
pyarrow = "^16.0.0"
gcsfs = "^2024.6.0"
zarr = "^2.18.2"
dask = "^2024.5.2"
lxml = "^5.3.0"
pydantic = "^2.10.4"
[tool.poetry.group.dev.dependencies]
mkdocstrings = {version = "*", extras = ["python"]}
mkdocs-material = "*"
mkdocs-table-reader-plugin = "*"
mkdocs-gen-files = "*"
mypy = "*"
pre-commit = "*"
pymdown-extensions = "*"
pytest = "*"
pytest-github-actions-annotate-failures = "*"
pytest-cov = "*"
python-kacl = "*"
ruff = "*"
pandas-stubs = "*"
types-pyyaml = "*"
types-requests = "*"
types-tqdm = "*"
mkdocs-literate-nav = "*"
mkdocs-section-index = "*"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.scripts]
cdrun = "climate_data.cli:cdrun"
cdtask = "climate_data.cli:cdtask"
[tool.ruff]
target-version = "py310" # The lowest supported version
exclude = [
]
[tool.ruff.lint]
# By default, enable all the lint rules.
# Add to the ignore list below if you don't want some rules.
# If you need some ignores for certain modules, see tool.ruff.lint.per-file-ignores below.
# For individual ignore cases, prefer inline `# noqa`s within the code.
select = ["ALL"]
exclude = [
]
ignore = [
"COM812", # flake8 missing trailing comma, formatter handles
"ISC001", # Implicit string concatenation
"ANN", # Type hints related, let mypy handle these.
"D", # Docstrings related, way too strict to our taste
"RUF007", # zip is idiomatic, this is a dumb check
"RET505", # Else after return, makes a lot of false positives
"E501", # Line too long, this is autoformatted
"PYI041", # Use float instead of int | float; dumb rule
"T201", # print is fine for now.
"RET504", # Unnecessary assignment before return
"PLR0913", # Too many arguments in function call, hard with CLIs.
"TRY201", #
"PD010", # I like stack and unstack
"FBT001", # Boolean positional args are super common in clis
"FBT002", # Boolean positional args are super common in clis
"PD901", # Generic df names are fine
"S311", # Not using random numbers for crypto purposes
"S101", # Use of `assert` detected
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"S101", # "Use of `assert` detected"
"ARG", # "Unused function argument". Fixtures are often unused.
"S105", # "Possible hardcoded password".
]
"scripts/**" = [
"INP001", # "Scripts are not part of a package."
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
"classmethod",
"pydantic.validator",
"pydantic.root_validator",
]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.pytest.ini_options]
addopts = """\
--cov climate_data \
--cov tests \
--cov-report term-missing \
--no-cov-on-fail \
"""
[tool.coverage.report]
fail_under = 1
exclude_lines = [
'if TYPE_CHECKING:',
'pragma: no cover'
]
[tool.mypy]
# This is the global mypy configuration.
# Avoid changing this!
strict = true # See all the enabled flags `mypy --help | grep -A 10 'Strict mode'`
disallow_any_unimported = true
exclude = [
]
# If you need to ignore something for some specific module,
# add overrides for them. Avoid changing the global config!
# For example:
[[tool.mypy.overrides]]
module = [
"cdsapi.*",
"affine.*",
"gcsfs.*",
]
ignore_missing_imports = true
# [[tool.mypy.overrides]]
# module = [
# "tests/my_thing/test_my_thing",
# ]
# disallow_untyped_defs = false