-
Notifications
You must be signed in to change notification settings - Fork 299
/
pyproject.toml
263 lines (237 loc) · 6.99 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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
[build-system]
requires = ['hatchling']
build-backend = 'hatchling.build'
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.version]
path = 'eolearn/__init__.py'
[tool.hatch.build.targets.sdist]
include = ['/README.md', '/LICENSE.md', '/eolearn']
[tool.hatch.build.targets.wheel]
include = ['/eolearn']
[project]
name = "eo-learn"
dynamic = ["version"]
description = "Earth observation processing framework for machine learning in Python"
readme = "README.md"
requires-python = ">= 3.8"
license = { file = "LICENSE" }
authors = [
{ name = "Sinergise EO research team", email = "eoresearch@sinergise.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: GIS",
"Topic :: Scientific/Engineering :: Image Processing",
]
dependencies = [
"boto3",
"fs",
"fs-s3fs",
"geopandas>=0.14.4,<1; python_version>='3.9'",
"geopandas>=0.11.0,<1; python_version<'3.9'",
"numpy>=1.20.0",
"python-dateutil",
"sentinelhub>=3.9.0",
"tqdm>=4.27",
"typing-extensions>=4.5.0",
"opencv-python-headless",
"affine",
"rasterio>=1.3.8",
"shapely",
"fiona>=1.8.18; python_version>='3.9'",
"fiona>=1.8.18,<1.10; python_version<'3.9'",
]
[project.optional-dependencies]
full = ["eo-learn[RAY,ZARR,EXTRA,VISUALIZATION]"]
ray = ["ray[default]"]
zarr = ["s3fs", "zarr"]
extra = ["numba>=0.53.0", "scikit-learn", "scipy", "s2cloudless"]
visualization = ["graphviz>=0.10.1", "jinja2", "matplotlib", "pygments"]
docs = [
"eo-learn[FULL]",
"jupyter",
"nbsphinx",
"sphinx==7.1.2",
"sphinx_mdinclude==0.5.4", #0.6 didn't work last time
"sphinx_rtd_theme==1.3.0",
]
dev = [
"build",
"eo-learn[FULL]",
"hypothesis",
"moto[s3]>=5.0.0",
"mypy>=0.990",
"pylint>=2.14.0",
"pytest>=7.0.0",
"pytest-cov",
"pytest-mock",
"twine",
"types-python-dateutil",
]
[project.urls]
Homepage = "https://github.com/sentinel-hub/eo-learn"
Documentation = "https://eo-learn.readthedocs.io"
Issues = "https://github.com/sentinel-hub/eo-learn/issues"
Source = "https://github.com/sentinel-hub/eo-learn"
Forum = "https://forum.sentinel-hub.com"
[tool.black]
line-length = 120
preview = true
[tool.ruff]
line-length = 120
target-version = "py38"
lint.select = [
"F", # pyflakes
"E", # pycodestyle
"W", # pycodestyle
"C90", # mccabe
"I", # isort
"N", # naming
"UP", # pyupgrade
"YTT", # flake-2020
"B", # bugbear
"A", # built-ins
"COM", # commas
"C4", # comprehensions
"T10", # debugger statements
"FA", # checks where future import of annotations would make types nicer
"ISC", # implicit string concatenation
"ICN", # import conventions
"G", # logging format
"PIE", # flake8-pie
"T20", # print statements
"PT", # pytest style
"RET", # returns
"SLF", # private member access
"SIM", # simplifications
"ARG", # unused arguments
"PD", # pandas
"PGH", # pygrep hooks (useless noqa comments, eval statements etc.)
"FLY", # flynt
"NPY", # numpy
"PERF", # perflint, performance improvements
"RUF", # ruff rules
]
fix = true
lint.fixable = [
"I", # sort imports
"F401", # remove redundant imports
"UP007", # use new-style union type annotations
"UP006", # use new-style built-in type annotations
"UP037", # remove quotes around types when not necessary
"FA100", # import future annotations where necessary (not autofixable ATM)
]
lint.ignore = [
"C408", # complains about `dict()` calls, we use them to avoid too many " in the code
"SIM108", # tries to aggresively inline `if`, not always readable
"A003", # complains when ATTRIBUTES shadow builtins, we have objects that implement `filter` and such
"COM812", # trailing comma missing, fights with black
"PD011", # suggests `.to_numpy` instead of `.values`, also does this for non-pandas objects...
# potentially fixable
"B904", # want `raise ... from None` instead of just `raise ...`
"B028", # always demands a stacklevel argument when warning
"PT011", # complains for `pytest.raises(ValueError)` but we use it a lot
]
lint.per-file-ignores = { "__init__.py" = [
"F401",
"I002",
], "conf.py" = [
"I002",
"FA100",
] }
exclude = [".git", "__pycache__", "build", "dist", "*.ipynb"]
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
section-order = [
"future",
"standard-library",
"third-party",
"our-packages",
"first-party",
"local-folder",
]
known-first-party = ["eolearn"]
sections = { our-packages = ["sentinelhub"] }
[tool.pylint.format]
max-line-length = 120
[tool.pylint.messages_control]
disable = [
"no-member",
"arguments-differ",
"assignment-from-no-return",
"unsubscriptable-object",
"invalid-unary-operand-type",
"unspecified-encoding",
"unnecessary-ellipsis",
"use-dict-literal",
"cyclic-import",
]
[tool.pylint.design]
max-args = 15
max-branches = 15
max-attributes = 20
max-locals = 21
min-public-methods = 0
[tool.pylint.similarities]
min-similarity-lines = 5
[tool.pylint.classes]
valid-metaclass-classmethod-first-arg = "mcs"
[tool.pylint.exceptions]
overgeneral-exceptions = "builtins.Exception"
[tool.pylint.refactoring]
max-nested-blocks = 7
[tool.pytest.ini_options]
markers = [
"sh_integration: marks integration tests with Sentinel Hub service",
"geopedia: marks integration tests with Geopedia",
]
[tool.coverage.run]
source = [
"core",
"coregistration",
"features",
"geometry",
"io",
"mask",
"ml_tools",
"visualization",
]
[tool.coverage.report]
omit = ["*/setup.py", "*/tests/*", "*/__init__.py"]
[tool.nbqa.addopts]
ruff = ["--extend-ignore=E402,T201,B015,B018,NPY002,UP,FA,I002"]
# E402 -> imports on top
# T201 -> print found
# B015 & B018 -> useless expression (used to show values in ipynb)
# NPY002 -> use RNG instead of old numpy.random
# UP -> suggestions for new-style classes (future import might confuse readers)
# FA -> necessary future annotations import
# I002 -> auto-inserts future annotations
[tool.mypy]
follow_imports = "normal"
ignore_missing_imports = true
show_column_numbers = true
show_error_codes = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_untyped_defs = true
disallow_untyped_decorators = true
warn_unreachable = true
strict_equality = true
pretty = true