From 94da252e401c952ff192d06483cda515c498b185 Mon Sep 17 00:00:00 2001 From: Oscar Torreno Date: Thu, 23 May 2019 09:33:46 +0200 Subject: [PATCH] Fix/doc build ci (#109) * Fix documentation tools to generate the installers in the CI * Including readthedocs YAML file --- .CI/travis/install_linux.sh | 4 ++-- .CI/travis/install_osx.sh | 4 ++-- .appveyor.yml | 2 +- .gitignore | 1 + .readthedocs.yml | 23 +++++++++++++++++++++++ doc/sphinx/source/conf.py | 8 ++------ doc/sphinx/source/requirements.txt | 1 + 7 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 .readthedocs.yml create mode 100644 doc/sphinx/source/requirements.txt diff --git a/.CI/travis/install_linux.sh b/.CI/travis/install_linux.sh index 58267fb..3748378 100644 --- a/.CI/travis/install_linux.sh +++ b/.CI/travis/install_linux.sh @@ -9,11 +9,11 @@ sudo apt-get update -y sudo apt-get install -y lcov python3 python3-pip rpm # Installing conan -sudo pip3 install conan==1.6.1 +sudo pip3 install conan==1.5.2 if ! [[ -z "${TRAVIS_TAG}" ]]; then sudo apt-get install -y doxygen graphviz - sudo pip3 install sphinx==1.8.3 breathe sphinx_rtd_theme + sudo pip3 install sphinx==1.7.5 breathe==4.9.1 sphinx_rtd_theme==0.4.0 fi # Installing library dependencies with conan diff --git a/.CI/travis/install_osx.sh b/.CI/travis/install_osx.sh index f6094d8..d2aa837 100644 --- a/.CI/travis/install_osx.sh +++ b/.CI/travis/install_osx.sh @@ -19,11 +19,11 @@ brew install --force freeimage fontconfig glfw glbinding # Installing conan pip${PYTHON_VERSION} install --upgrade pip -pip${PYTHON_VERSION} install conan +pip${PYTHON_VERSION} install conan==1.5.2 if ! [[ -z "${TRAVIS_TAG}" ]]; then brew install doxygen graphviz - pip${PYTHON_VERSION} install sphinx==1.8.3 breathe sphinx_rtd_theme + pip${PYTHON_VERSION} install sphinx==1.7.5 breathe==4.9.1 sphinx_rtd_theme==0.4.0 fi # Installing library dependencies with conan diff --git a/.appveyor.yml b/.appveyor.yml index d66b15d..5a89182 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -24,7 +24,7 @@ before_build: Start-Process "choco" "install doxygen.install" -NoNewWindow -Wait Start-Process "choco" "install graphviz" -NoNewWindow -Wait python -m pip install --upgrade pip - pip3 install sphinx breathe sphinx_rtd_theme + pip3 install sphinx==1.7.5 breathe==4.9.1 sphinx_rtd_theme==0.4.0 } build_script: diff --git a/.gitignore b/.gitignore index 6969b2c..0d539f3 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ test/versionTest.cpp .idea/ *.gcov *.info +.vscode/ipch \ No newline at end of file diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..8217b85 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,23 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: doc/sphinx/source/conf.py + +# Build documentation with MkDocs +#mkdocs: +# configuration: mkdocs.yml + +# Optionally build your docs in additional formats such as PDF and ePub +formats: all + +# Optionally set the version of Python and requirements required to build your docs +python: + version: 3.7 + install: + - requirements: doc/sphinx/source/requirements.txt \ No newline at end of file diff --git a/doc/sphinx/source/conf.py b/doc/sphinx/source/conf.py index 5b734c0..98757ff 100644 --- a/doc/sphinx/source/conf.py +++ b/doc/sphinx/source/conf.py @@ -13,7 +13,6 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. # import os -import pip import subprocess # import sys @@ -43,11 +42,6 @@ release = subprocess.check_output( ["git", "describe"]).strip().decode("utf-8").split('-')[0] -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' - -if on_rtd: - subprocess.call("pip install breathe", shell=True) - with open(doxygen_source_dir + "/Doxyfile.in") as f: newText = f.read().replace('@VERSION_SHORT@', release).replace( '@DOXYGEN_OUTPUT_DIR@', doxygen_dir) @@ -138,6 +132,8 @@ # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['css'] + + def setup(app): app.add_stylesheet('custom.css') diff --git a/doc/sphinx/source/requirements.txt b/doc/sphinx/source/requirements.txt new file mode 100644 index 0000000..b635080 --- /dev/null +++ b/doc/sphinx/source/requirements.txt @@ -0,0 +1 @@ +breathe==4.9.1 \ No newline at end of file