File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 1+ Update version resolution in ``docs/conf.py `` to use :py:class: `importlib.metadata ` instead of regex.
Original file line number Diff line number Diff line change 1212# All configuration values have a default; values that are commented out
1313# serve to show the default.
1414
15+ import importlib .metadata
1516import importlib .util
1617import inspect
1718import os
106107# |version| and |release|, also used in various other places throughout the
107108# built documents.
108109#
109- # The short X.Y version.
110-
111- version = ""
112- with open ("../disnake/__init__.py" ) as f :
113- version = re .search (r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]' , f .read (), re .MULTILINE ).group (1 ) # pyright: ignore[reportOptionalMemberAccess]
114-
115110# The full version, including alpha/beta/rc tags.
116- release = version
111+ release = importlib . metadata . version ( "disnake" )
117112
113+ # The short X.Y version.
114+ version = "." .join (release .split ("." )[:2 ])
118115
119116_IS_READTHEDOCS = bool (os .getenv ("READTHEDOCS" ))
120117
You can’t perform that action at this time.
0 commit comments