Skip to content

Commit 5e6882b

Browse files
authored
Merge pull request #118 from sphinx-contrib/deploy-pages
Fix GitHub Pages deployment, update remaining references to old repo and TravisCI, add more pre-commit hooks
2 parents 30a45ab + 2a18083 commit 5e6882b

21 files changed

+382
-54
lines changed

.codespellignore

Whitespace-only changes.

.flake8

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ jobs:
3838
mkdir html
3939
git fetch --all
4040
python -I -m sphinx_multiversion -W docs html
41+
cp assets/gh-pages-redirect.html html/index.html
4142
4243
- name: Upload the Docs
43-
uses: actions/upload-artifact@v4
44+
uses: actions/upload-pages-artifact@v3
4445
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.12'
4546
with:
4647
name: docs
@@ -61,7 +62,7 @@ jobs:
6162

6263
deploy-docs:
6364
name: Deploy Docs to GitHub Pages
64-
if: ${{ startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' }}
65+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' }}
6566
runs-on: ubuntu-latest
6667
needs: [build]
6768
permissions:
@@ -119,4 +120,3 @@ jobs:
119120

120121
- name: Publish Distributions to PyPI
121122
uses: pypa/gh-action-pypi-publish@release/v1
122-

.pre-commit-config.yaml

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,67 @@ repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
33
rev: v4.6.0
44
hooks:
5-
- id: trailing-whitespace
6-
- id: check-merge-conflict
7-
- id: check-yaml
8-
- id: check-executables-have-shebangs
9-
- id: mixed-line-ending
5+
- id: check-added-large-files
6+
args: ["--maxkb=500"]
7+
- id: check-ast
8+
- id: fix-byte-order-marker
9+
- id: check-builtin-literals
10+
- id: check-case-conflict
11+
- id: check-docstring-first
12+
- id: check-executables-have-shebangs
13+
- id: check-json
14+
- id: check-shebang-scripts-are-executable
15+
- id: pretty-format-json
16+
args: ["--autofix"]
17+
- id: check-merge-conflict
18+
- id: check-symlinks
19+
- id: check-toml
20+
- id: check-vcs-permalinks
21+
- id: check-xml
22+
- id: check-yaml
23+
- id: debug-statements
24+
- id: destroyed-symlinks
25+
- id: detect-private-key
26+
- id: end-of-file-fixer
27+
- id: file-contents-sorter
28+
- id: fix-byte-order-marker
29+
- id: forbid-new-submodules
30+
- id: mixed-line-ending
31+
args: ["--fix=lf"]
32+
- id: requirements-txt-fixer
33+
- id: sort-simple-yaml
34+
- id: trailing-whitespace
1035
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.6.8
36+
rev: v0.6.9
1237
hooks:
1338
- id: ruff
1439
args: [ --fix ]
1540
- id: ruff-format
41+
- repo: https://github.com/codespell-project/codespell
42+
rev: v2.3.0
43+
hooks:
44+
- id: codespell
45+
args: [
46+
--ignore-words=.codespellignore
47+
]
48+
- repo: https://github.com/markdownlint/markdownlint
49+
rev: v0.12.0
50+
hooks:
51+
- id: markdownlint
52+
- repo: https://github.com/Holzhaus/sourceheaders
53+
rev: v0.0.4
54+
hooks:
55+
- id: sourceheaders
56+
- repo: https://github.com/PyCQA/bandit
57+
rev: "1.7.10"
58+
hooks:
59+
- id: bandit
60+
args: ["-c", "pyproject.toml", "--"]
61+
additional_dependencies: ["bandit[toml]"]
62+
- repo: https://github.com/gitleaks/gitleaks
63+
rev: v8.20.0
64+
hooks:
65+
- id: gitleaks
1666
- repo: local
1767
hooks:
1868
- id: version-check

.pre-commit/version_check.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
11
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
# Copyright (c) 2024 Jan Holthuis <[email protected]>
4+
#
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions are met:
7+
#
8+
# 1. Redistributions of source code must retain the above copyright notice,
9+
# this list of conditions and the following disclaimer.
10+
#
11+
# 2. Redistributions in binary form must reproduce the above copyright notice,
12+
# this list of conditions and the following disclaimer in the documentation
13+
# and/or other materials provided with the distribution.
14+
#
15+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25+
# POSSIBILITY OF SUCH DAMAGE.
26+
#
27+
# SPDX-License-Identifier: BSD-2-Clause
28+
229
import importlib.util
330
import os
431
import pkgutil

.sourceheaders.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[general]
2+
license = "BSD-2-Clause"
3+
copyright_holder = "Jan Holthuis <[email protected]>"
4+
prefer_inline = true
5+
width = 79

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
# sphinx-multiversion [![Build Status](https://travis-ci.org/Holzhaus/sphinx-multiversion.svg?branch=master)](https://travis-ci.org/Holzhaus/sphinx-multiversion)
1+
# sphinx-multiversion [![License][license-badge]][license][![Build][build-badge]][build][![pre-commit.ci][pre-commit-badge]][pre-commit]
22

33
Sphinx extension for building self-hosted versioned docs.
44

55
This extension aims to provide a clean implementation that tries to avoid
66
messing with Sphinx internals as much as possible.
77

8-
Documentation can be found at: https://holzhaus.github.io/sphinx-multiversion/
8+
Documentation can be found at: <https://sphinx-contrib.github.io/multiversion/>
9+
10+
[license]: https://github.com/sphinx-contrib/multiversion/blob/main/LICENSE
11+
[license-badge]: https://img.shields.io/github/license/sphinx-contrib/multiversion
12+
[build]: https://github.com/sphinx-contrib/multiversion/actions?query=branch%3Amain
13+
[build-badge]: https://img.shields.io/github/actions/workflow/status/sphinx-contrib/multiversion/build.yml?branch=main
14+
[pre-commit]: https://results.pre-commit.ci/latest/github/sphinx-contrib/multiversion/main
15+
[pre-commit-badge]: https://results.pre-commit.ci/badge/github/sphinx-contrib/multiversion/main.svg

assets/gh-pages-redirect.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Redirecting to https://holzhaus.github.io/sphinx-multiversion/master/</title>
4+
<title>Redirecting to https://sphinx-contrib.github.io/multiversion/main/</title>
55
<meta charset="utf-8">
6-
<meta http-equiv="refresh" content="0; URL=https://holzhaus.github.io/sphinx-multiversion/master/index.html">
7-
<link rel="canonical" href="https://holzhaus.github.io/sphinx-multiversion/master/index.html">
6+
<meta http-equiv="refresh" content="0; URL=https://sphinx-contrib.github.io/multiversion/main/index.html">
7+
<link rel="canonical" href="https://sphinx-contrib.github.io/multiversion/main/index.html">
88
</head>
99
</html>

docs/changelog.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,22 @@ Version 0.1.0 (2020-03-11)
6060
* Initial release
6161

6262

63-
.. _issue4: https://github.com/Holzhaus/sphinx-multiversion/issues/4
64-
.. _issue7: https://github.com/Holzhaus/sphinx-multiversion/issues/7
65-
.. _issue9: https://github.com/Holzhaus/sphinx-multiversion/issues/9
66-
.. _issue11: https://github.com/Holzhaus/sphinx-multiversion/issues/11
67-
.. _issue12: https://github.com/Holzhaus/sphinx-multiversion/issues/12
68-
.. _issue13: https://github.com/Holzhaus/sphinx-multiversion/issues/13
69-
.. _issue18: https://github.com/Holzhaus/sphinx-multiversion/issues/18
70-
.. _issue19: https://github.com/Holzhaus/sphinx-multiversion/issues/19
71-
.. _issue22: https://github.com/Holzhaus/sphinx-multiversion/issues/22
72-
.. _issue23: https://github.com/Holzhaus/sphinx-multiversion/issues/23
73-
.. _issue24: https://github.com/Holzhaus/sphinx-multiversion/issues/24
74-
.. _issue25: https://github.com/Holzhaus/sphinx-multiversion/issues/25
75-
.. _issue26: https://github.com/Holzhaus/sphinx-multiversion/issues/26
76-
.. _issue28: https://github.com/Holzhaus/sphinx-multiversion/issues/28
77-
.. _issue30: https://github.com/Holzhaus/sphinx-multiversion/issues/30
78-
.. _issue31: https://github.com/Holzhaus/sphinx-multiversion/issues/31
79-
.. _issue35: https://github.com/Holzhaus/sphinx-multiversion/issues/35
80-
.. _issue36: https://github.com/Holzhaus/sphinx-multiversion/issues/36
63+
.. _issue4: https://github.com/sphinx-contrib/multiversion/issues/4
64+
.. _issue7: https://github.com/sphinx-contrib/multiversion/issues/7
65+
.. _issue9: https://github.com/sphinx-contrib/multiversion/issues/9
66+
.. _issue11: https://github.com/sphinx-contrib/multiversion/issues/11
67+
.. _issue12: https://github.com/sphinx-contrib/multiversion/issues/12
68+
.. _issue13: https://github.com/sphinx-contrib/multiversion/issues/13
69+
.. _issue18: https://github.com/sphinx-contrib/multiversion/issues/18
70+
.. _issue19: https://github.com/sphinx-contrib/multiversion/issues/19
71+
.. _issue22: https://github.com/sphinx-contrib/multiversion/issues/22
72+
.. _issue23: https://github.com/sphinx-contrib/multiversion/issues/23
73+
.. _issue24: https://github.com/sphinx-contrib/multiversion/issues/24
74+
.. _issue25: https://github.com/sphinx-contrib/multiversion/issues/25
75+
.. _issue26: https://github.com/sphinx-contrib/multiversion/issues/26
76+
.. _issue28: https://github.com/sphinx-contrib/multiversion/issues/28
77+
.. _issue30: https://github.com/sphinx-contrib/multiversion/issues/30
78+
.. _issue31: https://github.com/sphinx-contrib/multiversion/issues/31
79+
.. _issue35: https://github.com/sphinx-contrib/multiversion/issues/35
80+
.. _issue36: https://github.com/sphinx-contrib/multiversion/issues/36
8181
.. _pythonflags: https://docs.python.org/3/using/cmdline.html#miscellaneous-options

docs/conf.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
# -*- coding: utf-8 -*-
2+
# Copyright (c) 2024 Jan Holthuis <[email protected]>
3+
#
4+
# Redistribution and use in source and binary forms, with or without
5+
# modification, are permitted provided that the following conditions are met:
6+
#
7+
# 1. Redistributions of source code must retain the above copyright notice,
8+
# this list of conditions and the following disclaimer.
9+
#
10+
# 2. Redistributions in binary form must reproduce the above copyright notice,
11+
# this list of conditions and the following disclaimer in the documentation
12+
# and/or other materials provided with the distribution.
13+
#
14+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24+
# POSSIBILITY OF SUCH DAMAGE.
25+
#
26+
# SPDX-License-Identifier: BSD-2-Clause
27+
228
"""Sphinx configuration file."""
329

430
import time
@@ -11,11 +37,10 @@
1137

1238
html_theme = "alabaster"
1339
html_theme_options = {
14-
"github_repo": "sphinx-multiversion",
15-
"github_user": "Holzhaus",
40+
"github_repo": "multiversion",
41+
"github_user": "sphinx-contrib",
1642
"github_banner": True,
1743
"github_button": True,
18-
"travis_button": True,
1944
"show_relbar_bottom": True,
2045
}
2146
html_last_updated_fmt = "%c"
@@ -41,4 +66,4 @@
4166
}
4267

4368
smv_remote_whitelist = r"^origin$"
44-
smv_branch_whitelist = r"^master$"
69+
smv_branch_whitelist = r"^main$"

0 commit comments

Comments
 (0)