Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: suppress jinja2 deprecation warning #14760

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

rgommers
Copy link
Member

@rgommers rgommers commented Sep 21, 2021

This is triggered by Sphinx, which is imported during test discovery for
doc/sphinxext/numpydoc/tests/test_numpydoc.py,
and breaks running the test suite in a development branch.

Relevant part of the traceback:

____________ ERROR collecting doc/sphinxext/numpydoc/tests/test_numpydoc.py ____________
../scipy/doc/sphinxext/numpydoc/tests/test_numpydoc.py:3: in <module>
    from numpydoc.numpydoc import mangle_docstrings, _clean_text_signature

...

        __name__   = 'sphinx.jinja2glue'
        __package__ = 'sphinx'
        __spec__   = ModuleSpec(name='sphinx.jinja2glue', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f014be80070>, origin='/home/rgommers/anaconda3/envs/scipy-dev/lib/python3.8/site-packages/sphinx/jinja2glue.py')
        __warningregistry__ = {'version': 126}
        _slice_index = <function _slice_index at 0x7f014c001d30>
        _tobool    = <function _tobool at 0x7f014c001430>
        _todim     = <function _todim at 0x7f014c001ca0>
        _toint     = <function _toint at 0x7f014c001c10>
        accesskey  = <function accesskey at 0x7f014c001dc0>
        contextfunction = <function contextfunction at 0x7f014cfb8160>
        idgen      = <class 'sphinx.jinja2glue.idgen'>
        logging    = <module 'sphinx.util.logging' from '/home/rgommers/anaconda3/envs/scipy-dev/lib/python3.8/site-packages/sphinx/util/logging.py'>
        mtimes_of_files = <function mtimes_of_files at 0x7f014c9d28b0>
        open_if_exists = <function open_if_exists at 0x7f014cfb8670>
        path       = <module 'posixpath' from '/home/rgommers/anaconda3/envs/scipy-dev/lib/python3.8/posixpath.py'>
        pformat    = <function pformat at 0x7f015b839940>
../../anaconda3/envs/scipy-dev/lib/python3.8/site-packages/jinja2/utils.py:110: in contextfunction
    warnings.warn(
E   DeprecationWarning: 'contextfunction' is renamed to 'pass_context', the old name will be removed in Jinja 3.1.

EDIT: relevant package versions:

jinja2                    3.0.1              pyhd8ed1ab_0    conda-forge
numpydoc                  1.1.0                      py_1    conda-forge
sphinx                    3.5.4              pyh44b312d_0    conda-forge

This is triggered by Sphinx, which is imported during test discovery for
doc/sphinxext/numpydoc/tests/test_numpydoc.py,
and breaks running the test suite in a development branch.

Relevant part of the traceback:
```
____________ ERROR collecting doc/sphinxext/numpydoc/tests/test_numpydoc.py ____________
../scipy/doc/sphinxext/numpydoc/tests/test_numpydoc.py:3: in <module>
    from numpydoc.numpydoc import mangle_docstrings, _clean_text_signature

...

        __name__   = 'sphinx.jinja2glue'
        __package__ = 'sphinx'
        __spec__   = ModuleSpec(name='sphinx.jinja2glue', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f014be80070>, origin='/home/rgommers/anaconda3/envs/scipy-dev/lib/python3.8/site-packages/sphinx/jinja2glue.py')
        __warningregistry__ = {'version': 126}
        _slice_index = <function _slice_index at 0x7f014c001d30>
        _tobool    = <function _tobool at 0x7f014c001430>
        _todim     = <function _todim at 0x7f014c001ca0>
        _toint     = <function _toint at 0x7f014c001c10>
        accesskey  = <function accesskey at 0x7f014c001dc0>
        contextfunction = <function contextfunction at 0x7f014cfb8160>
        idgen      = <class 'sphinx.jinja2glue.idgen'>
        logging    = <module 'sphinx.util.logging' from '/home/rgommers/anaconda3/envs/scipy-dev/lib/python3.8/site-packages/sphinx/util/logging.py'>
        mtimes_of_files = <function mtimes_of_files at 0x7f014c9d28b0>
        open_if_exists = <function open_if_exists at 0x7f014cfb8670>
        path       = <module 'posixpath' from '/home/rgommers/anaconda3/envs/scipy-dev/lib/python3.8/posixpath.py'>
        pformat    = <function pformat at 0x7f015b839940>
../../anaconda3/envs/scipy-dev/lib/python3.8/site-packages/jinja2/utils.py:110: in contextfunction
    warnings.warn(
E   DeprecationWarning: 'contextfunction' is renamed to 'pass_context', the old name will be removed in Jinja 3.1.
```
@rgommers rgommers added the maintenance Items related to regular maintenance tasks label Sep 21, 2021
@tylerjereddy tylerjereddy added this to the 1.8.0 milestone Sep 22, 2021
Copy link
Contributor

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I note another unrelated CI failure popping up (one of them below the fold). @mdhaber have you seen that one sporadically (I haven't had a chance to scan all recent issues yet)

________________ TestStudentizedRange.test_moment_vectorization ________________
[gw0] linux -- Python 3.8.0 /usr/bin/python3.8
scipy/stats/tests/test_distributions.py:4628: in test_moment_vectorization
    m = stats.studentized_range._munp([1, 2], [4, 5], [10, 11])
        self       = <scipy.stats.tests.test_distributions.TestStudentizedRange object at 0xd1874d00>
scipy/stats/_continuous_distns.py:9495: in _munp
    return np.float64(ufunc(K, k, df))
E   RuntimeWarning: invalid value encountered in ? (vectorized)
        K          = [1, 2]
        _a         = 0
        _b         = inf
        _single_moment = <function studentized_range_gen._munp.<locals>._single_moment at 0xd1853fa0>
        cython_symbol = '_studentized_range_moment'
        df         = [10, 11]
        k          = [4, 5]
        self       = <scipy.stats._continuous_distns.studentized_range_gen object at 0xeba21520>
        ufunc      = <ufunc '? (vectorized)'>
- generated xml file: /scipy/build/testenv/lib/python3.8/site-packages/junit/test-results.xml -

@tylerjereddy tylerjereddy merged commit 69ac1be into scipy:master Sep 22, 2021
@rgommers rgommers deleted the suppress-jinja2-warning branch September 22, 2021 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants