-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
229 lines (208 loc) · 6.93 KB
/
pyproject.toml
File metadata and controls
229 lines (208 loc) · 6.93 KB
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
[tool.poetry]
name = "ssb-sgis"
version = "1.3.10"
description = "GIS functions used at Statistics Norway."
authors = ["Morten Letnes <morten.letnes@ssb.no>"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/statisticsnorway/ssb-sgis"
repository = "https://github.com/statisticsnorway/ssb-sgis"
documentation = "https://statisticsnorway.github.io/ssb-sgis"
packages = [{ include = "sgis", from = "src" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Topic :: Scientific/Engineering :: GIS",
]
[tool.poetry.urls]
Changelog = "https://github.com/statisticsnorway/ssb-sgis/releases"
[tool.poetry.dependencies]
python = ">=3.11,<4"
affine = ">=2.4.0"
branca = ">=0.6.0"
folium = ">=0.14.0"
geopandas = ">=0.14.0"
igraph = ">=0.11.2"
ipython = ">=8.13.2"
jenkspy = ">=0.3.2"
jinja2 = ">=3.1.3"
joblib = ">=1.4.0"
mapclassify = ">=2.5.0"
matplotlib = ">=3.7.0"
networkx = ">=3.0"
numpy = ">=1.26.4"
pandas = ">=2.0.1"
pyarrow = ">=11.0.0"
pyproj = ">=3.6.1"
rasterio = ">=1.3.8"
requests = ">=2.28.2"
rtree = ">=1.0.1"
scikit-learn = ">=1.2.1"
shapely = ">=2.0.1"
typing-extensions = ">=4.11.0"
xyzservices = ">=2023.2.0"
dask = { version = ">=2024.1.1", optional = true }
xarray = { version = ">=2024.3.0", optional = true }
rioxarray = { version = ">=0.15.5", optional = true }
gcsfs = { version = ">=2024.3.1", optional = true }
[tool.poetry.extras]
all = ["pyogrio", "xarray", "rioxarray", "gcsfs", "dask"]
bucket = ["gcsfs"]
xarray = ["xarray", "rioxarray"]
test = ["xarray", "rioxarray", "dask"]
[tool.poetry.group.dev.dependencies]
pygments = ">=2.10.0"
black = { extras = ["jupyter"], version = ">=23.1.0" }
coverage = { extras = ["toml"], version = ">=6.2" }
darglint = ">=1.8.1"
furo = ">=2021.11.12"
mypy = ">=0.930"
pre-commit = ">=2.16.0"
pre-commit-hooks = ">=4.1.0"
ruff = ">=0.0.284"
owslib = ">=0.34.0"
pillow = ">=11.0.0"
pytest = ">=6.2.5"
sphinx = ">=6.2.1"
sphinx-autobuild = ">=2021.3.14"
sphinx-autodoc-typehints = ">=1.24.0"
sphinx-click = ">=3.0.2"
typeguard = ">=2.13.3"
xdoctest = { extras = ["colors"], version = ">=0.15.10" }
myst-parser = { version = ">=0.16.1" }
deptry = ">=0.8.0"
isort = ">=5.13.2"
jupyter = ">=1.0.0"
jupytext = ">=1.16.1"
pytest-cov = ">=5.0.0"
pandas-stubs = ">=2.2.1.240316"
types-requests = ">=2.31.0.20240406"
# bitsandbytes not released for macos for version > 0.42
bitsandbytes = { version = "0.42.0", markers = "sys_platform == 'darwin'" }
[tool.pytest.ini_options]
pythonpath = ["src"]
[tool.coverage.paths]
source = ["src", "*/site-packages"]
tests = ["tests", "*/tests"]
[tool.coverage.run]
branch = true
source = ["sgis", "tests"]
relative_files = true
[tool.coverage.report]
show_missing = true
fail_under = 50
[tool.mypy]
strict = false
warn_unreachable = true
pretty = true
show_column_numbers = true
show_error_context = true
[[tool.mypy.overrides]]
module = [
"affine.*",
"branca.*",
"dapla.*",
"folium.*",
"gcsfs.*",
"geocoder.*",
"geopandas.*",
"igraph.*",
"jenkspy.*",
"joblib.*",
"mapclassify.*",
"networkx.*",
"osmapi.*",
"pyarrow.*",
"rasterio.*",
"shapely.*",
"sklearn.neighbors.*",
"xyzservices.*",
]
ignore_missing_imports = true
[tool.ruff]
force-exclude = true # Apply excludes to pre-commit
show-fixes = true
src = ["src", "tests"]
target-version = "py311" # Minimum Python version supported
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
extend-exclude = [
"__pycache__",
"old",
".ipynb_checkpoints",
"noxfile.py",
"docs/conf.py",
]
# Ruff rules may be customized as desired: https://docs.astral.sh/ruff/rules/
[tool.ruff.lint]
select = [
"A", # prevent using keywords that clobber python builtins
"ANN", # check type annotations
"B", # bugbear: security warnings
"D", # documentation
"E", # pycodestyle
"F", # pyflakes
"ISC", # implicit string concatenation
"UP", # alert you when better syntax is available in your python version
"RUF", # the ruff developer's own rules
]
ignore = [
"ANN002", # Typehint *args
"ANN003", # Typehint **kwargs
"ANN101", # Supress missing-type-self.
"ANN102", # Supress missing-type-cls.
"ANN202", # Don't requiere return type annotation for private functions.
"ANN401", # Allow type annotation with type Any.
"D100", # Supress undocumented-public-module. Only doc of public api required.
"E402", # Supress module-import-not-at-top-of-file, needed in jupyter notebooks.
"E501", # Supress line-too-long warnings: trust black's judgement on this one.
"D104", # Missing docstring in public package
"RUF018", # Avoid assignment expressions in `assert` statements
"RUF005", # Consider `["_cluster", *by]` instead of concatenation
"F841", # Local variable is assigned to but never used
"B019", # Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)`
"B023", # Function definition does not bind loop variable
"ANN001", # TODO temporary. Missing type annotation for function argument ...
"D103", # TODO temporary. Missing docstring in public function
"B018", # Found useless expression
"E712", # Avoid equality comparisons to `True`; use `if x:` for truth checks (because 'is' doesn't work with numpy/pandas)
]
[tool.ruff.lint.isort]
force-single-line = true
[tool.ruff.lint.mccabe]
max-complexity = 15
[tool.ruff.lint.pydocstyle]
convention = "google" # You can also use "numpy".
[tool.ruff.lint.pep8-naming]
classmethod-decorators = ["classmethod", "validator", "root_validator", "pydantic.validator"]
[tool.ruff.lint.per-file-ignores]
"*/__init__.py" = ["F401"]
"**/tests/*" = [
"ANN001", # type annotations don't add value for test functions
"ANN002", # type annotations don't add value for test functions
"ANN003", # type annotations don't add value for test functions
"ANN201", # type annotations don't add value for test functions
"ANN204", # type annotations don't add value for test functions
"ANN205", # type annotations don't add value for test functions
"ANN206", # type annotations don't add value for test functions
"D100", # docstrings are overkill for test functions
"D101",
"D102",
"D103",
"S101", # asserts are encouraged in pytest
]
[tool.jupytext]
formats = "ipynb,auto:percent"
notebook_metadata_filter = "jupytext.text_representation,-jupytext.text_representation.jupytext_version,-widgets,-varInspector,-kernelspec"
cell_metadata_filter = "-all"
[tool.isort]
profile = "black"
force_single_line = true
skip_gitignore = true
# The line below is needed for jupyter notebooks stored as .py in percent format.
# See https://github.com/PyCQA/isort/issues/1338 for details
treat_comments_as_code = ["# %%"]
[tool.deptry.per_rule_ignores]
DEP001 = ["sgis", "nox", "nox_poetry"] # packages available by default
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"