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 update to new upstream. #1174

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

sth0
Copy link
Contributor

@sth0 sth0 commented Nov 2, 2024

Split version for old/new build system
update to version 0.21 for python 3.9 and 3.10
update to 0.18 for earlier python (2.7. 3.7 and 3.8)
for some reason rstpep2html not copied to install directory, not defined in build as script to install
package needs to have PYTHONPATH set to use recently built tools and not rely on tools already being installed version of rst2html

Builds on macOS 15.X and CLT 16.X

Did not run self-tests since requires mock which does not yet build/install on macOS15.X / CLT 16
Normal build of documentation seems to require pygments package, should that be included as a dependency?

math documentation seems to require tex formatting? Should that also be a dependency?

Problem making math documentation?
Making ./ref/rst/mathematics.html

  • Unknown equation environment aligned
  • No tag in OneParamFunction read in \underline{gbi}
  • No tag in OneParamFunction read in \underline{gbi}
  • Unknown command \varlimsup
  • Unknown command \varliminf
  • Unknown command \varprojlim

Error (should be a dependency?
Making ./user/manpage.html
./user/manpage.txt:74: (WARNING/2) Cannot analyze code. Pygments package not found.
./user/manpage.txt:86: (WARNING/2) Cannot analyze code. Pygments package not found.
Making ./dev/hacking.html
./dev/hacking.txt:75: (WARNING/2) Cannot analyze code. Pygments package not found.

@sth0 sth0 added help wanted new upstream Package has an updated upstream version labels Nov 2, 2024
@sth0
Copy link
Contributor Author

sth0 commented Nov 15, 2024

Added pygments-py to test depends for current system
Still has problem building math documentation, but I think that is in the existing build
Error in deb file?
Error: File in a language-versioned package does not have a pathname specific to that version.
Offending file: /opt/sw/bin/docutils

Problem making math documentation?
Making ./ref/rst/mathematics.html
Unknown equation environment aligned
No tag in OneParamFunction read in \underline{gbi}
No tag in OneParamFunction read in \underline{gbi}
Unknown command \varlimsup
Unknown command \varliminf
Unknown command \varprojlim

Other errors in documentation? These look like typos in the documentation itself?
Making ./peps/pep-0257.html
./peps/pep-0257.txt:6: (ERROR/3) Unexpected indentation.
./peps/pep-0257.txt:7: (WARNING/2) Block quote ends without a blank line; unexpected unindent.

@sth0
Copy link
Contributor Author

sth0 commented Nov 26, 2024

In validation there is an error in the deb file. Since I have never messed with multi-lingual files any advice would be appreciated. The deb builds and installs.
Validating .deb dir /opt/sw/src/fink.build/root-docutils-py310-0.21.2-1... Error: File in a language-versioned package does not have a pathname specific to that version. Offending file: /opt/sw/bin/docutils ... Failed: phase .deb validation: docutils-py310-0.21.2-1 failed

Copy link
Contributor

@dhomeier dhomeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In validation there is an error in the deb file. Since I have never messed with multi-lingual files any advice would be appreciated. The deb builds and installs.

Seems there was a docutils executable added, including it to the update_alternatives set should fix this.

done

cd %i/bin
for i in rst2* rstpep2html.py; do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for i in rst2* rstpep2html.py; do
for i in docutils rst2* rstpep2html.py; do

Copy link
Contributor Author

@sth0 sth0 Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Ah, that is python version not a spoken language version that is the problem.
should the line
cp %b/tools/rstpep2html.py %i/bin
also be python versioned? Something like this to be consistent?
cp %b/tools/rstpep2html.py %i/bin/rstpep2html-%type_raw[python].py
(This is only in the docutils-py.info since version 0.21.2 build rstpep2html in a different directory.)

So now the only error is that the mathematics.html docs file has all this unknown TeX/LaTeX symbols. Should TeX be a prerequisite? At the moment I can't build TeXLive due to errors and test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I missed there are two distribution versions. Since it's also installed into %i/bin, it should need to be python-versioned or validation should fail as well.

TeXLive would be a quite heavy dependency, though probably a recommendation, as one of the principal outputs is to LaTeX format. It would seem like it has its own TeX parser if it gets that far though, just having problems with some mathtex commands.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, TeXLive would be a heavy lift. But if it has its own TeX parser why is the building of the documentation failing like that? If I can get TeXLive built and installed, I will see if the errors go away. Probably but something in the build notes that the mathematics documentation doesn't build unless you have it installed?

But still baffled by inability to get TeXLive-texmf to install.

<<

PostInstScript: <<
for i in rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html; do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for i in rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html; do
for i in docutils rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html; do

@sth0
Copy link
Contributor Author

sth0 commented Dec 8, 2024

That TeX like formatting that is showing errors in building documentation needs at least two external programs. latexml and latexmlpost and possibly pandoc and ttm? I don't think these are provided by any of the fink packages.

@sth0
Copy link
Contributor Author

sth0 commented Dec 8, 2024

I have the requested changes, but docutils-py38 will not build/validate the version 0.18.1. Python 3.8 random() function is trying to "from math import log as _log" and it is using the docutils math module and not the builtin Python module.

Making BUGS.html
Traceback (most recent call last):
File "/opt/sw/src/fink.build/docutils-py38-0.18.1-1/docutils-0.18.1/docutils/writers/init.py", line 147, in get_writer_class
module = import_module('docutils.writers.'+writer_name)
File "/opt/sw/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 843, in exec_module
File "", line 219, in _call_with_frames_removed
File "/opt/sw/src/fink.build/docutils-py38-0.18.1-1/docutils-0.18.1/docutils/writers/html4css1/init.py", line 23, in
from docutils.writers import _html_base
File "/opt/sw/src/fink.build/docutils-py38-0.18.1-1/docutils-0.18.1/docutils/writers/_html_base.py", line 30, in
from docutils.parsers.rst.directives.images import PIL
File "/opt/sw/src/fink.build/docutils-py38-0.18.1-1/docutils-0.18.1/docutils/parsers/rst/directives/images.py", line 31, in
from urllib.request import url2pathname
File "/opt/sw/lib/python3.8/urllib/request.py", line 88, in
import http.client
File "/opt/sw/lib/python3.8/http/client.py", line 71, in
import email.parser
File "/opt/sw/lib/python3.8/email/parser.py", line 12, in
from email.feedparser import FeedParser, BytesFeedParser
File "/opt/sw/lib/python3.8/email/feedparser.py", line 27, in
from email._policybase import compat32
File "/opt/sw/lib/python3.8/email/_policybase.py", line 9, in
from email.utils import _has_surrogates
File "/opt/sw/lib/python3.8/email/utils.py", line 28, in
import random
File "/opt/sw/lib/python3.8/random.py", line 41, in
from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
ImportError: cannot import name 'log' from 'math' (/opt/sw/src/fink.build/docutils-py38-0.18.1-1/docutils-0.18.1/docutils/utils/math/init.py)

@dhomeier
Copy link
Contributor

dhomeier commented Dec 9, 2024

I have the requested changes, but docutils-py38 will not build/validate the version 0.18.1. Python 3.8 random() function is trying to "from math import log as _log" and it is using the docutils math module and not the builtin Python module.

Sounds oddly familiar, but no idea, why this would only show up with Python 3.8. The problem with exposing its own math modules seems to have been fixed as of docutils 0.19.1, which still supports 3.8, but that would be yet another versioned clone...

@sth0
Copy link
Contributor Author

sth0 commented Dec 9, 2024

I can try for updating to 0.19.1 for <= python 3.8. It also seems that the old docutils-py did not require setuptools as a build depends either.

@sth0
Copy link
Contributor Author

sth0 commented Dec 10, 2024

I am not sure that it only shows up with python 3.8, it may have conflicts with previous versions, I didn't test for < 3.8
I don't see a 19.1 release. https://pypi.org/project/docutils/#history
I will implement 19.b1 though I am hesitant to introduce beta versions.

@sth0
Copy link
Contributor Author

sth0 commented Dec 10, 2024

Got the same error trying to use Docutils-0.19b1.
File "/opt/sw/lib/python3.8/random.py", line 41, in
from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
ImportError: cannot import name 'log' from 'math' (/opt/sw/src/fink.build/docutils-py38-0.19b1-1/docutils-0.19b1/docutils/utils/math/init.py)

Tried to test python 3.7 but that version of python does not pass tests:
ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2570)

If I disable testing Python 3.7 installs but docutils returns the same error.

@dhomeier
Copy link
Contributor

dhomeier commented Dec 11, 2024

I don't see a 19.1 release. https://pypi.org/project/docutils/#history
I will implement 19.b1 though I am hesitant to introduce beta versions.

Sorry, misread the version info on the 0.19-1 I had installed; of course that should be the released 0.19 rather than a beta!
The actual issue was setting PYTHONPATH=..:../docutils/utils to actually force importing its own math module, see opening comment in #935 where this was already fixed, but unfortunately got stuck in the update-alternatives quagmire.
I take it from the versioned info files there that 0.18.1 did also work with PYTHONPATH=...

…to avoid conflicts, version 0.21.2 still builds for python 3.9 and 3.10. Passes validation and testing.
@sth0
Copy link
Contributor Author

sth0 commented Dec 11, 2024

That hint did the trick, this push validates and passes testing for python 3.7, 3.8 with version 0.19 and python 3.10 with version 0.21.2.

@sth0 sth0 requested a review from dhomeier December 14, 2024 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted new upstream Package has an updated upstream version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants