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

doc(conf): update to use importlib.metadata

parent b840780a
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python #!/usr/bin/env python
# vim: set fileencoding=utf-8 : # vim: set fileencoding=utf-8 :
import importlib.metadata
import os import os
import time
import pkg_resources import sphinx_rtd_theme
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
...@@ -41,7 +43,7 @@ if os.path.exists("nitpick-exceptions.txt"): ...@@ -41,7 +43,7 @@ if os.path.exists("nitpick-exceptions.txt"):
dtype, target = line.split(None, 1) dtype, target = line.split(None, 1)
target = target.strip() target = target.strip()
try: # python 2.x try: # python 2.x
target = unicode(target) target = unicode(target) # type: ignore
except NameError: except NameError:
pass pass
nitpick_ignore.append((dtype, target)) nitpick_ignore.append((dtype, target))
...@@ -74,21 +76,20 @@ master_doc = "index" ...@@ -74,21 +76,20 @@ master_doc = "index"
# General information about the project. # General information about the project.
project = "bob.learn.em" project = "bob.learn.em"
import time
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.
...@@ -134,7 +135,6 @@ owner = ["Idiap Research Institute"] ...@@ -134,7 +135,6 @@ owner = ["Idiap Research Institute"]
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme" html_theme = "sphinx_rtd_theme"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment