-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAINT: update build and CI for Sphinx 7 (#65)
* maint: update build and CI * maint: revert version to current * maint: more CI fixes,pre-commit * maint: fix quoting * maint: update pytest * maint: fix spec * maint: fix CI arg * wip: improving deprecations * maint: add type hints * fix: patch regression * maint: run pre-commit * fix: copy doctree node to avoid mutation * test: drop original_uri, translation_progress * test: fix tests * test: fix Sphinx 7 incompat * maint: run pre-commit
- Loading branch information
Showing
21 changed files
with
768 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,22 +12,22 @@ jobs: | |
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v1 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- uses: pre-commit/action@v2.0.0 | ||
python-version: "3.11" | ||
- uses: pre-commit/action@v3.0.1 | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9] | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
|
@@ -36,14 +36,14 @@ jobs: | |
pip install -e.[testing] | ||
- name: Run pytest | ||
run: | | ||
pytest --duration=10 --cov=sphinx_exercise --cov-report=xml --cov-report=term-missing | ||
pytest --durations=10 --cov=sphinx_exercise --cov-report=xml --cov-report=term-missing | ||
- name: Create cov | ||
run: coverage xml | ||
- name: Upload to Codecov | ||
if: matrix.python-version == 3.8 | ||
uses: codecov/codecov-action@v1 | ||
if: matrix.python-version == '3.11' | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
name: sphinx-exercise-pytest-py3.8 | ||
name: sphinx-exercise-pytest-py3.11 | ||
flags: pytests | ||
file: ./coverage.xml | ||
fail_ci_if_error: true | ||
|
@@ -52,11 +52,11 @@ jobs: | |
name: Documentation build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v1 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
|
@@ -74,15 +74,15 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v1 | ||
uses: actions/checkout@v4 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
python-version: "3.11" | ||
- name: Build package | ||
run: | | ||
pip install wheel | ||
python setup.py bdist_wheel sdist | ||
pip install wheel build | ||
python -m build | ||
- name: Publish | ||
uses: pypa/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ dist/ | |
coverage.* | ||
coverage.xml | ||
.tox/ | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "sphinx-exercise" | ||
dynamic = ["version"] | ||
description = "A Sphinx extension for producing exercises and solutions." | ||
readme = "README.md" | ||
license = { file = "LICENSE" } | ||
requires-python = ">=3.9" | ||
authors = [ | ||
{ name = "QuantEcon", email = "[email protected]" }, | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Environment :: Plugins", | ||
"Environment :: Web Environment", | ||
"Framework :: Sphinx :: Extension", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Natural Language :: English", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Documentation", | ||
"Topic :: Documentation :: Sphinx", | ||
"Topic :: Software Development :: Documentation", | ||
"Topic :: Text Processing", | ||
"Topic :: Utilities", | ||
] | ||
dependencies = [ | ||
"sphinx-book-theme", | ||
"sphinx>=5", | ||
] | ||
|
||
[project.optional-dependencies] | ||
all = [ | ||
"sphinx-exercise[code_style]", | ||
"sphinx-exercise[rtd]", | ||
"sphinx-exercise[testing]" | ||
] | ||
code_style = [ | ||
"black", | ||
"flake8<3.8.0,>=3.7.0", | ||
"pre-commit", | ||
] | ||
rtd = [ | ||
"myst-nb~=1.0.0", | ||
"sphinx-book-theme", | ||
"sphinx>=5,<8", | ||
] | ||
testing = [ | ||
"beautifulsoup4", | ||
"coverage", | ||
"matplotlib", | ||
"myst-nb~=1.0.0", | ||
"pytest-cov", | ||
"pytest-regressions", | ||
"pytest~=8.0.0", | ||
"sphinx>=5,<8", | ||
"texsoup", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/executablebooks/sphinx-exercise" | ||
Source = "https://github.com/executablebooks/sphinx-exercise" | ||
Tracker = "https://github.com/executablebooks/sphinx-exercise/issues" | ||
|
||
[tool.hatch.version] | ||
path = "sphinx_exercise/__init__.py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from docutils.nodes import Element | ||
from typing import Iterator | ||
|
||
|
||
def findall(node: Element, *args, **kwargs) -> Iterator[Element]: | ||
# findall replaces traverse in docutils v0.18 | ||
# note a difference is that findall is an iterator | ||
impl = getattr(node, "findall", node.traverse) | ||
return iter(impl(*args, **kwargs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
|
||
class LaTeXMarkup(object): | ||
|
||
CR = "\n" | ||
|
||
def visit_admonition(self): | ||
|
Oops, something went wrong.