executablebooks / MyST-NB

Parse and execute ipynb files in Sphinx
https://myst-nb.readthedocs.io
BSD 3-Clause "New" or "Revised" License
201 stars 81 forks source link

Tests which use the `sphinx_run` fixture are broken for `sphinx>7`; failing CI results #545

Closed peytondmurray closed 9 months ago

peytondmurray commented 9 months ago

Context

Currently, tests are failing on CI:

image

Expectation

Tests should pass.

Bug

The tests are failing with the following message:

==================================== ERRORS ====================================
_____________________ ERROR at setup of test_codecell_file _____________________
file /home/runner/work/MyST-NB/MyST-NB/tests/test_codecell_file.py, line 6
  @pytest.mark.sphinx_params(
      "mystnb_codecell_file.md",
      conf={"nb_execution_mode": "cache", "source_suffix": {".md": "myst-nb"}},
  )
  def test_codecell_file(sphinx_run, file_regression, check_nbs, get_test_path):
file /home/runner/work/MyST-NB/MyST-NB/tests/conftest.py, line 150
  @pytest.fixture()
  def sphinx_run(sphinx_params, make_app, tempdir):
E       fixture 'tempdir' not found
>       available fixtures: _shared_result_cache, anyio_backend, anyio_backend_name, anyio_backend_options, app, app_params, build_matplotlib_font_cache, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, check_nbs, clean_doctree, cov, data_regression, datadir, dataframe_regression, doctest_namespace, file_regression, get_test_path, if_graphviz_found, image_regression, make_app, monkeypatch, ndarrays_regression, no_cover, num_regression, original_datadir, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, rollback_sysmodules, rootdir, shared_datadir, shared_result, sphinx_params, sphinx_run, sphinx_test_tempdir, status, test_params, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, warning
>       use 'pytest --fixtures [testpath]' for help on them.

This happens because the sphinx_run fixture provided by myst-nb relies on a tempdir fixture provided by Sphinx that appears to have been removed some time between 6.2.1 and 7.2.6.

Problem

This is a problem because this seems to be a release blocker, and as such it is blocking people from upgrading sphinx:

Reproduce the bug

  1. Clone the repo
  2. pip install .[testing]
  3. pytest

List your environment

This is currently affecting environments with python>3.8.

welcome[bot] commented 9 months ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada: