Skip to content

Commit

Permalink
version: use importlib
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl authored and inducer committed Jul 18, 2024
1 parent ace5755 commit 68e4c17
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from importlib import metadata
from urllib.request import urlopen


Expand All @@ -6,18 +7,9 @@
with urlopen(_conf_url) as _inf:
exec(compile(_inf.read(), _conf_url, "exec"), globals())

copyright = "2009-21, Andreas Kloeckner"

# The short X.Y version.
import re


ver_re = re.compile(r'version\s*=\s*"([0-9a-z.]+)"')
version = next(ver_re.search(line).group(1)
for line in open("../setup.py").readlines()
if ver_re.search(line))
# The full version, including alpha/beta/rc tags.
release = version
copyright = "2009-2024, Andreas Kloeckner"
release = metadata.version("codepy")
version = ".".join(release.split(".")[:2])

intersphinx_mapping = {
"python": ("https://docs.python.org/dev", None),
Expand Down

0 comments on commit 68e4c17

Please sign in to comment.