Skip to content

Commit c7692ab

Browse files
dgarcia360fruch
authored andcommitted
docs: update theme 1.2.1
Update extensions Lint conf.py Fix CI warning Fix CI warning Fix warning Fix warning
1 parent 439de00 commit c7692ab

File tree

7 files changed

+119
-52
lines changed

7 files changed

+119
-52
lines changed

.github/workflows/docs-links.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Docs / Links"
2+
# For more information,
3+
# see https://sphinx-theme.scylladb.com/stable/deployment/production.html#available-workflows
4+
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: "0 0 * * 0" # At 00:00 on Sunday
9+
10+
jobs:
11+
linkChecker:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
persist-credentials: false
18+
fetch-depth: 0
19+
20+
- name: Link Checker
21+
id: lychee
22+
uses: lycheeverse/lychee-action@v1.4.1
23+
with:
24+
args: --verbose --no-progress './**/*.md' './**/*.rst'
25+
env:
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
27+
28+
- name: Create Issue From File
29+
if: ${{ steps.lychee.outputs.exit_code != 0 }}
30+
uses: peter-evans/create-issue-from-file@v4
31+
with:
32+
title: Link Checker Report
33+
content-filepath: ./lychee/out.md
34+
labels: report, automated issue

.github/workflows/docs-pages.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: "Docs / Publish"
2+
# For more information,
3+
# see https://sphinx-theme.scylladb.com/stable/deployment/production.html#available-workflows
24

35
on:
46
push:
@@ -13,20 +15,18 @@ jobs:
1315
runs-on: ubuntu-latest
1416
steps:
1517
- name: Checkout
16-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
1719
with:
1820
persist-credentials: false
1921
fetch-depth: 0
2022
- name: Set up Python
21-
uses: actions/setup-python@v2.3.2
23+
uses: actions/setup-python@v3
2224
with:
2325
python-version: 3.7
24-
- name: Setup Cassandra dependencies
25-
run: sudo apt-get install gcc python-dev libev4 libev-dev
26+
- name: Set up env
27+
run: make -C docs setupenv
2628
- name: Build driver
2729
run: python setup.py develop
28-
- name: Set up Poetry
29-
run: curl -sSL https://install.python-poetry.org | python -
3030
- name: Build docs
3131
run: make -C docs multiversion
3232
- name: Deploy docs to GitHub Pages

.github/workflows/docs-pr.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: "Docs / Build PR"
2+
# For more information,
3+
# see https://sphinx-theme.scylladb.com/stable/deployment/production.html#available-workflows
24

35
on:
46
pull_request:
@@ -12,19 +14,17 @@ jobs:
1214
runs-on: ubuntu-latest
1315
steps:
1416
- name: Checkout
15-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1618
with:
1719
persist-credentials: false
1820
fetch-depth: 0
1921
- name: Set up Python
20-
uses: actions/setup-python@v2.3.2
22+
uses: actions/setup-python@v3
2123
with:
2224
python-version: 3.7
23-
- name: Setup Cassandra dependencies
24-
run: sudo apt-get install gcc python-dev libev4 libev-dev
25+
- name: Set up env
26+
run: make -C docs setupenv
2527
- name: Build driver
2628
run: python setup.py develop
27-
- name: Set up Poetry
28-
run: curl -sSL https://install.python-poetry.org | python -
2929
- name: Build docs
3030
run: make -C docs test

.lycheeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
http://127.0.0.1

docs/Makefile

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,47 @@
1+
# Global variables
12
# You can set these variables from the command line.
2-
POETRY = $(HOME)/.local/bin/poetry
3+
POETRY = poetry
34
SPHINXOPTS =
45
SPHINXBUILD = $(POETRY) run sphinx-build
56
PAPER =
67
BUILDDIR = _build
78
SOURCEDIR = .
89

9-
# Internal variables.
10+
# Internal variables
1011
PAPEROPT_a4 = -D latex_paper_size=a4
1112
PAPEROPT_letter = -D latex_paper_size=letter
1213
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
1314
TESTSPHINXOPTS = $(ALLSPHINXOPTS) -W --keep-going
1415

15-
# the i18n builder cannot share the environment and doctrees with the others
16-
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
16+
# Windows variables
17+
ifeq ($(OS),Windows_NT)
18+
POETRY = $(APPDATA)\Python\Scripts\poetry
19+
endif
1720

1821
.PHONY: all
1922
all: dirhtml
2023

21-
.PHONY: pristine
22-
pristine: clean
23-
git clean -dfX
24+
# Setup commands
25+
.PHONY: setupenv
26+
setupenv:
27+
pip install -q poetry
28+
sudo apt-get install gcc python-dev libev4 libev-dev
2429

2530
.PHONY: setup
2631
setup:
2732
$(POETRY) install
2833
$(POETRY) update
2934

35+
# Clean commands
36+
.PHONY: pristine
37+
pristine: clean
38+
git clean -dfX
39+
3040
.PHONY: clean
3141
clean:
3242
rm -rf $(BUILDDIR)/*
3343

34-
.PHONY: preview
35-
preview: setup
36-
$(POETRY) run sphinx-autobuild -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml --port 5500
37-
44+
# Generate output commands
3845
.PHONY: dirhtml
3946
dirhtml: setup
4047
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@@ -48,39 +55,39 @@ singlehtml: setup
4855
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
4956

5057
.PHONY: epub
51-
epub: setup
58+
epub: setup
5259
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
5360
@echo
5461
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
5562

5663
.PHONY: epub3
57-
epub3: setup
64+
epub3: setup
5865
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
5966
@echo
6067
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
6168

62-
.PHONY: dummy
63-
dummy: setup
64-
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
65-
@echo
66-
@echo "Build finished. Dummy builder generates no files."
67-
68-
.PHONY: linkcheck
69-
linkcheck: setup
70-
$(SPHINXBUILD) -b linkcheck $(SOURCEDIR) $(BUILDDIR)/linkcheck
71-
7269
.PHONY: multiversion
7370
multiversion: setup
7471
$(POETRY) run sphinx-multiversion $(SOURCEDIR) $(BUILDDIR)/dirhtml
7572
@echo
7673
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
7774

75+
# Preview commands
76+
.PHONY: preview
77+
preview: setup
78+
$(POETRY) run sphinx-autobuild -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml --port 5500
79+
7880
.PHONY: multiversionpreview
7981
multiversionpreview: multiversion
8082
$(POETRY) run python -m http.server 5500 --directory $(BUILDDIR)/dirhtml
8183

84+
# Test commands
8285
.PHONY: test
8386
test: setup
8487
$(SPHINXBUILD) -b dirhtml $(TESTSPHINXOPTS) $(BUILDDIR)/dirhtml
8588
@echo
86-
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
89+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
90+
91+
.PHONY: linkcheck
92+
linkcheck: setup
93+
$(SPHINXBUILD) -b linkcheck $(SOURCEDIR) $(BUILDDIR)/linkcheck

docs/conf.py

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,29 @@
1010

1111
# -- General configuration -----------------------------------------------------
1212

13+
# Build documentation for the following tags and branches
14+
TAGS = ['3.21.0-scylla', '3.22.3-scylla', '3.24.8-scylla', '3.25.4-scylla']
15+
BRANCHES = ['master']
16+
# Set the latest version.
17+
LATEST_VERSION = '3.25.4-scylla'
18+
# Set which versions are not released yet.
19+
UNSTABLE_VERSIONS = ['master']
20+
# Set which versions are deprecated
21+
DEPRECATED_VERSIONS = ['']
22+
1323
# Add any Sphinx extension module names here, as strings. They can be extensions
1424
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
15-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.githubpages', 'sphinx.ext.viewcode', 'sphinx_scylladb_theme', 'sphinx_multiversion', 'recommonmark']
25+
extensions = [
26+
'sphinx.ext.autodoc',
27+
'sphinx.ext.todo',
28+
'sphinx.ext.mathjax',
29+
'sphinx.ext.githubpages',
30+
'sphinx.ext.extlinks',
31+
'sphinx_sitemap',
32+
'sphinx_scylladb_theme',
33+
'sphinx_multiversion', # optional
34+
'recommonmark', # optional
35+
]
1636

1737
# Add any paths that contain templates here, relative to this directory.
1838
templates_path = ['_templates']
@@ -60,32 +80,35 @@
6080
# -- Options for redirect extension --------------------------------------------
6181

6282
# Read a YAML dictionary of redirections and generate an HTML file for each
63-
redirects_file = "_utils/redirections.yaml"
83+
redirects_file = '_utils/redirections.yaml'
6484

6585
# -- Options for multiversion --------------------------------------------------
66-
# Whitelist pattern for tags (set to None to ignore all tags)
67-
TAGS = ['3.21.0-scylla', '3.22.3-scylla', '3.24.8-scylla', '3.25.4-scylla']
86+
87+
# Whitelist pattern for tags
6888
smv_tag_whitelist = multiversion_regex_builder(TAGS)
69-
# Whitelist pattern for branches (set to None to ignore all branches)
70-
BRANCHES = ['master']
89+
# Whitelist pattern for branches
7190
smv_branch_whitelist = multiversion_regex_builder(BRANCHES)
7291
# Defines which version is considered to be the latest stable version.
73-
# Must be listed in smv_tag_whitelist or smv_branch_whitelist.
74-
smv_latest_version = '3.25.4-scylla'
92+
smv_latest_version = LATEST_VERSION
93+
# Defines the new name for the latest version.
7594
smv_rename_latest_version = 'stable'
7695
# Whitelist pattern for remotes (set to None to use local branches only)
77-
smv_remote_whitelist = r"^origin$"
96+
smv_remote_whitelist = r'^origin$'
7897
# Pattern for released versions
7998
smv_released_pattern = r'^tags/.*$'
8099
# Format for versioned output directories inside the build directory
81100
smv_outputdir_format = '{ref.name}'
82101

83-
# -- Options for HTML output ---------------------------------------------------
102+
# -- Options for HTML output --------------------------------------------------
84103

85104
# The theme to use for HTML and HTML Help pages. See the documentation for
86105
# a list of builtin themes.
87106
html_theme = 'sphinx_scylladb_theme'
88107

108+
# -- Options for sitemap extension ---------------------------------------
109+
110+
sitemap_url_scheme = 'stable/{link}'
111+
89112
# Theme options are theme-specific and customize the look and feel of a theme
90113
# further. For a list of options available for each theme, see the
91114
# documentation.
@@ -95,6 +118,8 @@
95118
'github_issues_repository': 'scylladb/python-driver',
96119
'hide_edit_this_page_button': 'false',
97120
'hide_version_dropdown': ['master'],
121+
'versions_unstable': UNSTABLE_VERSIONS,
122+
'versions_deprecated': DEPRECATED_VERSIONS,
98123
}
99124

100125
# Custom sidebar templates, maps document names to template names.

docs/pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ geomet = "0.1.2"
1111
gevent = "20.12.1"
1212
gremlinpython = "3.4.7"
1313
python = "^3.7"
14-
pyyaml = "^6.0"
14+
pyyaml = "6.0"
1515
pygments = "2.2.0"
16-
recommonmark = "^0.7.1"
17-
sphinx-autobuild = "^2021.3.14"
16+
recommonmark = "0.7.1"
17+
sphinx-autobuild = "2021.3.14"
1818
sphinx-sitemap = "2.1.0"
19-
sphinx-scylladb-theme = "~1.1.0"
20-
sphinx-multiversion-scylla = "~0.2.10"
21-
Sphinx = "^4.3.2"
19+
sphinx-scylladb-theme = "~1.2.1"
20+
sphinx-multiversion-scylla = "~0.2.11"
21+
Sphinx = "4.3.2"
2222
scales = "1.0.9"
2323
six = "1.15.0"
2424

0 commit comments

Comments
 (0)