MyST-Parser
MyST-Parser copied to clipboard
Please test with Docutils 0.19b1
Hi,
We've just released Docutils 0.19b1, and intend to release 0.19 final on 05/07/2022 (a week on Tuesday). Please would you test with the pre-release, and raise any issues to me either on this issue or on the Docutils tracker?
- The release notes are at: https://docutils.sourceforge.io/RELEASE-NOTES.html#release-0-19b1-2022-06-21
- The detailed change history is at: https://docutils.sourceforge.io/HISTORY.html#release-0-19b1-2022-06-21
- You can install 0.19b1 with
python -m pip install --pre "docutils==0.19b1"or install Docutils' master withpython -m pip install "git+https://repo.or.cz/docutils.git#subdirectory=docutils".
Thanks, Adam
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:
Cheers for the notification @AA-Turner !
I ran this with docutils 0.19, and got the following test failures:
=================================== FAILURES ===================================
____________________ test_docutils_roles[90-pep-reference] _____________________
file_params = ParamTestData(line=90, title='pep-reference', description='(`docutils.parsers.rst.roles.pep_reference_role`):', conten...g/dev/peps/pep-0000">\n PEP 0\n', index=8, fmt=<pytest_param_files.main.DotFormat object at 0x7ffff4fd6ad0>)
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7ffff3ed8dc0>
@pytest.mark.param_file(FIXTURE_PATH / "docutil_roles.md")
def test_docutils_roles(file_params, monkeypatch):
"""Test conversion of Markdown to docutils AST (before transforms are applied)."""
def _apply_transforms(self):
pass
monkeypatch.setattr(Publisher, "apply_transforms", _apply_transforms)
doctree = publish_doctree(
file_params.content,
source_path="notset",
parser=Parser(),
)
> file_params.assert_expected(doctree.pformat(), rstrip_lines=True)
E AssertionError: Actual does not match expected
E --- /build/source/tests/test_renderers/fixtures/docutil_roles.md:90
E +++ (actual)
E @@ -1,4 +1,4 @@
E <document source="notset">
E
E <paragraph>
E
E - <reference refuri="http://www.python.org/dev/peps/pep-0000">
E
E + <reference refuri="https://peps.python.org/pep-0000">
E
E PEP 0
tests/test_renderers/test_fixtures_docutils.py:53: AssertionError
____________________ test_docutils_roles[101-rfc-reference] ____________________
file_params = ParamTestData(line=101, title='rfc-reference', description='(`docutils.parsers.rst.roles.rfc_reference_role`):', conte....org/html/rfc1.html">\n RFC 1\n', index=9, fmt=<pytest_param_files.main.DotFormat object at 0x7ffff4fd6ad0>)
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7ffff40110c0>
@pytest.mark.param_file(FIXTURE_PATH / "docutil_roles.md")
def test_docutils_roles(file_params, monkeypatch):
"""Test conversion of Markdown to docutils AST (before transforms are applied)."""
def _apply_transforms(self):
pass
monkeypatch.setattr(Publisher, "apply_transforms", _apply_transforms)
doctree = publish_doctree(
file_params.content,
source_path="notset",
parser=Parser(),
)
> file_params.assert_expected(doctree.pformat(), rstrip_lines=True)
E AssertionError: Actual does not match expected
E --- /build/source/tests/test_renderers/fixtures/docutil_roles.md:101
E +++ (actual)
E @@ -1,4 +1,4 @@
E <document source="notset">
E
E <paragraph>
E
E - <reference refuri="http://tools.ietf.org/html/rfc1.html">
E
E + <reference refuri="https://tools.ietf.org/html/rfc1.html">
E
E RFC 1
Your test expectations should be changed, the location of PEPs moved. Good that this was the only failure!
A
This was only me passing in docutils 0.19 after relaxing the version bounds in pyproject.toml, and running unit tests. I didn't do any manual testing.
Ugh, I took a closer look. These URLs are hardcoded in the docutil_roles.md fixture file in the repo.
This means the fixtures need to be different, depending on which version of docutils the test suite runs with? :eyes:
I've seen a similar PR at https://github.com/executablebooks/MyST-Parser/pull/478 that patches the fixtures, but don't see where it runs conditionally only with docutils >=0.18…