Skip to content

Commit cc8b181

Browse files
authored
Auto update doc copyright year (#72)
* automatically set docs' copyright and version * doc builds use editable install of cpp-linter pkg
1 parent 03934bb commit cc8b181

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

.github/workflows/build-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
python-version: 3.x
1414

1515
- name: Install docs dependencies
16-
run: pip install -r docs/requirements.txt -r requirements.txt
16+
run: pip install -r docs/requirements.txt -e .
1717

1818
- name: Build docs
1919
run: sphinx-build docs docs/_build/html

docs/conf.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@
33
# For the full list of built-in configuration values, see the documentation:
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
55

6-
import sys
76
import re
87
from pathlib import Path
8+
import time
9+
from importlib.metadata import version as get_version
910
from sphinx.application import Sphinx
10-
11-
sys.path.insert(0, str(Path(__file__).parent.parent))
12-
13-
from cpp_linter.cli import cli_arg_parser # noqa: E402
11+
from cpp_linter.cli import cli_arg_parser
1412

1513
# -- Project information -----------------------------------------------------
1614
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1715
project = "cpp-linter"
18-
copyright = "2022, 2bndy5"
16+
copyright = f"{time.localtime().tm_year}, 2bndy5"
1917
author = "2bndy5"
20-
release = "2.0.0"
18+
release = get_version("cpp-linter")
2119

2220
# -- General configuration ---------------------------------------------------
2321
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

0 commit comments

Comments
 (0)