diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9e4a2561..f29c4d07 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,8 +19,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ["3.10", "3.11", "3.12", "3.13"] - sphinx: ["~=8.0"] # temporary limit, bring it back to newest sphinx once we are sphinx9 compatible + python-version: ["3.11", "3.12", "3.13", "3.14"] + sphinx: [""] # Newest Sphinx myst-parser: [""] # Newest MyST Parser (any) include: # Just check the other platforms once @@ -39,6 +39,12 @@ jobs: sphinx: "~=8.0" myst-parser: "~=4.0" pillow: "==11.0.0" + # Oldest known-compatible dependencies + - os: ubuntu-latest + python-version: "3.10" + sphinx: "==5.0.0" + myst-parser: "==1.0.0" + pillow: "==11.0.0" # Mid-range dependencies - os: ubuntu-latest python-version: "3.11" @@ -47,9 +53,9 @@ jobs: pillow: "==11.0.0" # Newest known-compatible dependencies - os: ubuntu-latest - python-version: "3.13" - sphinx: "~=8.0" - myst-parser: "==4.0.0" + python-version: "3.14" + sphinx: "~=9.0" + myst-parser: "~=5.0" pillow: "==11.0.0" runs-on: ${{ matrix.os }} @@ -71,42 +77,9 @@ jobs: - name: Run pytest run: pytest --durations=10 - coverage: - needs: [tests] - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: "3.11" - cache: pip - - name: Install dependencies - run: | - pip install -e .[testing] - pip freeze - - - name: Run pytest - run: pytest --durations=10 --cov=myst_nb --cov-report=xml --cov-report=term-missing - - - name: Create cov - run: coverage xml - # for some reason the tests/conftest.py::check_nbs fixture breaks pytest-cov's cov-report outputting - # this is why we run `coverage xml` afterwards (required by codecov) - - # TEMPORARY FIX: Disable codecov until we can get it working again - - name: Upload to Codecov - uses: codecov/codecov-action@v5 - if: false - with: - name: myst-nb-pytests - flags: pytests - files: ./coverage.xml - publish: - name: Publish to PyPi + name: Publish to PyPI needs: [tests] if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') runs-on: ubuntu-latest diff --git a/myst_nb/sphinx_ext.py b/myst_nb/sphinx_ext.py index 1a61ef78..9a7b7996 100644 --- a/myst_nb/sphinx_ext.py +++ b/myst_nb/sphinx_ext.py @@ -7,7 +7,6 @@ from importlib import resources as import_resources import os from pathlib import Path -import sys from types import ModuleType from typing import Any, Iterator, cast @@ -194,14 +193,10 @@ def _get_file_hash(path: Path): @contextlib.contextmanager def _import_resources_path(package: ModuleType, resource: str) -> Iterator[Path]: - if sys.version_info < (3, 9): - with import_resources.path(package, resource) as path: - yield path - else: - with import_resources.as_file( - import_resources.files(package).joinpath(resource) - ) as path: - yield path + with import_resources.as_file( + import_resources.files(package).joinpath(resource) + ) as path: + yield path def add_css(app: Sphinx): diff --git a/pyproject.toml b/pyproject.toml index c0ac0ea4..11d0a6b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ - [build-system] +[build-system] requires = ["flit_core >=3.11,<4"] build-backend = "flit_core.buildapi" @@ -20,6 +20,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", @@ -42,7 +43,7 @@ dependencies = [ "myst-parser>=1.0.0", "nbformat>=5.0", "pyyaml", - "sphinx>=5,<9", # If we get bugs for older versions, just pin this higher + "sphinx>=5", # If we get bugs for older versions, just pin this higher "typing-extensions", # ipykernel is not a requirement of the library, # but is a common requirement for users (registers the python3 kernel) @@ -174,8 +175,8 @@ filterwarnings = [ 'ignore:datetime.datetime.utcnow\(\) is deprecated:DeprecationWarning:jupyter_cache', # From matplotlib’s dependencies 'ignore::DeprecationWarning:pyparsing', # imports deprecated `sre_constants` - # From myst-parser on Sphinx 9 - 'ignore:.*MystReferenceResolver.app.*:DeprecationWarning', + # From myst-parser on Sphinx 9 we hit RemovedInSphinx11Warning + 'ignore:.*MystReferenceResolver.app.*', # Upstream myst-parser still hits env.app deprecations under Sphinx 9 'ignore:.*env\\.app.*:DeprecationWarning:myst_parser', # Windows issues, some may need to be fixed in MyST-NB, others are upstream diff --git a/tox.ini b/tox.ini index 42d442e8..f276f897 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,7 @@ envlist = py313-sphinx8 [testenv] usedevelop = true -[testenv:py{310,311,312,313}-sphinx{5,6,7,8}] +[testenv:py{310,311,312,313,314}-sphinx{5,6,7,8}] extras = testing deps = sphinx5: sphinx>=5,<6