Skip to content

Commit

Permalink
CI: use Python 3.10 as default version (#116)
Browse files Browse the repository at this point in the history
* CI: use Python 3.10 as default version

* Update sphinx version

* Fix version definition

* Fix default Python version in pre-commit

* Fix version definitions

* Add sphinx tests for 5.3.0, 6.2.1, 7.*

* Split sphinx tests into two files

* Remove tests for sphinx 6 and 7
  • Loading branch information
hagenw authored Oct 12, 2023
1 parent 36e50bc commit 16cf53f
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/katex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

runs-on: ${{ matrix.os }}
env:
node-version: 16.0
python-version: 3.8
sphinx-version: '3.*'
katex-version: '0.16.0'
node-version: '20.0'
python-version: '3.10'
sphinx-version: '5.*'
katex-version: '0.16.9'
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:

runs-on: ubuntu-latest
env:
sphinx-version: '3.*'
python-version: 3.8
sphinx-version: '5.*'
python-version: '3.10'

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'

- name: Install pre-commit hooks
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:

runs-on: ${{ matrix.os }}
env:
sphinx-version: '3.*'
python-version: 3.8
sphinx-version: '5.*'
python-version: '3.10'
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.10'

- name: Install dependencies
run: |
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/sphinx-legacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Sphinx legacy

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest
env:
python-version: '3.8'
strategy:
matrix:
sphinx-version: [ '1.6.7', '1.8.6', '2.4.5', '3.5.4', '4.5.0' ]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ env.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}

- name: Set up Sphinx ${{ matrix.sphinx-version }}
run: |
python -V
python -m pip install --upgrade pip
pip install "sphinx==${{ matrix.sphinx-version }}"
pip install "docutils<0.17"
pip install "jinja2<3.1"
- name: Tests
run: |
python -m sphinx tests tests/_build/ -b html -W -C -D master_doc=index -D extensions=sphinxcontrib.katex
python -m sphinx tests tests/_build/ -c docs/ -b latex -W
4 changes: 2 additions & 2 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

runs-on: ubuntu-latest
env:
python-version: 3.8
python-version: '3.10'
strategy:
matrix:
sphinx-version: [ 1.6.7, 1.8.6, 2.4.5, 3.5.4, 4.5.0 ]
sphinx-version: [ '5.3.0' ]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
#
default_language_version:
python: python3.8
python: python3.10

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand Down
6 changes: 6 additions & 0 deletions update-katex-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ echo "Updating auto-render.min.js"
curl -s ${KATEX_URL}/contrib/auto-render.min.js --output sphinxcontrib/auto-render.min.js

# Update Python file
echo "Updating katex.py"
sed -i "/katex_version = '${CURRENT_VERSION}'/c\\katex_version = '${NEW_VERSION}'" sphinxcontrib/katex.py

# Update README
echo "Updating README.rst"
sed -i "s/${CURRENT_VERSION}/${NEW_VERSION}/" README.rst

# Update github Action for pre-rendering
echo "Updating .github/workflows/katex.yml"
sed -i "s/katex-version: '${CURRENT_VERSION}'/katex-version: '${NEW_VERSION}'/" .github/workflows/katex.yml

0 comments on commit 16cf53f

Please sign in to comment.