CrossNox / m2r2

Markdown to reStructuredText converter
https://crossnox.github.io/m2r2
MIT License
107 stars 26 forks source link

v0.3.3 is incompatible with `sphinx-rtd-theme 1.0.0` #55

Closed ReenigneArcher closed 1 year ago

ReenigneArcher commented 1 year ago

v0.3.3 is incompatible with sphinx-rtd-theme 1.0.0. Because of ReadTheDocs this is probably the most popular theme for sphinx.

The conflict is caused by:
    m2r2 0.3.3 depends on docutils>=0.19
    sphinx 5.1.1 depends on docutils<0.20 and >=0.14
    sphinx-rtd-theme 1.0.0 depends on docutils<0.18
demberto commented 1 year ago

That's not the only one, its even incompatible with myst_parser. Please consider downgrading to docutils 0.18.0.

CrossNox commented 1 year ago

Use v0.3.2

ReenigneArcher commented 1 year ago

Use v0.3.2

Of course, no other option for now.

Could you not incorporate some logic to handle using an older version of docutils?

demberto commented 1 year ago

Could you not incorporate some logic to handle using an older version of docutils?

There's nothing than can be done, other bigger libs need to switch over to latest version of docutils.

You could pin down a version of m2r2 in your build config by m2r2==0.3.2

ReenigneArcher commented 1 year ago

You could pin down a version of m2r2 in your build config by m2r2==0.3.2

That's exactly what I do. All my projects are failing on the dependabot update.

Example: https://github.com/LizardByte/Sunshine/pull/327

There's nothing than can be done

Of course there is. It's quite easy to handle import logic... try/except/else/finally or if/else.

Untested, but this should do the trick.

import mistune
from docutils import io, nodes, statemachine, utils
from docutils.parsers import rst
from docutils.utils import column_width
from pkg_resources import get_distribution

try:
    ErrorString = io.error_string
except:
    from docutils.core import ErrorString

# use ErrorString in code below

Above code is based on this PR: https://github.com/CrossNox/m2r2/pull/49/files ... I don't know if there multiple PRs to handle the update of docutils to v0.19.

Since readthedocs is supporting python 2.7 still, it's unlikely they'll make v0.19 of docutils a requirement and probably instead stick with < 0.18.

ReenigneArcher commented 1 year ago

I see that there were two new versions for 0.3.3. Is it possible to redact 0.3.3 from pypi in favor of the post2 version?

The original 0.3.3 is still installable under Python 2.7.