MyST-Parser icon indicating copy to clipboard operation
MyST-Parser copied to clipboard

Please test with Docutils 0.19b1

Open AA-Turner opened this issue 3 years ago • 6 comments
trafficstars

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 with python -m pip install "git+https://repo.or.cz/docutils.git#subdirectory=docutils".

Thanks, Adam

AA-Turner avatar Jun 26 '22 12:06 AA-Turner

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:

welcome[bot] avatar Jun 26 '22 12:06 welcome[bot]

Cheers for the notification @AA-Turner !

chrisjsewell avatar Jun 26 '22 12:06 chrisjsewell

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


flokli avatar Aug 03 '22 12:08 flokli

Your test expectations should be changed, the location of PEPs moved. Good that this was the only failure!

A

AA-Turner avatar Aug 03 '22 22:08 AA-Turner

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.

flokli avatar Aug 04 '22 06:08 flokli

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…

flokli avatar Aug 04 '22 07:08 flokli