Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docutils 0.21 has removed nodes.reprunicode() and therefore building documentation using m2r2 fails #68

Open
galadash opened this issue Apr 17, 2024 · 5 comments · May be fixed by #69 or #71
Open

Comments

@galadash
Copy link

Our regular Jenkins pipelines to generate documentation have started failing due to a dependency issue caused by a new release of docutils:
view change history here

  • docutils/nodes.py
    • Remove compatibility hacks nodes.reprunicode and nodes.ensure_str().

the following error is raised:

2024-04-17 16:32:18  Exception occurred:
2024-04-17 16:32:18    File "/data/jenkins/workspace/gda-project_gda-bb-utils_main/venv/lib/python3.10/site-packages/m2r2.py", line 611, in run
2024-04-17 16:32:18      path = nodes.reprunicode(path)
2024-04-17 16:32:18  AttributeError: module 'docutils.nodes' has no attribute 'reprunicode'

m2r2 only states a minimum requirement for docutils, and therefore my pipeline fails.
my pipeline exists of the following commands in case this can be of any help:

python3 -m pip install sphinx
python3 -m pip install sphinxcontrib-confluencebuilder
python3 -m pip install autoclasstoc
python3 -m pip install m2r2
sphinx-build -b confluence ./doc/source ./build/confluence

Unfortunately, I'm out of time for today, and if necessary I will add more information tomorrow!

@galadash
Copy link
Author

Just an update:

I found out this issue actually ONLY came to light after Sphinx's update on April 16 (2 days ago).
Sphinx 7.3.0 changes
Sphinx PR #11411
Before that update, as Sphinx was installed before m2r2, it would be leading to install its dependencies, and would have used "docutils>=0.18.1,<0.21",

Current Workaround is to fix the version in my requirements.txt (installed in a previous step in our Jenkins Pipeline) to fix the docutils==0.20.1 or docutils>0.21

@adrien-berchet adrien-berchet linked a pull request Apr 18, 2024 that will close this issue
@drebbe-intrepid
Copy link

came here to say "me too". Adding docutils>=0.18.1,<0.21 to my requirements.txt fixed it.

@ReenigneArcher
Copy link

It seems this repo is no longer maintained, and possibly no longer necessary?

I am going to try myst-parser: LizardByte/.github#373

https://www.sphinx-doc.org/en/master/usage/markdown.html

@CrossNox
Copy link
Owner

If you can, please let us know if that works for you. I maintain it in my very limited free time and am focusing on the mistune v2 migration. The fix seems trivial enough, though.

@ReenigneArcher
Copy link

I think it works and there is a PR up to resolve it. #69

It looks like your test workflow only runs on push events though. Would you like a PR to make it run on pull request events, so you can validate everything works before merging?

2xB added a commit to 2xB/m2r2 that referenced this issue Oct 15, 2024
`docutils.nodes.reprunicode` was until recently just a subclass of `str`. It was removed in this commit: https://sourceforge.net/p/docutils/code/9415/
Therefore `path = nodes.reprunicode(path)` just converted a string to a string and can therefore be removed.

This is an alternative to fixing `docutils` to an old version (as done in CrossNox#69).

Fixes CrossNox#68
@2xB 2xB linked a pull request Oct 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants