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 ]
@@ -126,6 +126,11 @@ include = [
126
126
]
127
127
artifacts = [" disnake/_version.py" ]
128
128
129
+ [tool .hatch .build .targets .sdist ]
130
+ include = [
131
+ " scripts/versioning.py"
132
+ ]
133
+
129
134
[tool .hatch .version ]
130
135
source = " versioningit"
131
136
@@ -141,9 +146,8 @@ distance = "{base_version}+{distance}.{vcs}{rev}"
141
146
dirty = " {base_version}+d{build_date:%Y%m%d}"
142
147
distance-dirty = " {base_version}.a{distance}+{vcs}{rev}.d{build_date:%Y%m%d}"
143
148
144
- [tool .versioningit .template-fields .version-tuple ]
145
- split-on = ' ^(\d+)\.(\d+)\.(\d+)\.([a-zA-Z])(\d+)(?:.\d+)?'
146
-
149
+ [tool .versioningit .template-fields ]
150
+ method = { module = " scripts.versioning" , value = " template_fields" }
147
151
148
152
[tool .versioningit .write ]
149
153
file = " disnake/_version.py"
@@ -162,11 +166,7 @@ class VersionInfo(NamedTuple):
162
166
releaselevel: Literal["alpha", "beta", "candidate", "final"]
163
167
serial: int
164
168
165
-
166
- # fmt: off
167
- version_info: VersionInfo = VersionInfo(*{version_tuple}[:5])
168
- # fmt: on
169
-
169
+ version_info: VersionInfo = VersionInfo{version_tuple}
170
170
"""
171
171
172
172
[tool .ruff ]
@@ -442,4 +442,3 @@ exclude_lines = [
442
442
" ^\\ s*raise NotImplementedError$" ,
443
443
" ^\\ s*\\ .\\ .\\ .$" ,
444
444
]
445
-
0 commit comments