-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
204 lines (182 loc) · 6.54 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
[project]
name = "GsplatLoc"
description = "Ultra-Precise Camera Localization via 3D Gaussian Splatting"
readme = "README.md"
requires-python = ">=3.10"
license = { file = "LICENSE" }
authors = [{ name = "A.J.Zeller", email = "[email protected]" }]
maintainers = [{ name = "A.J.Zeller", email = "[email protected]" }]
dynamic = ["version"] # https://hatch.pypa.io/latest/config/metadata/#version
[project.urls]
Homepage = "https://github.com/AtticusZeller/GsplatLoc"
Issues = "https://github.com/AtticusZeller/GsplatLoc/issues"
Changelog = "https://github.com/AtticusZeller/GsplatLoc/blob/main/CHANGELOG.md"
[project.optional-dependencies]
# optional deps for package installation
[dependency-groups]
dev = [
"ruff>=0.6.3",
# "mypy>=1.11.2",
"pre-commit>=3.8.0",
"git-cliff>=2.6.1",
"bump-my-version>=0.28.0",
"typos>=1.26.8",
]
docs = [
"pandas>=2.2.3",
"pandas-stubs>=2.2.3.241126",
"panflute>=2.3.1",
]
## Test
[tool.mypy]
strict = true
exclude = ["venv", ".venv"]
## Linter and formatter
[tool.ruff]
# cover and extend the default config in https=//docs.astral.sh/ruff/configuration/
extend-exclude = [""]
target-version = "py310"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG001", # unused arguments in functions
]
ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"W191", # indentation contains tabs
"B904", # Allow raising exceptions without from e, for HTTPException
"COM819", # Trailing comma prohibited
"D100", # Missing docstring in public module(file)
"D104", # Missing docstring in public package
"D203", # 1 blank line required before class docstring
"E201", # Whitespace after '('
"E202", # Whitespace before ')'
"E203", # Whitespace before '='
"E221", # Multiple spaces before operator
"E241", # Multiple spaces after ','
"E251", # Unexpected spaces around keyword / parameter equals
"W291", # Trailing whitespace
"W293", # Blank line contains whitespace
]
isort = { combine-as-imports = true, split-on-trailing-comma = false }
# Avoid trying to fix flake8-bugbear (`B`) violations.
unfixable = ["B"]
[tool.ruff.format]
docstring-code-format = true
skip-magic-trailing-comma = true
# Reference
# 1. https=//github.com/Kludex/python-template/blob/main/template/%7B%7B%20project_slug%20%7D%7D/pyproject.toml.jinja
# 2. https=//github.com/fastapi/full-stack-fastapi-template/blob/master/backend/pyproject.toml
# 3. https=//github.com/pydantic/logfire
# 4. https=//coverage.readthedocs.io/en/latest/index.html
## VCS
[tool.git-cliff.remote.github]
owner = "atticuszz"
repo = "python-uv"
[tool.git-cliff.changelog]
# template for the changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.\n
"""
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{% if version %}\
## {{ version | trim_start_matches(pat="v") }} - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## unreleased
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits| unique(attribute="message") %}
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message | upper_first }}\
{% if commit.remote.pr_number %} in #{{ commit.remote.pr_number }}{%- endif %}\
{% endfor %}
{% endfor %}\n
"""
# template for the changelog footer
footer = """
<!-- generated by git-cliff -->
"""
# remove the leading and trailings
trim = true
# postprocessors
# postprocessors = [
# { pattern = '<REPO>', replace = "https://github.com/AtticusZeller/GsplatLoc" }, # replace repository URL
# ]
# render body even when there are no releases to process
render_always = true
# output file path
output = "CHANGELOG.md"
[tool.git-cliff.git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# If the spelling is incorrect, it will be automatically fixed.
{ pattern = '.*', replace_command = 'typos --write-changes -' }
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
{ message = "^chore\\(release\\)", skip = true },
{ message = "^chore\\(deps.*\\)", skip = true },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(pull\\)", skip = true },
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
]
# filter out the commits that are not matched by commit parsers
filter_commits = false
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
[tool.bumpversion]
current_version = "0.0.40"
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 = false
ignore_missing_files = false
tag = true
sign_tags = false
tag_name = "v{new_version}"
tag_message = "chore(release): {current_version} → {new_version}"
allow_dirty = true # git-cliff first then bump patch
commit = true
message = "chore(release): {current_version} → {new_version}"
commit_args = ""
setup_hooks = []
pre_commit_hooks = []
post_commit_hooks = []
[[tool.bumpversion.files]]
filename = "src/__init__.py"
[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
search = "unreleased"
replace = "{new_version} - {now:%Y-%m-%d}"
# https://callowayproject.github.io/bump-my-version/reference/search-and-replace-config/