mirror of https://github.com/ansible/ansible.git
ansible-test - Pin rstcheck version. (#77584)
* ansible-test - Pin rstcheck version. * ansible-test - Support newer Jinja2 versions for rstcheck sanity test.pull/77882/head
parent
109cf5d3d7
commit
5859e99a30
@ -0,0 +1,3 @@
|
||||
bugfixes:
|
||||
- ansible-test - Add ``rstcheck == 3.3.1`` constraint to avoid breaking changes in newer releases.
|
||||
- ansible-test - Support newer Jinja2 versions in the ``rstcheck`` sanity test.
|
@ -0,0 +1,19 @@
|
||||
"""Wrapper around rstcheck to provide Jinja2 compatibility for Sphinx."""
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import os
|
||||
import runpy
|
||||
import sys
|
||||
|
||||
try:
|
||||
from jinja2.filters import pass_context as _passctx, pass_environment as _passenv
|
||||
_mod = sys.modules['jinja2'] # pylint: disable=invalid-name
|
||||
_mod.contextfunction = _passctx
|
||||
_mod.environmentfilter = _passenv
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
sys.path.remove(os.path.dirname(__file__)) # avoid recursively running sanity test
|
||||
|
||||
runpy.run_module('rstcheck', run_name='__main__', alter_sys=True)
|
Loading…
Reference in New Issue