Skip to content
Snippets Groups Projects
Verified Commit 68a015ce authored by Tomas Krizek's avatar Tomas Krizek
Browse files

meson: doc/conf.py - read version from meson.build

parent df1a38dd
Branches
Tags
1 merge request!771meson build system
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys, os, re, subprocess import os
import re
import subprocess
import sphinx_rtd_theme import sphinx_rtd_theme
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
if os.environ.get('READTHEDOCS', None) == 'True': if os.environ.get('READTHEDOCS', None) == 'True':
subprocess.call('doxygen') subprocess.call('doxygen')
# Add any Sphinx extension module names here, as strings. # Add any Sphinx extension module names here, as strings.
extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode', 'breathe'] extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode', 'breathe']
# Breathe configuration # Breathe configuration
breathe_projects = { "libkres": "doxyxml" } breathe_projects = {"libkres": "doxyxml"}
breathe_default_project = "libkres" breathe_default_project = "libkres"
breathe_domain_by_extension = {"h" : "c"} breathe_domain_by_extension = {"h": "c"}
# The suffix of source filenames. # The suffix of source filenames.
source_suffix = '.rst' source_suffix = '.rst'
...@@ -23,9 +25,12 @@ master_doc = 'index' ...@@ -23,9 +25,12 @@ master_doc = 'index'
# General information about the project. # General information about the project.
project = u'Knot Resolver' project = u'Knot Resolver'
copyright = u'2014-2018 CZ.NIC labs' copyright = u'2014-2019 CZ.NIC labs'
version = { k[0][0]: k[0][1] for k in filter(None, [re.findall(r'(MAJOR|MINOR|PATCH) := ([0-9]+)',line) for line in open('../config.mk')])} with open('../meson.build') as f:
version = '%s.%s.%s' % (version['MAJOR'], version['MINOR'], version['PATCH']) for line in f:
match = re.match(r"\s*version\s*:\s*'([^']+)'.*", line)
if match is not None:
version = match.groups()[0]
release = version release = version
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
...@@ -68,4 +73,3 @@ man_pages = [ ...@@ -68,4 +73,3 @@ man_pages = [
('index', 'libkres', u'libkres documentation', ('index', 'libkres', u'libkres documentation',
[u'CZ.NIC Labs'], 1) [u'CZ.NIC Labs'], 1)
] ]
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment