Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import xml.etree.ElementTree as ET

from sphinx.util import logging
logger = logging.getLogger(__name__)

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -40,17 +43,27 @@
master_doc = 'index'

# General information about the project.
project = u'Phoebus'
copyright = u'2017, Phoebus Developers'
project = 'Phoebus'
copyright = '2017-%Y, Phoebus Developers'

def find_phoebus_version() -> str:
try:
pom = ET.parse("../../pom.xml")
version_el = pom.find("./{http://maven.apache.org/POM/4.0.0}version")

if version_el is not None and version_el.text is not None:
return version_el.text
else:
raise RuntimeError("Couldn't find a valid <version> in pom.xml")
except Exception:
logger.exception("Couldn't find Phoebus version, using a default value")
return "1.0"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '1.0'
version = find_phoebus_version()
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -248,6 +261,7 @@
# Create applications.rst, services.rst
# by listing links to all app/**/index.rst

import os
from os import walk, path
import subprocess, shutil
import sys, traceback
Expand Down