Add support for Python 3.14 · Issue #841 · nteract/papermill · GitHub
Skip to content

Add support for Python 3.14 #841

Open

Description

@willingc

🚀 Feature

Support Python 3.14.

Activity

  1. willingc commented on Nov 14, 2025

    @willingc
    MemberAuthor

    Test results on Python 3.14

    _________________________________________ TestBrokenNotebook1.test __________________________________________
    
    self = <papermill.tests.test_execute.TestBrokenNotebook1 testMethod=test>
    
        def test(self):
            path = get_notebook_path('broken1.ipynb')
        
            # check that the notebook has two existing marker cells, so that this test is sure to be
            # validating the removal logic (the markers are simulating an error in the first code cell
            # that has since been fixed)
            original_nb = load_notebook_node(path)
            self.assertEqual(original_nb.cells[0].metadata["tags"], ["papermill-error-cell-tag"])
            self.assertIn("In [1]", original_nb.cells[0].source)
            self.assertEqual(original_nb.cells[2].metadata["tags"], ["papermill-error-cell-tag"])
        
            result_path = os.path.join(self.test_dir, 'broken1.ipynb')
            with self.assertRaises(PapermillExecutionError):
                execute_notebook(path, result_path)
            nb = load_notebook_node(result_path)
            self.assertEqual(nb.cells[0].cell_type, "markdown")
            self.assertRegex(nb.cells[0].source, r'^<span .*<a href="#papermill-error-cell".*In \[2\].*</span>$')
            self.assertEqual(nb.cells[0].metadata["tags"], ["papermill-error-cell-tag"])
        
            self.assertEqual(nb.cells[1].cell_type, "markdown")
            self.assertEqual(nb.cells[2].execution_count, 1)
            self.assertEqual(nb.cells[3].cell_type, "markdown")
            self.assertEqual(nb.cells[4].cell_type, "markdown")
        
            self.assertEqual(nb.cells[5].cell_type, "markdown")
            self.assertRegex(nb.cells[5].source, '<span id="papermill-error-cell" .*</span>')
            self.assertEqual(nb.cells[5].metadata["tags"], ["papermill-error-cell-tag"])
            self.assertEqual(nb.cells[6].execution_count, 2)
    >       self.assertEqual(nb.cells[6].outputs[0].output_type, 'error')
    E       AssertionError: 'stream' != 'error'
    E       - stream
    E       + error
    
    papermill/tests/test_execute.py:162: AssertionError
    ------------------------------------------- Captured stderr call --------------------------------------------
    Executing:  83%|██████████████████████████████████████████████████          | 5/6 [00:00<00:00,  6.60cell/s]
    ============================================= warnings summary ==============================================
    papermill/tests/test_iorw.py::TestPapermillIO::test_read
    papermill/tests/test_iorw.py::TestPapermillIO::test_write
      /Users/willingc/Code/repos-nteract/papermill/papermill/iorw.py:149: UserWarning: the file is not specified with any extension : path
        warnings.warn(f"the file is not specified with any extension : {os.path.basename(path)}")
    
    papermill/tests/test_iorw.py::TestPapermillIO::test_read_stdin
    papermill/tests/test_iorw.py::TestPapermillIO::test_write_stdout
      /Users/willingc/Code/repos-nteract/papermill/papermill/iorw.py:149: UserWarning: the file is not specified with any extension : -
        warnings.warn(f"the file is not specified with any extension : {os.path.basename(path)}")
    
    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
    ============================================== tests coverage ===============================================
    _____________________________ coverage: platform darwin, python 3.14.0-final-0 ______________________________
    
    Name                        Stmts   Miss  Cover
    -----------------------------------------------
    papermill/__init__.py           4      0   100%
    papermill/__main__.py           1      1     0%
    papermill/abs.py               33      0   100%
    papermill/adl.py               34      0   100%
    papermill/cli.py              116      4    97%
    papermill/clientwrap.py        55      5    91%
    papermill/engines.py          191      8    96%
    papermill/exceptions.py        36      6    83%
    papermill/execute.py           83      0   100%
    papermill/inspection.py        57      0   100%
    papermill/iorw.py             344     67    81%
    papermill/log.py                2      0   100%
    papermill/models.py             2      0   100%
    papermill/parameterize.py      49      1    98%
    papermill/s3.py               197     43    78%
    papermill/translators.py      368      8    98%
    papermill/utils.py             63      3    95%
    -----------------------------------------------
    TOTAL                        1635    146    91%
    ========================================== short test summary info ==========================================
    FAILED papermill/tests/test_execute.py::TestBrokenNotebook1::test - AssertionError: 'stream' != 'error'
    ================================ 1 failed, 546 passed, 4 warnings in 54.76s =================================
    py314: exit 1 (56.51 seconds) /Users/willingc/Code/repos-nteract/papermill> pytest -v --maxfail=2 --cov=papermill -W always pid=19907
      py314: FAIL code 1 (83.98=setup[27.47]+cmd[56.51] seconds)
      evaluation failed :( (84.02 seconds)
    
  2. costajohnt commented on Mar 12, 2026

    @costajohnt

    I'd like to work on this. Based on the test output, the fix involves updating TestBrokenNotebook1 (and potentially TestBrokenNotebook2) to handle Python 3.14's changed output ordering for assertion errors, plus adding 3.14 to the CI matrix, tox config, and pyproject.toml classifiers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions