8000 Remove sphinx-multiversion · python-discord/bot-core@ee87e22 · GitHub
[go: up one dir, main page]

Skip to content

Commit ee87e22

Browse files
committed
Remove sphinx-multiversion
1 parent 273f0fc commit ee87e22

File tree

5 files changed

+154
-208
lines changed

5 files changed

+154
-208
lines changed

.github/workflows/docs.yaml

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
workflow_call:
66

77
jobs:
8-
latest-build:
8+
build-deploy:
99
# We only need to verify that the docs build with no warnings here
1010
name: Build Latest Docs Version
1111
runs-on: ubuntu-latest
@@ -28,38 +28,6 @@ jobs:
2828
name: docs-latest
2929
path: docs/build/*
3030

31-
build-deploy:
32-
name: Build & Deploy Docs
33-
runs-on: ubuntu-latest
34-
35-
steps:
36-
- uses: actions/checkout@v4
37-
with:
38-
fetch-depth: 0 # We need to check out the entire repository to find all tags
39-
40-
- name: Install Python Dependencies
41-
uses: HassanAbouelela/actions/setup-python@setup-python_v1.4.2
42-
with:
43-
python_version: "3.12"
44-
install_args: "--extras async-rediscache"
45-
46-
- name: Build All Doc Versions
47-
run: sphinx-multiversion docs docs/build -n -j auto
48-
env:
49-
BUILD_DOCS_FOR_HEAD: ${{ github.event_name == 'pull_request' }}
50-
BRANCH_NAME: ${{ github.head_ref }}
51-
52-
- name: Remove Metadata Files
53-
run: |
54-
rm -r docs/build/**/_sources
55-
rm -r docs/build/**/.doctrees
56-
57-
- name: Upload Build Artifact
58-
uses: actions/upload-artifact@v4
59-
with:
60-
name: docs
61-
path: docs/build/*
62-
6331
- name: Deploy To GitHub Pages
6432
uses: JamesIves/github-pages-deploy-action@v4
6533
with:

docs/README.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,6 @@ The docs folder has a few moving components, here's a brief description of each:
3636
- `utils.py`: Helpful function used by `conf.py` to properly create the docs.
3737
- `netlify_build.py`: Script which downloads the build output in netlify. Refer to [Static Netlify Build](#static-builds)
3838

39-
40-
## Versions
41-
The project supports building all different versions at once using [sphinx-multiversion][multiversion]
42-
after version `v7.1.0`. You can run the following command to achieve that:
43-
44-
```shell
45-
poetry run sphinx_multiversion -v docs docs/build -n -j auto -n
46-
```
47-
48-
This will build all tags, as well as the main branch. To build branches besides the main one
49-
(such as the one you are currently working on), set the `BUILD_DOCS_FOR_HEAD` environment variable
50-
to True.
51-
52-
When using multi-version, keep the following in mind:
53-
1. This command will not fail on warnings, unlike the docs task. Make sure that passes first
54-
before using this one.
55-
2. Make sure to clear the build directory before running this script to avoid conflicts.
56-
57-
58-
[multiversion]: https://holzhaus.github.io/sphinx-multiversion/master/index.html
59-
60-
6139
## Docstrings
6240
To have your code properly added to the generated docs, you need to do a couple of things:
6341
1. Write your code with annotations.

docs/conf.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"releases",
5454
"sphinx.ext.linkcode",
5555
"sphinx.ext.githubpages",
56-
"sphinx_multiversion",
5756
]
5857

5958
# Add any paths that contain templates here, relative to this directory.
@@ -224,22 +223,3 @@ def _releases_setup(app: Sphinx) -> dict:
224223

225224
_original_releases_setup = releases.setup
226225
releases.setup = _releases_setup
227-
228-
229-
# -- Options for the multiversion extension ----------------------------------
230-
# Filter out older versions, and don't build branches other than main
231-
# unless `BUILD_DOCS_FOR_HEAD` env variable is True.
232-
smv_remote_whitelist = "origin"
233-
smv_latest_version = "main"
234-
235-
smv_branch_whitelist = "main"
236-
if os.getenv("BUILD_DOCS_FOR_HEAD", "False").lower() == "true":
237-
if not (branch := os.getenv("BRANCH_NAME")):
238-
with contextlib.suppress(git.InvalidGitRepositoryError):
239-
branch = git.Repo(PROJECT_ROOT).active_branch.name
240-
241-
if branch:
242-
logger.info(f"Adding branch {branch} to build whitelist.")
243-
smv_branch_whitelist = f"main|{branch}"
244-
245-
smv_tag_whitelist = r"v(?!([0-6]\.)|(7\.[0-1]\.0))" # Don't include any versions prior to v7.1.1

0 commit comments

Comments
 (0)
0