1
+ [build-system ]
2
+ requires = [' hatchling' ]
3
+ build-backend = ' hatchling.build'
4
+
5
+ [tool .hatch .version ]
6
+ path = ' s2cloudless/__init__.py'
7
+
8
+ [tool .hatch .build .targets .sdist ]
9
+ include = [' /README.md' , ' /LICENSE.md' , ' /s2cloudless' ]
10
+
11
+ [project ]
12
+ name = " s2cloudless"
13
+ dynamic = [" version" ]
14
+ description = " Sentinel Hub's cloud detector for Sentinel-2 imagery"
15
+ readme = " README.md"
16
+ requires-python = " >= 3.8"
17
+ license = { file = " LICENSE.md" }
18
+ authors = [
19
+ {
name =
" Sinergise EO research team" ,
email =
" [email protected] " },
20
+ ]
21
+ classifiers = [
22
+ " Development Status :: 5 - Production/Stable" ,
23
+ " Intended Audience :: Education" ,
24
+ " Intended Audience :: Science/Research" ,
25
+ " Operating System :: MacOS" ,
26
+ " Operating System :: Microsoft :: Windows" ,
27
+ " Operating System :: Unix" ,
28
+ " Programming Language :: Python" ,
29
+ " Programming Language :: Python :: 3" ,
30
+ " Programming Language :: Python :: 3.8" ,
31
+ " Programming Language :: Python :: 3.9" ,
32
+ " Programming Language :: Python :: 3.10" ,
33
+ " Programming Language :: Python :: 3.11" ,
34
+ " Topic :: Scientific/Engineering" ,
35
+ ]
36
+ dependencies = [
37
+ " lightgbm>=2.0.11" ,
38
+ " numpy>=1.13.3" ,
39
+ " opencv-python-headless" ,
40
+ " sentinelhub>=3.9.0" ,
41
+ " typing_extensions" ,
42
+ ]
43
+
44
+ [project .optional-dependencies ]
45
+ dev = [
46
+ " build" ,
47
+ " mypy" ,
48
+ " pre-commit" ,
49
+ " pylint>=2.14.0" ,
50
+ " pytest>=3.0.0" ,
51
+ " pytest-cov" ,
52
+ " twine" ,
53
+ ]
54
+
55
+ [project .urls ]
56
+ Homepage = " https://github.com/sentinel-hub/sentinel2-cloud-detector"
57
+ Issues = " https://github.com/sentinel-hub/sentinel2-cloud-detector/issues"
58
+ Source = " https://github.com/sentinel-hub/sentinel2-cloud-detector"
59
+ Forum = " https://forum.sentinel-hub.com"
60
+
1
61
[tool .black ]
2
62
line-length = 120
3
63
preview = true
4
64
5
- [tool .isort ]
6
- profile = " black"
7
- known_first_party = " sentinelhub"
8
- known_absolute = " s2cloudless"
9
- sections = [" FUTURE" ," STDLIB" ," THIRDPARTY" ," FIRSTPARTY" ," ABSOLUTE" ," LOCALFOLDER" ]
10
- line_length = 120
65
+ [tool .ruff ]
66
+ line-length = 120
67
+ target-version = " py38"
68
+ select = [
69
+ " F" , # pyflakes
70
+ " E" , # pycodestyle
71
+ " W" , # pycodestyle
72
+ " C90" , # mccabe
73
+ " N" , # naming
74
+ " YTT" , # flake-2020
75
+ " B" , # bugbear
76
+ " A" , # built-ins
77
+ " COM" , # commas
78
+ " C4" , # comprehensions
79
+ " T10" , # debugger statements
80
+ " ISC" , # implicit string concatenation
81
+ " ICN" , # import conventions
82
+ " G" , # logging format
83
+ " PIE" , # flake8-pie
84
+ " T20" , # print statements
85
+ " PT" , # pytest style
86
+ " RET" , # returns
87
+ " SLF" , # private member access
88
+ " SIM" , # simplifications
89
+ " ARG" , # unused arguments
90
+ " PD" , # pandas
91
+ " PGH" , # pygrep hooks (useless noqa comments, eval statements etc.)
92
+ " FLY" , # flynt
93
+ " RUF" , # ruff rules
94
+ " NPY" , # numpy
95
+ " I" , # isort
96
+ " UP" , # pyupgrade
97
+ " FA" , # checks where future import of annotations would make types nicer
98
+ ]
99
+ fix = true
100
+ fixable = [
101
+ " I" , # sort imports
102
+ " F401" , # remove redundant imports
103
+ " UP007" , # use new-style union type annotations
104
+ " UP006" , # use new-style built-in type annotations
105
+ " UP037" , # remove quotes around types when not necessary
106
+ " FA100" , # import future annotations where necessary (not autofixable ATM)
107
+ ]
108
+ ignore = [
109
+ " SIM108" , # tries to aggresively inline `if`, not always readable
110
+ " COM812" , # trailing comma missing, fights with black
111
+ " PD011" , # suggests `.to_numpy` instead of `.values`, also does this for non-pandas objects...
112
+ # potentially fixable
113
+ " PT011" , # complains for `pytest.raises(ValueError)` but we use it a lot
114
+ " N803" , # clashes with the default naming of model protocols
115
+ ]
116
+ per-file-ignores = { "__init__.py" = [" F401" ] }
117
+ exclude = [" .git" , " __pycache__" , " build" , " dist" ]
11
118
12
- [tool .nbqa .addopts ]
13
- flake8 = [
14
- " --extend-ignore=E402"
119
+
120
+ [tool .ruff .isort ]
121
+ section-order = [
122
+ " future" ,
123
+ " standard-library" ,
124
+ " third-party" ,
125
+ " our-packages" ,
126
+ " first-party" ,
127
+ " local-folder" ,
15
128
]
129
+ known-first-party = [" s2cloudless" ]
130
+ sections = { our-packages = [" sentinelhub" ] }
131
+
132
+ [tool .nbqa .addopts ]
133
+ ruff = [" --extend-ignore=E402,T201,B015,B018,NPY002,UP,FA" ]
134
+ # E402 -> imports on top
135
+ # T201 -> print found
136
+ # B015 & B018 -> useless expression (used to show values in ipynb)
137
+ # NPY002 -> use RNG instead of old numpy.random
138
+ # UP -> suggestions for new-style classes (future import might confuse readers)
139
+ # FA -> necessary future annotations import
16
140
17
141
[tool .pylint .format ]
18
142
max-line-length = 120
@@ -25,27 +149,21 @@ disable = [
25
149
" unsubscriptable-object" ,
26
150
" invalid-unary-operand-type" ,
27
151
" unspecified-encoding" ,
28
- " unnecessary-ellipsis"
152
+ " unnecessary-ellipsis" ,
29
153
]
30
154
31
155
[tool .pylint .design ]
32
156
max-args = 10
33
157
max-attributes = 20
34
158
35
159
[tool .pytest .ini_options ]
36
- markers = [
37
- " sh_integration: marks integration tests with Sentinel Hub service"
38
- ]
160
+ markers = [" sh_integration: marks integration tests with Sentinel Hub service" ]
39
161
40
162
[tool .coverage .run ]
41
- source = [
42
- " s2cloudless"
43
- ]
163
+ source = [" s2cloudless" ]
44
164
45
165
[tool .coverage .report ]
46
- omit = [
47
- " models/*"
48
- ]
166
+ omit = [" models/*" ]
49
167
50
168
[tool .mypy ]
51
169
follow_imports = " normal"
0 commit comments