Skip to content
Snippets Groups Projects
Verified Commit abff7952 authored by Yannick DAYER's avatar Yannick DAYER
Browse files

doc(conf): update to use importlib.metadata

parent 3f1b0daf
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import importlib.metadata
import os import os
import time import time
import pkg_resources
import sphinx_rtd_theme import sphinx_rtd_theme
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
...@@ -38,7 +38,7 @@ nitpick_ignore = [] ...@@ -38,7 +38,7 @@ nitpick_ignore = []
# Allows the user to override warnings from a separate file # Allows the user to override warnings from a separate file
if os.path.exists("nitpick-exceptions.txt"): if os.path.exists("nitpick-exceptions.txt"):
for line in open("nitpick-exceptions.txt"): for line in open("nitpick-exceptions.txt"):
if line.strip() == "" or line.startswith("#"): if line.strip() == "" or line.strip().startswith("#"):
continue continue
dtype, target = line.split(None, 1) dtype, target = line.split(None, 1)
target = target.strip() target = target.strip()
...@@ -76,16 +76,16 @@ project = "bob.pipelines" ...@@ -76,16 +76,16 @@ project = "bob.pipelines"
copyright = "%s, Idiap Research Institute" % time.strftime("%Y") copyright = "%s, Idiap Research Institute" % time.strftime("%Y")
# Grab the setup entry # Grab the setup entry
distribution = pkg_resources.require(project)[0] distribution = importlib.metadata.version(project)
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = distribution.version version = distribution
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = distribution.version release = distribution
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment