From 10f7429392f5010ee340b15b5b6c16c85b2a7884 Mon Sep 17 00:00:00 2001 From: Stanislav Pankevich Date: Sun, 26 Nov 2023 20:45:37 +0100 Subject: [PATCH] Upgrade to new Read the Docs config --- .readthedocs.yaml | 10 +++++++--- docs/conf.py | 20 +++++++++++++++++--- requirements.dev.txt | 3 +++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1a4427a..430e62a 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -12,10 +12,14 @@ sphinx: # Optionally build your docs in additional formats such as PDF and ePub formats: - pdf +# - epub + +build: + os: ubuntu-22.04 + tools: + python: "3.8" # Optionally set the version of Python and requirements required to build your docs python: - version: 3.5 install: - - requirements: docs/requirements.txt - + - requirements: requirements.dev.txt diff --git a/docs/conf.py b/docs/conf.py index 741bcdf..f164bd5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,6 +3,8 @@ # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html +import os +import sys # -- Path setup -------------------------------------------------------------- @@ -16,6 +18,20 @@ import guzzle_sphinx_theme +try: + filecheck_root_path = os.path.abspath( + os.path.join(os.path.dirname(__file__), "..") + ) + if not os.path.isdir(filecheck_root_path): + raise FileNotFoundError + sys.path.append(filecheck_root_path) + from filecheck.filecheck import __version__ as filecheck_version +except Exception as exception: + print( # noqa: T201 + f"Could not resolve a path to filecheck's root: {exception}" + ) + sys.exit(1) + # -- Project information ----------------------------------------------------- project = "FileCheck.py" @@ -23,7 +39,7 @@ author = "Stanislav Pankevich" # The full version, including alpha/beta/rc tags -release = "0.0.1" +release = filecheck_version # -- General configuration --------------------------------------------------- @@ -51,8 +67,6 @@ extensions.append("guzzle_sphinx_theme") html_theme = "guzzle_sphinx_theme" -# html_theme = 'pyramid' - html_theme_options = { "project_nav_name": "Mull", } diff --git a/requirements.dev.txt b/requirements.dev.txt index 96da735..55ccd07 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -11,3 +11,6 @@ flake8>=3.9.2 coverage>=5.4 pytest>=6.2.2 lit>=0.9 + +# Docs +guzzle_sphinx_theme