-
Notifications
You must be signed in to change notification settings - Fork 9
/
pyproject.toml
142 lines (121 loc) · 3.39 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
[tool.black]
target-version = ["py310"]
[tool.vulture]
paths = ["qgreenland", "scripts"]
min_confidence = 80
[tool.ruff]
target-version = "py310"
select = [
"F",
"E",
"W",
"C4",
"C90",
"I",
"N",
"D",
"UP",
"YTT",
"B",
"A",
"C4",
"T10",
"RUF",
]
ignore = [
# D1: Ignore errors requiring docstrings on everything.
# D203: "1 blank line required before class docstring"
# D213: "Multi-line docstring summary should start at the second line"
# E731: Lambda assignments are OK, use your best judgement.
# RUF010: !a, !r, !s are too magical for me.
"D1", "D203", "D213", "E731", "RUF010",
# Rules ignored on switch to `ruff`
# TODO: re-enable and fix these!
# A0: All rules related to names shadowing python built-ins
# B904: Within an `except` clause, raise exceptions with `raise ... from err`
# or `raise ... from None` to distinguish them from errors in exception
# handling.
# B905: `zip()` without an explicit `strict=` parameter
# N806: Variable name should be lowercase
# RUF001: String contains ambiguous unicode character `’`
# UP007: Use `X | Y` for type annotations
"A0", "B904", "B905", "N806", "RUF001", "UP007",
]
exclude = [
"vulture_allowlist.py",
# TODO: Remove tasks/docs excludes:
"tasks/*",
"doc/*",
]
[tool.ruff.per-file-ignores]
# E402: Module level import not at top of file
# E501: Line too long. Long strings, e.g. URLs, are common in config.
# F821: Undefined name. Expected in some templates and scripts.
# N802: Invalid function name. Expected in codemods.
"scripts/codemod/**/*.py" = ["N802"]
"scripts/codemod/test/*.py" = ["E501"]
"scripts/qgis_examples/*.py" = ["F821"]
"tasks/test.py" = ["E402"]
"qgreenland/ancillary/templates/layer_cfg.py" = ["F821"]
"qgreenland/config/datasets/**/*.py" = ["E501"]
"qgreenland/config/datasets/*.py" = ["E501"]
"qgreenland/config/layers/**/*.py" = ["E501"]
"qgreenland/config/helpers/**/*.py" = ["E501"]
[tool.ruff.isort]
known-first-party = ["qgreenland"]
known-third-party = ["luigi"]
[tool.ruff.mccabe]
max-complexity = 8
[tool.ruff.flake8-quotes]
inline-quotes = "double"
[tool.bumpversion]
current_version = "3.0.0"
commit = false
tag = false
parse = """
(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)
(?:
(?P<prerelease>alpha|beta|rc)
(?P<build>\\d+)
)?
$
"""
serialize = [
"{major}.{minor}.{patch}{prerelease}{build}",
"{major}.{minor}.{patch}",
]
[tool.bumpversion.parts.prerelease]
optional_value = "final"
values = [
"final",
"alpha",
"beta",
"rc",
"final",
]
[tool.bumpversion.parts.build]
first_value = "1"
[[tool.bumpversion.files]]
filename = "qgreenland/__init__.py"
search = '__version__ = "v{current_version}"'
replace = '__version__ = "v{new_version}"'
[[tool.bumpversion.files]]
filename = "doc/conf.py"
search = 'release = "v{current_version}"'
replace = 'release = "v{new_version}"'
[[tool.bumpversion.files]]
filename = "VERSION.env"
search = 'export QGREENLAND_VERSION="v{current_version}"'
replace = 'export QGREENLAND_VERSION="v{new_version}"'
[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
search = "NEXT_VERSION"
replace = "v{new_version} ({now:%Y-%m-%d})"
[[tool.bumpversion.files]]
filename = "CITATION.cff"
search = 'version: "{current_version}"'
replace = 'version: "{new_version}"'
[[tool.bumpversion.files]]
filename = "CITATION.cff"
search = 'date-released: "\d{{4}}-\d{{2}}-\d{{2}}"'
replace = 'date-released: "{now:%Y-%m-%d}"'