forked from sentinel-hub/sentinel2-cloud-detector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
180 lines (163 loc) · 4.81 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
[build-system]
requires = ['hatchling']
build-backend = 'hatchling.build'
[tool.hatch.version]
path = 's2cloudless/__init__.py'
[tool.hatch.build.targets.sdist]
include = ['/README.md', '/LICENSE.md', '/s2cloudless']
[project]
name = "s2cloudless"
dynamic = ["version"]
description = "Sentinel Hub's cloud detector for Sentinel-2 imagery"
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 :: Education",
"Intended Audience :: Science/Research",
"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",
]
dependencies = [
"lightgbm>=2.0.11",
"numpy>=1.13.3",
"opencv-python-headless",
"sentinelhub>=3.9.0",
"typing_extensions",
]
[project.optional-dependencies]
dev = [
"build",
"mypy",
"pre-commit",
"pylint>=2.14.0",
"pytest>=3.0.0",
"pytest-cov",
"twine",
]
[project.urls]
Homepage = "https://github.com/sentinel-hub/sentinel2-cloud-detector"
Issues = "https://github.com/sentinel-hub/sentinel2-cloud-detector/issues"
Source = "https://github.com/sentinel-hub/sentinel2-cloud-detector"
Forum = "https://forum.sentinel-hub.com"
[tool.black]
line-length = 120
preview = true
[tool.ruff]
line-length = 120
target-version = "py38"
select = [
"F", # pyflakes
"E", # pycodestyle
"W", # pycodestyle
"C90", # mccabe
"N", # naming
"YTT", # flake-2020
"B", # bugbear
"A", # built-ins
"COM", # commas
"C4", # comprehensions
"T10", # debugger statements
"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
"RUF", # ruff rules
"NPY", # numpy
"I", # isort
"UP", # pyupgrade
"FA", # checks where future import of annotations would make types nicer
]
fix = true
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)
]
ignore = [
"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
"PT011", # complains for `pytest.raises(ValueError)` but we use it a lot
"N803", # clashes with the default naming of model protocols
]
per-file-ignores = { "__init__.py" = ["F401"] }
exclude = [".git", "__pycache__", "build", "dist"]
[tool.ruff.isort]
section-order = [
"future",
"standard-library",
"third-party",
"our-packages",
"first-party",
"local-folder",
]
known-first-party = ["s2cloudless"]
sections = { our-packages = ["sentinelhub"] }
[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
[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",
]
[tool.pylint.design]
max-args = 10
max-attributes = 20
[tool.pytest.ini_options]
markers = ["sh_integration: marks integration tests with Sentinel Hub service"]
[tool.coverage.run]
source = ["s2cloudless"]
[tool.coverage.report]
omit = ["models/*"]
[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