Skip to content

doctest GitHub Actions job exits with 2 failing all recent PRs #101639

Description

@arhadthedev

The Docs / Doctest (pull_request) check started to fail recently with the following job log:

make: Entering directory '/home/runner/work/cpython/cpython/Doc'
make[1]: Entering directory '/home/runner/work/cpython/cpython/Doc'
mkdir -p build

Missing the required blurb or sphinx-build tools.
Please run 'make venv' to install local copies.

make[1]: *** [Makefile:48: build] Error 1
make[1]: Leaving directory '/home/runner/work/cpython/cpython/Doc'
Testing of doctests in the sources finished, look at the results in build/doctest/output.txt
make: *** [Makefile:1[2](https://github.com/python/cpython/actions/runs/4113297888/jobs/7099253477#step:9:2)[7](https://github.com/python/cpython/actions/runs/4113297888/jobs/7099253477#step:9:8): doctest] Error 1
make: Leaving directory '/home/runner/work/cpython/cpython/Doc'
Error: Process completed with exit code 2.

@colorfulappl found out that:

It seems like numpy build failed while running

make -C Doc/ PYTHON=../python venv

The error message is

Error:             numpy/random/_mt19937.c:8320:53: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
             8320 |             const digit* digits = ((PyLongObject*)x)->ob_digit;
                  |                                                     ^~

It looks like gh-101292 is the cause. We need to provide some sort of compatibility shim or a deprecation period until numpy introduces version-specific #if guards.

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    testsTests in the Lib/test dir
    docsDocumentation in the Doc dir
    on Feb 7, 2023
  2. changed the title [-]`doctest` GitHub Actions job exits with `2` marking checks of all recent PRs[/-] [+]`doctest` GitHub Actions job exits with `2` failing all recent PRs[/+] on Feb 7, 2023
  3. Yhg1s commented on Feb 7, 2023

    @Yhg1s
    Member

    I think the fundamental problem here is that the doc build/test process uses the newly built Python and third-party dependencies from PyPI. I don't think it's bad to test that certain things work in the new Python, but expecting installable packages for the target Python is a bit problematic for two reasons: the Python we're building may be too new for the packages (as in this case), or the Python may be too old (for example when building docs for an older Python that the dependencies have already stopped supporting).

  4. hugovk commented on Feb 7, 2023

    @hugovk
    Member

    One of the Sphinx extensions we're using just released (in 0.8.0) support for generating images via Matplotlib, which depends on NumPy: sphinx-doc/sphinxext-opengraph#88

    Even though we're not using the image generation there (yet, we may do later), it still attempts the install and import.

    The quick fix is to pin sphinxext-opengraph to 0.5.9.

    Alternatively, for the benefit of downstream redistributors, we did take care that if the extension isn't installed, it won't be used:

    cpython/Doc/conf.py

    Lines 27 to 33 in 7990324

    # Skip if downstream redistributors haven't installed it
    try:
    import sphinxext.opengraph
    except ImportError:
    pass
    else:
    extensions.append('sphinxext.opengraph')

    For doctest, we could also make use of this and only install the key essentials for the test.

  5. arhadthedev commented on Feb 7, 2023

    @arhadthedev
    MemberAuthor

    Fixed by gh-101642.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirtestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions