-
Notifications
You must be signed in to change notification settings - Fork 249
/
pyproject.toml
243 lines (223 loc) · 6.58 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
[build-system]
requires = ['hatchling']
build-backend = 'hatchling.build'
[tool.hatch.version]
path = 'sentinelhub/_version.py'
[tool.hatch.build.targets.sdist]
include = ['/README.md', '/LICENSE.md', '/sentinelhub']
[project]
name = "sentinelhub"
dynamic = ["version"]
description = "Python API for Sentinel Hub"
readme = "README.md"
requires-python = ">= 3.8"
license = { file = "LICENSE.md" }
authors = [
{ name = "Sinergise EO research team", email = "[email protected]" },
]
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 :: Software Development",
]
dependencies = [
"aenum>=2.1.4",
"click",
"dataclasses-json",
"numpy",
"oauthlib",
"pillow>=9.2.0",
"pyproj>=2.2.0",
"python-dateutil",
"requests>=2.27.0",
"requests-oauthlib>=1.0.0",
"shapely",
"tifffile>=2020.9.30",
"tomli",
"tomli_w",
"tqdm",
"typing-extensions>=4.5.0",
"utm",
]
[project.optional-dependencies]
docs = [
"docutils",
"ipython",
"matplotlib",
"nbsphinx",
"sphinx==7.1.2",
"sphinx_mdinclude==0.5.4", # version fixed because 0.6.0 didnt work at release time of 3.10.2
"sphinx_rtd_theme==1.3.0",
]
dev = [
"boto3-stubs>=1.20.0",
"build",
"click>=8.0.0",
"fs",
"mypy>=0.990",
"moto[s3]>=5.0.0",
"pandas",
"pre-commit",
"pylint>=2.14.0",
"pytest>=4.0.0",
"pytest-cov",
"pytest-dependency",
"pytest-mock",
"ray[default]",
"requests-mock",
"twine",
"types-python-dateutil",
"types-requests",
"types-urllib3",
]
aws = ["boto3", "botocore"]
[project.urls]
Homepage = "https://github.com/sentinel-hub/sentinelhub-py"
Documentation = "https://sentinelhub-py.readthedocs.io"
Issues = "https://github.com/sentinel-hub/sentinelhub-py/issues"
Source = "https://github.com/sentinel-hub/sentinelhub-py"
Forum = "https://forum.sentinel-hub.com"
[project.scripts]
"sentinelhub" = "sentinelhub.commands:main_help"
"sentinelhub.aws" = "sentinelhub.aws.commands:aws"
"sentinelhub.config" = "sentinelhub.commands:config"
"sentinelhub.download" = "sentinelhub.commands:download"
[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 = [
"G004", # f-strings in logging
"C408", # complains about `dict()` calls, we use them to avoid too many " in the code
"SIM108", # tries to aggresively inline `if`, not always readable
"COM812", # trailing comma missing, fights with black
"PD011", # suggests `.to_numpy` instead of `.values`, also does this for non-pandas objects...
# # potentially fixable
"N818", # we use the 'Exception' suffix but PEP suggests 'Error'
"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"], "conf.py" = ["FA100"] }
exclude = [".git", "__pycache__", "build", "dist", "sentinelhub/aws/*"]
[tool.ruff.lint.isort]
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
"notebook-utilities",
]
known-first-party = ["sentinelhub"]
sections = { notebook-utilities = ["utils"] }
[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",
"R0801",
]
[tool.pylint.design]
max-args = 10
max-attributes = 21
max-locals = 20
min-public-methods = 0
[tool.pylint.similarities]
min-similarity-lines = 5
[tool.pylint.classes]
valid-metaclass-classmethod-first-arg = "mcs"
[tool.pytest.ini_options]
markers = [
"aws_integration: marks AWS integration tests.",
"geopedia_integration: marks Geopedia integration tests.",
"sh_integration: marks Sentinel Hub integration tests.",
]
[tool.coverage.run]
source = ["sentinelhub"]
[tool.coverage.report]
omit = [".utmzones.geojson"]
[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
[tool.nbqa.addopts]
ruff = ["--extend-ignore=E402,T201,B015,B018,NPY002,UP,FA"]
# 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