Skip to content

Commit 91d5a7e

Browse files
agoose77Bizordec
and
Bizordec
authored
chore: bump dependencies (#97)
Co-authored-by: Bizordec <[email protected]>
1 parent 4e83bb6 commit 91d5a7e

File tree

9 files changed

+78
-39
lines changed

9 files changed

+78
-39
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"

.github/workflows/tests.yml

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,23 @@ on:
1212

1313
jobs:
1414

15-
pre-commit:
16-
17-
runs-on: ubuntu-latest
18-
19-
steps:
20-
- uses: actions/checkout@v2
21-
- name: Set up Python 3.8
22-
uses: actions/setup-python@v2
23-
with:
24-
python-version: 3.8
25-
- uses: pre-commit/[email protected]
26-
2715
tests:
2816

2917
strategy:
3018
fail-fast: false
3119
matrix:
3220
os: [ubuntu-latest]
33-
python-version: [3.7, 3.8, 3.9, "3.10"]
21+
python-version: ["3.9", "3.10", "3.11", "3.12"]
3422
include:
3523
- os: windows-latest
36-
python-version: 3.8
24+
python-version: 3.9
3725

3826
runs-on: ${{ matrix.os }}
3927

4028
steps:
41-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v3
4230
- name: Set up Python ${{ matrix.python-version }}
43-
uses: actions/setup-python@v2
31+
uses: actions/setup-python@v4
4432
with:
4533
python-version: ${{ matrix.python-version }}
4634
- name: Install dependencies
@@ -51,27 +39,27 @@ jobs:
5139
run: |
5240
pytest --cov=sphinx_external_toc --cov-report=xml --cov-report=term-missing
5341
- name: Upload to Codecov
54-
if: matrix.python-version == 3.8
55-
uses: codecov/codecov-action@v1
42+
if: matrix.python-version == 3.11
43+
uses: codecov/codecov-action@v3
5644
with:
57-
name: pytests-py3.8
45+
name: pytests-py3.11
5846
flags: pytests
5947
file: ./coverage.xml
6048
fail_ci_if_error: true
6149

6250
publish:
6351

64-
name: Publish to PyPi
65-
needs: [pre-commit, tests]
52+
name: Publish to PyPI
53+
needs: [tests]
6654
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
6755
runs-on: ubuntu-latest
6856
steps:
6957
- name: Checkout source
70-
uses: actions/checkout@v2
58+
uses: actions/checkout@v3
7159
- name: Set up Python
72-
uses: actions/setup-python@v2
60+
uses: actions/setup-python@v4
7361
with:
74-
python-version: 3.8
62+
python-version: 3.11
7563
- name: install flit
7664
run: |
7765
pip install flit~=3.4

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
- id: trailing-whitespace
2020

2121
- repo: https://github.com/pycqa/isort
22-
rev: 5.10.1
22+
rev: 5.12.0
2323
hooks:
2424
- id: isort
2525

.readthedocs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
version: 2
22

3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.11"
7+
38
python:
4-
version: 3
59
install:
610
- method: pip
711
path: .

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ classifiers = [
1515
"Intended Audience :: Developers",
1616
"License :: OSI Approved :: MIT License",
1717
"Programming Language :: Python :: 3",
18-
"Programming Language :: Python :: 3.7",
19-
"Programming Language :: Python :: 3.8",
2018
"Programming Language :: Python :: 3.9",
2119
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
2222
"Programming Language :: Python :: Implementation :: CPython",
2323
"Topic :: Software Development :: Libraries :: Python Modules",
2424
"Topic :: Text Processing :: Markup",
2525
]
2626
keywords = ["sphinx","extension", "toc"]
27-
requires-python = "~=3.7"
27+
requires-python = ">=3.9"
2828
dependencies = [
29-
"click>=7.1,<9",
29+
"click>=7.1",
3030
"pyyaml",
31-
"sphinx>=4,<6",
31+
"sphinx>=5",
3232
]
3333

3434
[project.urls]
@@ -39,14 +39,14 @@ Documentation = "https://sphinx-external-toc.readthedocs.io"
3939
"jb.cmdline" = {toc = "sphinx_external_toc.cli:main"}
4040

4141
[project.optional-dependencies]
42-
code_style = ["pre-commit~=2.12"]
42+
code_style = ["pre-commit>=2.12"]
4343
rtd = [
44-
"myst-parser~=0.17.0",
44+
"myst-parser>=1.0.0",
4545
"sphinx-book-theme>=0.0.36",
4646
]
4747
testing = [
4848
"coverage",
49-
"pytest~=7.1",
49+
"pytest>=7.1",
5050
"pytest-cov",
5151
"pytest-regressions",
5252
]

sphinx_external_toc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""A sphinx extension that allows the project toctree to be defined in a single file."""
22

3-
__version__ = "0.3.1"
3+
__version__ = "1.0.0rc0"
44

55

66
from typing import TYPE_CHECKING

tests/conftest.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,32 @@
1+
import re
2+
3+
import pytest
4+
15
pytest_plugins = "sphinx.testing.fixtures"
6+
7+
8+
# comparison files will need updating
9+
# alternatively the resolution of https://github.com/ESSS/pytest-regressions/issues/32
10+
@pytest.fixture()
11+
def file_regression(file_regression):
12+
return FileRegression(file_regression)
13+
14+
15+
class FileRegression:
16+
ignores = (
17+
# TODO: Remove when support for Sphinx<=6 is dropped,
18+
re.escape(" translation_progress=\"{'total': 0, 'translated': 0}\""),
19+
# TODO: Remove when support for Sphinx<7.2 is dropped,
20+
r"original_uri=\"[^\"]*\"\s",
21+
)
22+
23+
def __init__(self, file_regression):
24+
self.file_regression = file_regression
25+
26+
def check(self, data, **kwargs):
27+
return self.file_regression.check(self._strip_ignores(data), **kwargs)
28+
29+
def _strip_ignores(self, data):
30+
for ig in self.ignores:
31+
data = re.sub(ig, "", data)
32+
return data

tests/test_sphinx.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pathlib import Path
33

44
import pytest
5-
from sphinx.testing.path import path as sphinx_path
5+
from sphinx import version_info as sphinx_version_info
66
from sphinx.testing.util import SphinxTestApp
77

88
from sphinx_external_toc.tools import create_site_from_toc
@@ -47,7 +47,16 @@ def outdir(self):
4747
@pytest.fixture()
4848
def sphinx_build_factory(make_app):
4949
def _func(src_path: Path, **kwargs) -> SphinxBuild:
50-
app = make_app(srcdir=sphinx_path(os.path.abspath(str(src_path))), **kwargs)
50+
# For compatibility with multiple versions of sphinx, convert pathlib.Path to
51+
# sphinx.testing.path.path here.
52+
if sphinx_version_info >= (7, 2):
53+
app_srcdir = src_path
54+
else:
55+
from sphinx.testing.path import path
56+
57+
app_srcdir = path(os.fspath(src_path))
58+
59+
app = make_app(srcdir=app_srcdir, **kwargs)
5160
return SphinxBuild(app, src_path)
5261

5362
yield _func

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
# then run `tox` or `tox -- {pytest args}`
55
# run in parallel using `tox -p`
66
[tox]
7-
envlist = py38
7+
envlist = py310
88

99
[testenv]
1010
usedevelop = true
1111

12-
[testenv:py{36,37,38,39}]
12+
[testenv:py{39,310,311,312}]
1313
extras =
1414
testing
1515
commands = pytest {posargs}

0 commit comments

Comments
 (0)