Re: docutils-py310 does not build
Scott Hannahs via Fink-users <[email protected]> Wed, 14 Aug 2024 19:03:42 -0400
| Newsgroups | gmane.os.apple.fink.general |
|---|---|
| Message-ID | <[email protected]> |
Argggh…
So it turns out that docutils v0.14 is out of date and the current version 0.21.2 does not support earlier python versions.
So version 0.18.1 will work with python 2.7 to 3.8
version 0.21.2 will work with python versions 3.9 and 3.10 (3.10 being my target that I need)
The two versions use different build process (setup.py and bootstrap)
So I broke up docutils into two files docutils-0181-py.info <http://docutils-0181-py.info/> and docutils-py.info
In testing docutils-py.info <http://docutils-py.info/> it passes all tests and validates, but if I use the section of code that converts the text document to html it crashes. Not being a python expert I am somewhat of a loss. AFAICT, this goes to the main document and creates html from the text documents (and then later does the same thing recursively to the docs directory. This is in the install script portion of the package.
I think the install/preinstall/preremove is trying to create html versions of the documentation, python versioned copies of the tools and then linking to an unversioned tool. But I may be wrong.
————————
InstallScript: <<
#!/bin/sh -ev
for i in *.txt ; do
htmldoc=${i%%txt}html
echo "Making $htmldoc"
PYTHONPATH=.:docutils %p/bin/python%type_raw[python] tools/rst2html.py $i $htmldoc
done
cd docs
for i in `find . -name '*.txt'` ; do
destdir="%i/share/doc/%n/html/"${i%%/*}
htmldoc=${i%%txt}html
echo "Making $htmldoc"
PYTHONPATH=..:../docutils/utils %p/bin/python%type_raw[python] ../tools/rst2html.py $i $htmldoc
mkdir -p "$destdir"
cp $htmldoc $destdir
done
cd %i/bin
for i in rst2* rstpep2html.py; do
mv $i ${i%%.py}-%type_raw[python].py
done
cd %i
PYTHONPATH=%p/share/bootstrap-modules-python%type_pkg[python] %p/bin/python%type_raw[python] -m installer --destdir %d dist/*.whl
<<
-----------------------
The very first command fails on the first operation processing the BUGS.txt file with the following error.
Making BUGS.html
Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
AttributeError: module 'io' has no attribute 'open'
Current thread 0x00007ff84dfd8dc0 (most recent call first):
<no Python frame>
-----------
Not being a python expert I am confused. It seems that something fundamental is missing to not be able to initialize the standard streams.
-Scott
> On Aug 14, 2024, at 2:22 PM, Scott Hannahs <[email protected]> wrote:
>
> It seems that docutils needs python2.x to build? I gather from duckduckgo that the error "name 'StandardError' is not defined” is a change from python2 to python3? Under MacOS 14 there is no python2 default as “python”.
>
> Making BUGS.html
> Traceback (most recent call last):
> File "/opt/sw/src/fink.build/docutils-py310-0.14-1/docutils-0.14/tools/rst2html.py", line 17, in <module>
> from docutils.core import publish_cmdline, default_description
> File "/opt/sw/src/fink.build/docutils-py310-0.14-1/docutils-0.14/docutils/__init__.py", line 112, in <module>
> class ApplicationError(StandardError):
> NameError: name 'StandardError' is not defined
> …
>
> Package manager version: 0.45.99.git
> Distribution version: selfupdate-git Sat Aug 10 19:42:20 2024, 13.0, x86_64
> Trees: local/injected local/main stable/main
> Xcode.app: 15.4
> Xcode command-line tools: 15.3.0.0.1.1708646388
> Max. Fink build jobs: 1
>
>
> -Scott
>
_______________________________________________
Fink-users mailing list
[email protected]
List archive:
https://sourceforge.net/p/fink/mailman/fink-users/
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-users