executablebooks / rst-to-myst

Convert ReStructuredText to MyST Markdown
https://rst-to-myst.readthedocs.io
MIT License
59 stars 10 forks source link

Bump sphinx version #63

Closed zubieta closed 1 year ago

zubieta commented 1 year ago

Describe the bug

context I have a project where I want to export the output to both html and commonmark, but the usage of sphinx version <5 makes is impossible to use with other sphinx extensions that require newer versions (furo is an example).

expectation I should be able to run rst2myst alongside furo.

bug But instead I see an error when trying to install them together that states that rst-to-myst and furohave incompatible sphinx version requirements.

problem This is a problem for people installing rst-to-myst and furo or other extensions that depend on sphinx>=5.

Reproduce the bug

$ poetry add sphinx rst-to-myst furo
Using version ^6.2.1 for sphinx
Using version ^0.3.4 for rst-to-myst
Using version ^2023.3.27 for furo

Updating dependencies
Resolving dependencies... (1.0s)

Because no versions of rst-to-myst match >0.3.4,<0.4.0
 and rst-to-myst (0.3.4) depends on docutils (>=0.15,<0.18), rst-to-myst (>=0.3.4,<0.4.0) requires docutils (>=0.15,<0.18).
And because sphinx (6.2.1) depends on docutils (>=0.18.1,<0.20)
 and no versions of sphinx match >6.2.1,<7.0.0, rst-to-myst (>=0.3.4,<0.4.0) is incompatible with sphinx (>=6.2.1,<7.0.0).
So, because myproject depends on both sphinx (^6.2.1) and rst-to-myst (^0.3.4), version solving failed.

List your environment

Python 3.11.3
Poetry 1.4.1
welcome[bot] commented 1 year ago

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:

zubieta commented 1 year ago

Okay, I just ran pip install 'rst-to-myst[sphinx]' furo and it looks like it is able to resolve the dependencies, so it might be an issue with poetry's resolver.

The versions that pip finds as compatible are furo==2022.9.29 and rst-to-myst==0.3.4 under python3.11.

OTOH, I just ran the test suite with a modified tox.iniagainst all the combinations of python versions between 3.7 and 3.11 and sphinx >3 and <7 And I got this results:

py37-sphinx3: FAIL code 1 (24.37=setup[3.94]+cmd[20.43] seconds)
py38-sphinx3: FAIL code 1 (69.00=setup[47.75]+cmd[21.25] seconds)
py39-sphinx3: FAIL code 1 (22.01=setup[3.17]+cmd[18.85] seconds)
py310-sphinx3: FAIL code 1 (29.99=setup[3.47]+cmd[26.52] seconds)
py311-sphinx3: FAIL code 1 (25.10=setup[3.36]+cmd[21.74] seconds)
py37-sphinx4: OK (18.12=setup[3.47]+cmd[14.65] seconds)
py38-sphinx4: OK (38.02=setup[4.21]+cmd[33.81] seconds)
py39-sphinx4: OK (24.94=setup[3.77]+cmd[21.17] seconds)
py310-sphinx4: OK (27.57=setup[2.98]+cmd[24.59] seconds)
py311-sphinx4: OK (24.36=setup[2.59]+cmd[21.77] seconds)
py37-sphinx5: OK (18.09=setup[3.86]+cmd[14.24] seconds)
py38-sphinx5: OK (37.74=setup[3.84]+cmd[33.90] seconds)
py39-sphinx5: OK (24.80=setup[3.73]+cmd[21.07] seconds)
py310-sphinx5: OK (27.58=setup[3.01]+cmd[24.56] seconds)
py311-sphinx5: OK (22.66=setup[2.25]+cmd[20.41] seconds)
py37-sphinx6: FAIL code 1 (2.86 seconds)
py38-sphinx6: OK (81.31=setup[55.30]+cmd[26.01] seconds)
py39-sphinx6: OK (24.37=setup[2.71]+cmd[21.66] seconds)
py310-sphinx6: OK (40.91=setup[29.09]+cmd[11.83] seconds)
py311-sphinx6: OK (16.28=setup[3.19]+cmd[13.09] seconds)

And as you can see, the tests all fail using sphinx <4 for all python versions, as well as for sphinx 6 and python 3.7 (Where support for 3.7 was dropped). So, I would like to suggest changing the sphinx dependencies to >=4.0,<7.

command: `ENVS=$(echo py3{7..11}-sphinx{3..6}) && tox run-parallel -e ${ENVS// /,}` Modified `tox.ini`: ```ini [tox] envlist = py38-sphinx4 [testenv] usedevelop = true [testenv:py{37,38,39,310,311}-sphinx{3,4,5,6}] deps = black flake8 sphinx3: sphinx>=3,<4 sphinx4: sphinx>=4,<5 sphinx5: sphinx>=5,<6 sphinx6: sphinx>=6,<7 extras = sphinx test commands = pytest {posargs} [testenv:cli] extras = sphinx commands = rst2myst {posargs} [testenv:docs-{clean,update}] extras = docs allowlist_externals = rm echo commands = clean: rm -rf docs/_build sphinx-build -n -W --keep-going -c docs/source docs/source docs/_build commands_post = echo "open docs/_build/index.html" [flake8] max-line-length = 100 max-complexity = 13 # These checks violate PEP8 so let's ignore them extend-ignore = E203 ```