forked from crim-ca/dlm-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
328 lines (284 loc) · 7.87 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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# Poetry pyproject.toml: https://python-poetry.org/docs/pyproject/
[build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "stac-model"
version = "0.2.0"
description = "A PydanticV2 validation and serialization libary for the STAC ML Model Extension"
readme = "README_STAC_MODEL.md"
authors = [
"Ryan Avery <ryan@wherobots.com>",
"Francis Charette-Migneault <francis.charette-migneault@crim.ca>"
]
license = "Apache Software License 2.0"
repository = "https://github.com/crim-ca/mlm-extension"
homepage = "https://github.com/crim-ca/mlm-extension/blob/main/README_STAC_MODEL.md"
packages = [
{include = "stac_model"}
]
# Keywords description https://python-poetry.org/docs/pyproject/#keywords
keywords = [] # UPDATEME with relevant keywords
# Pypi classifiers: https://pypi.org/classifiers/
classifiers = [
"Development Status :: 4 - Beta",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Framework :: Pydantic",
"Framework :: Pydantic :: 2",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Topic :: File Formats :: JSON :: JSON Schema",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: GIS",
"Topic :: Scientific/Engineering :: Image Processing",
"Topic :: Scientific/Engineering :: Image Recognition",
]
[tool.poetry.scripts]
# Entry points for the package https://python-poetry.org/docs/pyproject/#scripts
"stac-model" = "stac_model.__main__:app"
[tool.poetry.dependencies]
python = "^3.10"
typer = {extras = ["all"], version = "^0.9.0"}
rich = "^13.7.0"
pydantic = "^2.6.3" # bug in post 2.3 https://github.com/pydantic/pydantic/issues/7720
pydantic-core = "^2"
pystac = "^1.9.0"
shapely = "^2"
jsonschema = "^4.21.1"
[tool.poetry.group.dev.dependencies]
mypy = "^1.0.0"
mypy-extensions = "^0.4.3"
pre-commit = "^2.21.0"
bandit = "^1.7.5"
safety = "^2.3.4"
pystac = "^1.10.0" # custom validator required (https://github.com/stac-utils/pystac/pull/1320)
pydocstyle = {extras = ["toml"], version = "^6.2.0"}
pydoclint = "^0.3.0"
pytest = "^7.2.1"
pytest-cov = "^4.1.0"
pytest-mock = "^3.10.0"
pytest-timeout = "^2.2.0"
pytest-benchmark = "^4.0.0"
pytest-sugar = "^0.9.7"
pytest-click = "^1.1.0"
pytest-pikachu = "^1.0.0"
coverage = "^7.3.0"
ruff = "^0.2.2"
bump-my-version = "^0.21"
[tool.bumpversion]
# NOTE:
# Although these definitions are provided in this 'stac-model' project file,
# they are actually intented for versioning the MLM specification itself.
# To version 'stac-model', use the 'poetry version' operations.
# See also https://github.com/crim-ca/mlm-extension/blob/main/CONTRIBUTING.md#building-and-releasing
current_version = "1.3.0"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = true
ignore_missing_files = false
tag = true
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true
commit_args = "--no-verify"
message = "Bump version: {current_version} → {new_version}"
[[tool.bumpversion.files]]
glob = "**/*.json"
glob_exclude = [
".git/**",
"**/__pycache__/**",
".mypy_cache/**",
".tox/**",
".venv/**",
"_build/**",
"build/**",
"dist/**",
"node_modules/**",
]
search = "https://crim-ca.github.io/mlm-extension/v{current_version}/schema.json"
replace = "https://crim-ca.github.io/mlm-extension/v{new_version}/schema.json"
[[tool.bumpversion.files]]
glob = "**/*.md"
glob_exclude = [
".git/**",
"**/__pycache__/**",
".mypy_cache/**",
".tox/**",
".venv/**",
"_build/**",
"build/**",
"dist/**",
"node_modules/**",
]
search = "https://crim-ca.github.io/mlm-extension/v{current_version}/schema.json"
replace = "https://crim-ca.github.io/mlm-extension/v{new_version}/schema.json"
[[tool.bumpversion.files]]
glob = "**/*.py"
glob_exclude = [
".git/**",
"**/__pycache__/**",
".mypy_cache/**",
".tox/**",
".venv/**",
"_build/**",
"build/**",
"dist/**",
"node_modules/**",
]
search = "https://crim-ca.github.io/mlm-extension/v{current_version}/schema.json"
replace = "https://crim-ca.github.io/mlm-extension/v{new_version}/schema.json"
[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
search = """
## [Unreleased](https://github.com/crim-ca/mlm-extension/tree/main)
"""
replace = """
## [Unreleased](https://github.com/crim-ca/mlm-extension/tree/main)
### Added
- n/a
### Changed
- n/a
### Deprecated
- n/a
### Removed
- n/a
### Fixed
- n/a
## [v{new_version}](https://github.com/crim-ca/mlm-extension/tree/v{new_version})
"""
[tool.ruff]
exclude = [
".git",
"__pycache__",
".mypy_cache",
".tox",
".venv",
"_build",
"buck-out",
"build",
"dist",
"env",
"venv",
"node_modules",
]
respect-gitignore = true
line-length = 120
show-fixes = true
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
]
[tool.ruff.lint.isort]
known-local-folder = ["tests", "conftest"]
known-first-party = ["stac_model"]
extra-standard-library = ["typing_extensions"]
[tool.mypy]
# https://github.com/python/mypy
# https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
python_version = "3.10"
pretty = true
show_traceback = true
color_output = true
allow_redefinition = false
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
ignore_missing_imports = true
implicit_reexport = false
no_implicit_optional = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
strict_equality = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
plugins = [
"pydantic.mypy"
]
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
[tool.pydocstyle]
# https://github.com/PyCQA/pydocstyle
# http://www.pydocstyle.org/en/stable/usage.html#available-options
convention = "google"
match_dir = "^(stac_model|tests)"
# ignore missing documentation, just validate provided ones
add_ignore = "D100,D101,D102,D103,D104,D105,D107,D200,D202,D204,D212,D401"
[tool.pydoclint]
# https://github.com/jsh9/pydoclint
# https://jsh9.github.io/pydoclint/how_to_config.html
style = "google"
exclude = '\.git|\.hg|\.mypy_cache|\.tox|.?v?env|__pycache__|_build|buck-out|dist|node_modules'
# don't require type hints, since we have them in the signature instead (don't duplicate)
arg-type-hints-in-docstring = false
arg-type-hints-in-signature = true
check-return-types = false
[tool.pytest.ini_options]
# https://github.com/pytest-dev/pytest
# https://docs.pytest.org/en/6.2.x/customize.html#pyproject-toml
# Directories that are not visited by pytest collector:
norecursedirs =[
"hooks",
"*.egg",
".eggs",
"dist",
"build",
"docs",
".tox",
".git",
"__pycache__",
"node_modules",
]
doctest_optionflags = ["NUMBER", "NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]
timeout = 1000
# Extra options:
addopts = [
"--strict-markers",
"--tb=short",
"--doctest-modules",
"--doctest-continue-on-failure",
"--pikachu"
]
[tool.coverage.run]
source = ["tests"]
branch = true
[tool.coverage.report]
exclude_also = [
"def main",
"if __name__ == .__main__.:"
]
fail_under = 50
show_missing = true
[tool.coverage.paths]
source = ["stac_model"]