1
1
# SPDX-License-Identifier: MIT
2
2
3
3
[build-system ]
4
- requires = [" hatchling" , " versioningit>=3.3.0" ]
4
+ requires = [" hatchling" , " versioningit>=3.3.0,<4.0 " , " packaging " ]
5
5
build-backend = " hatchling.build"
6
6
7
7
[project ]
@@ -133,6 +133,11 @@ include = [
133
133
]
134
134
artifacts = [" disnake/_version.py" ]
135
135
136
+ [tool .hatch .build .targets .sdist ]
137
+ include = [
138
+ " scripts/versioning.py"
139
+ ]
140
+
136
141
[tool .hatch .version ]
137
142
source = " versioningit"
138
143
@@ -148,9 +153,8 @@ distance = "{base_version}+{distance}.{vcs}{rev}"
148
153
dirty = " {base_version}+d{build_date:%Y%m%d}"
149
154
distance-dirty = " {base_version}.a{distance}+{vcs}{rev}.d{build_date:%Y%m%d}"
150
155
151
- [tool .versioningit .template-fields .version-tuple ]
152
- split-on = ' ^(\d+)\.(\d+)\.(\d+)\.([a-zA-Z])(\d+)(?:.\d+)?'
153
-
156
+ [tool .versioningit .template-fields ]
157
+ method = { module = " scripts.versioning" , value = " template_fields" }
154
158
155
159
[tool .versioningit .write ]
156
160
file = " disnake/_version.py"
@@ -169,11 +173,7 @@ class VersionInfo(NamedTuple):
169
173
releaselevel: Literal["alpha", "beta", "candidate", "final"]
170
174
serial: int
171
175
172
-
173
- # fmt: off
174
- version_info: VersionInfo = VersionInfo(*{version_tuple}[:5])
175
- # fmt: on
176
-
176
+ version_info: VersionInfo = VersionInfo{version_tuple}
177
177
"""
178
178
179
179
[tool .ruff ]
@@ -437,4 +437,3 @@ exclude_lines = [
437
437
" ^\\ s*raise NotImplementedError$" ,
438
438
" ^\\ s*\\ .\\ .\\ .$" ,
439
439
]
440
-
0 commit comments