Skip to content

Commit 5743504

Browse files
authored
Delete old formatting kludges (#2575)
1 parent 33c4e2d commit 5743504

File tree

1 file changed

+3
-38
lines changed

1 file changed

+3
-38
lines changed

doc/conf.py

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -70,42 +70,7 @@
7070
# from arcade.version import VERSION
7171
# or read the docs build will fail.
7272
from version import VERSION # pyright: ignore [reportMissingImports]
73-
log.info(f" Got raw version {VERSION=!r}")
74-
75-
76-
def nice_version(version_string: str) -> str:
77-
"""Format raw VERSION by removing leading zeroes.
78-
79-
When importing VERSION, Python defaults to formatting it as
80-
3.00 as of February 2025.
81-
"""
82-
out = []
83-
for part in version_string.split('.'):
84-
try:
85-
out.append(str(int(part)))
86-
except ValueError as _:
87-
out.append(part)
88-
return '.'.join(out)
89-
90-
91-
# pending: 3.0.1 or 3.1 release?
92-
# Maintain title bar continuity for live doc showing 3.0 as the version
93-
VERSION_SPECIAL_CASES = {'3.0.0': '3.0'}
94-
95-
96-
def _specialcase_version(nice: str) -> str:
97-
if nice in VERSION_SPECIAL_CASES:
98-
new = VERSION_SPECIAL_CASES[nice]
99-
log.info(f" Special-casing version {nice!r} to {new!r}")
100-
else:
101-
new = nice
102-
return new
103-
104-
105-
NICE_VERSION = _specialcase_version(nice_version(VERSION))
106-
# pending: end
107-
108-
log.info(f" Got nice version {NICE_VERSION=!r}")
73+
log.info(f" Got version {VERSION=!r}")
10974

11075

11176
print()
@@ -261,9 +226,9 @@ def run_util(filename, run_name="__main__", init_globals=None):
261226
# built documents.
262227
#
263228
# The short X.Y version.
264-
version = NICE_VERSION
229+
version = VERSION
265230
# The full version, including alpha/beta/rc tags.
266-
release = NICE_VERSION
231+
release = VERSION
267232

268233
# The language for content autogenerated by Sphinx. Refer to documentation
269234
# for a list of supported languages.

0 commit comments

Comments
 (0)