From 997a5cbbd8bc7028a5aedea2c2815313c04025f3 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 1 Jul 2024 13:01:46 +1000 Subject: [PATCH 01/13] MAINT: master to main --- .github/workflows/ci.yml | 2 +- README.md | 6 +++--- docs/source/index.md | 6 +++--- docs/source/install.md | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b26137..eb97c56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: continuous-integration on: push: - branches: [master] + branches: [main] pull_request: jobs: diff --git a/README.md b/README.md index 9c2a0ed..b579f08 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ **A proof extension for Sphinx**. -This package contains a [Sphinx](http://www.sphinx-doc.org/en/master/) extension +This package contains a [Sphinx](http://www.sphinx-doc.org/) extension for producing proof, theorem, axiom, lemma, definition, criterion, remark, conjecture, corollary, algorithm, example, property, observation, proposition and assumption directives. @@ -40,7 +40,7 @@ We welcome all contributions! See the [EBP Contributing Guide](https://executabl [rtd-badge]: https://readthedocs.org/projects/sphinx-proof/badge/?version=latest [rtd-link]: https://sphinx-proof.readthedocs.io/en/latest/?badge=latest -[github-ci]: https://github.com/executablebooks/sphinx-proof/workflows/continuous-integration/badge.svg?branch=master +[github-ci]: https://github.com/executablebooks/sphinx-proof/workflows/continuous-integration/badge.svg?branch=main [github-link]: https://github.com/executablebooks/sphinx-proof -[codecov-badge]: https://codecov.io/gh/executablebooks/sphinx-proof/branch/master/graph/badge.svg +[codecov-badge]: https://codecov.io/gh/executablebooks/sphinx-proof/branch/main/graph/badge.svg [codecov-link]: https://codecov.io/gh/executablebooks/sphinx-proof diff --git a/docs/source/index.md b/docs/source/index.md index 21ebe67..74dff27 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -15,7 +15,7 @@ zreferences **A proof extension for Sphinx**. -This package contains a [Sphinx](http://www.sphinx-doc.org/en/master/) extension +This package contains a [Sphinx](http://www.sphinx-doc.org/) extension for producing proof, theorem, axiom, lemma, definition, criterion, remark, conjecture, corollary, algorithm, example, property, observation, proposition and assumption directives. @@ -61,7 +61,7 @@ you may then build using `make html` and the extension will be used by your `Sph [rtd-badge]: https://readthedocs.org/projects/sphinx-proof/badge/?version=latest [rtd-link]: https://sphinx-proof.readthedocs.io/en/latest/?badge=latest -[github-ci]: https://github.com/executablebooks/sphinx-proof/workflows/continuous-integration/badge.svg?branch=master +[github-ci]: https://github.com/executablebooks/sphinx-proof/workflows/continuous-integration/badge.svg?branch=main [github-link]: https://github.com/executablebooks/sphinx-proof -[codecov-badge]: https://codecov.io/gh/executablebooks/sphinx-proof/branch/master/graph/badge.svg +[codecov-badge]: https://codecov.io/gh/executablebooks/sphinx-proof/branch/main/graph/badge.svg [codecov-link]: https://codecov.io/gh/executablebooks/sphinx-proof diff --git a/docs/source/install.md b/docs/source/install.md index 37af7a2..fbb6197 100644 --- a/docs/source/install.md +++ b/docs/source/install.md @@ -26,6 +26,6 @@ To install `sphinx-proof` for package development: ```bash git clone https://github.com/executablebooks/sphinx-proof cd sphinx-proof -git checkout master +git checkout main pip install -e .[all] ``` From 631475064bdd5f3ffd6414f96b4ca729898bb564 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 1 Jul 2024 13:07:59 +1000 Subject: [PATCH 02/13] update pre-commit --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9ffc9f6..e222237 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,18 +4,18 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.6.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 + - repo: https://github.com/PyCQA/flake8 + rev: 7.1.0 hooks: - id: flake8 - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 24.4.2 hooks: - id: black From ce36175fe9419d39e8a8447a652cde10ada1c6b6 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 1 Jul 2024 13:10:19 +1000 Subject: [PATCH 03/13] fix pre-commit issues --- sphinx_proof/directive.py | 1 + sphinx_proof/domain.py | 3 ++- sphinx_proof/nodes.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sphinx_proof/directive.py b/sphinx_proof/directive.py index 769ba3a..9d4595b 100644 --- a/sphinx_proof/directive.py +++ b/sphinx_proof/directive.py @@ -7,6 +7,7 @@ :copyright: Copyright 2020 by the QuantEcon team, see AUTHORS :licences: see LICENSE for details """ + from typing import List from docutils import nodes from docutils.nodes import Node diff --git a/sphinx_proof/domain.py b/sphinx_proof/domain.py index 9dab1cc..714bdcb 100644 --- a/sphinx_proof/domain.py +++ b/sphinx_proof/domain.py @@ -7,7 +7,8 @@ :copyright: Copyright 2020 by the QuantEcon team, see AUTHORS :licences: see LICENSE for details """ -from typing import Any, Dict, Tuple, List, Callable + +from typing import Any, Dict, Tuple, List from docutils.nodes import Element, Node, document, system_message from sphinx.environment import BuildEnvironment from sphinx.addnodes import pending_xref diff --git a/sphinx_proof/nodes.py b/sphinx_proof/nodes.py index 5f164ae..58fbf0c 100644 --- a/sphinx_proof/nodes.py +++ b/sphinx_proof/nodes.py @@ -7,6 +7,7 @@ :copyright: Copyright 2020 by the QuantEcon team, see AUTHORS :licences: see LICENSE for details """ + from docutils import nodes from docutils.nodes import Node from sphinx.writers.latex import LaTeXTranslator From a0f3005ee22271866f9644534e89ae5d4f7918e0 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 1 Jul 2024 13:19:15 +1000 Subject: [PATCH 04/13] add diffusedxml --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 8975b4c..43d12bc 100644 --- a/setup.py +++ b/setup.py @@ -29,6 +29,7 @@ "beautifulsoup4", "myst-parser", "texsoup", + "defusedxml", ], "rtd": [ "sphinx>=3.0", From dae129b547f2d251c78ce25f8ef4ba0f9cb70df1 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 1 Jul 2024 14:15:09 +1000 Subject: [PATCH 05/13] fix tests and update to more recent versions --- .pre-commit-config.yaml | 6 ++++++ setup.py | 6 +++--- tests/test_html/proof/_proof_with_labeled_math.html | 2 +- tests/test_latex/test_latex_build.tex | 5 +++++ tox.ini | 9 +++++---- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e222237..9745e25 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,12 @@ # Install pre-commit hooks via # pre-commit install +exclude: > + (?x)^( + test_html/ + test_latex/ + )$ + repos: - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/setup.py b/setup.py index 43d12bc..6b45b03 100644 --- a/setup.py +++ b/setup.py @@ -20,10 +20,10 @@ # Define all extras extras = { - "code_style": ["flake8<3.8.0,>=3.7.0", "black", "pre-commit==1.17.0"], + "code_style": ["flake8", "black", "pre-commit"], "testing": [ "coverage", - "pytest>=3.6,<4", + "pytest~=7.1", "pytest-cov", "pytest-regressions", "beautifulsoup4", @@ -32,7 +32,7 @@ "defusedxml", ], "rtd": [ - "sphinx>=3.0", + "sphinx>=5.0", "sphinx-book-theme", "sphinxcontrib-bibtex", "myst-parser", diff --git a/tests/test_html/proof/_proof_with_labeled_math.html b/tests/test_html/proof/_proof_with_labeled_math.html index 34f6c21..2a5b002 100644 --- a/tests/test_html/proof/_proof_with_labeled_math.html +++ b/tests/test_html/proof/_proof_with_labeled_math.html @@ -1,5 +1,5 @@

Proof. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut

-(1)\[P_t(x, y) = \mathbb 1\{x = y\} + t Q(x, y) + o(t)\]
+(1)\[P_t(x, y) = \mathbb 1\{x = y\} + t Q(x, y) + o(t)\]
diff --git a/tests/test_latex/test_latex_build.tex b/tests/test_latex/test_latex_build.tex index 738a8b8..19f308a 100644 --- a/tests/test_latex/test_latex_build.tex +++ b/tests/test_latex/test_latex_build.tex @@ -1,5 +1,10 @@ \begin{document} +\ifdefined\shorthandoff + \ifnum\catcode`\=\string=\active\shorthandoff{=}\fi + \ifnum\catcode`\"=\active\shorthandoff{"}\fi +\fi + \pagestyle{empty} \sphinxmaketitle \pagestyle{plain} diff --git a/tox.ini b/tox.ini index af33bfc..111200c 100644 --- a/tox.ini +++ b/tox.ini @@ -8,17 +8,18 @@ # `tox -r` [tox] -envlist = py{36,37,38} +envlist = py311-sphinx5 skip_missing_interpreters = true [testenv] recreate = false -[testenv:py{36,37,38}] +[testenv:py{39,310,311,312}-sphinx{5,6,7}] extras = testing deps = - sphinx2: sphinx>=2,<3 - sphinx3: sphinx>=3,<4 + sphinx5: sphinx>=5,<6 + sphinx6: sphinx>=6,<7 + sphinx7: sphinx>=7,<8 commands = pytest {posargs} [testenv:docs-{update,clean}] From 4bf19c2066cbf65c87194672993a67714e5b16d1 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 1 Jul 2024 14:17:18 +1000 Subject: [PATCH 06/13] update python versions in ci --- .github/workflows/ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb97c56..e97b19a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,15 +14,15 @@ jobs: - name: Set up Python 3.9 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - uses: pre-commit/action@v3.0.0 tests: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9"] - sphinx: [">=4,<5"] + python-version: ["3.10", "3.11"] + sphinx: [">=5,<6"] steps: - uses: actions/checkout@v2 @@ -40,10 +40,10 @@ jobs: - name: Create cov run: coverage xml - name: Upload to Codecov - if: matrix.python-version == 3.7 + if: matrix.python-version == 3.11 uses: codecov/codecov-action@v1 with: - name: sphinx-proof-pytest-py3.7 + name: sphinx-proof-pytest-py3.11 flags: pytests file: ./coverage.xml fail_ci_if_error: true @@ -53,10 +53,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8 + - name: Set up Python 3.11 uses: actions/setup-python@v1 with: - python-version: 3.8 + python-version: 3.11 - name: Install dependencies run: | python -m pip install --upgrade pip @@ -75,10 +75,10 @@ jobs: steps: - name: Checkout source uses: actions/checkout@v2 - - name: Set up Python 3.7 + - name: Set up Python 3.11 uses: actions/setup-python@v1 with: - python-version: 3.7 + python-version: 3.11 - name: Build package run: | pip install wheel From 8d9716cf9a1b8fb71cce25c2acd0b5fc00bf55f9 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 1 Jul 2024 14:20:10 +1000 Subject: [PATCH 07/13] fix duration requestion for pytest --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e97b19a..50b42e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: pip install -e.[testing] - name: Run pytest run: | - pytest --duration=10 --cov=sphinx_proof --cov-report=xml --cov-report=term-missing + pytest --durations=10 --cov=sphinx_proof --cov-report=xml --cov-report=term-missing - name: Create cov run: coverage xml - name: Upload to Codecov From d72afb19c7564817a7f3b383c4b329a94a5c9761 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 1 Jul 2024 14:26:00 +1000 Subject: [PATCH 08/13] enable dependabot for automatic actions upgrades --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7809c2a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + commit-message: + prefix: ⬆️ + schedule: + interval: weekly From 25cd1e3f0e5804993a7c799ade63d8290d90c587 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 1 Jul 2024 14:29:02 +1000 Subject: [PATCH 09/13] update codecov --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50b42e2..d02cdf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,14 +39,14 @@ jobs: pytest --durations=10 --cov=sphinx_proof --cov-report=xml --cov-report=term-missing - name: Create cov run: coverage xml + # TEMPORARY FIX: Disable codecov until we can get it working again - name: Upload to Codecov - if: matrix.python-version == 3.11 - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3.1.4 + if: false with: - name: sphinx-proof-pytest-py3.11 + name: sphinx-proof-pytests flags: pytests - file: ./coverage.xml - fail_ci_if_error: true + files: ./coverage.xml docs: name: Documentation build From 33c6083dca19765b52bc8f5e5db580898f93d49b Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Mon, 1 Jul 2024 09:19:16 +0100 Subject: [PATCH 10/13] maint: set Python LB to 3.9 --- .github/workflows/ci.yml | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d02cdf9..0311f82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python 3.9 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: python-version: 3.11 @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11"] sphinx: [">=5,<6"] steps: diff --git a/setup.py b/setup.py index 6b45b03..b244d85 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ setup( name="sphinx-proof", version=VERSION, - python_requires=">=3.6", + python_requires=">=3.9", author="QuantEcon", author_email="admin@quantecon.org", url=BASE_URL, From de60b8fcc303591b1fd5b10d4f0ab7ebc96a57cb Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 2 Jul 2024 09:14:32 +1000 Subject: [PATCH 11/13] enable pre-commit.ci --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b579f08..0106c38 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ [![Documentation Status][rtd-badge]][rtd-link] [![Github-CI][github-ci]][github-link] [![Coverage Status][codecov-badge]][codecov-link] +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/executablebooks/sphinx-proof/master.svg)](https://results.pre-commit.ci/latest/github/executablebooks/sphinx-proof/master) + **A proof extension for Sphinx**. From f5564074ff0410bb90b388bb210bbd8d419785d8 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 2 Jul 2024 09:17:28 +1000 Subject: [PATCH 12/13] remove pre-commit action as now a service --- .github/workflows/ci.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0311f82..a8984bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,16 +7,6 @@ on: jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: 3.11 - - uses: pre-commit/action@v3.0.0 - tests: runs-on: ubuntu-latest strategy: From 0280536dd6477a7b807fdfce6c148954100f4cf1 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 2 Jul 2024 09:33:23 +1000 Subject: [PATCH 13/13] Revert "remove pre-commit action as now a service" This reverts commit f5564074ff0410bb90b388bb210bbd8d419785d8. --- .github/workflows/ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8984bb..0311f82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,16 @@ on: jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + - uses: pre-commit/action@v3.0.0 + tests: runs-on: ubuntu-latest strategy: