Re: [gtk-osx-users] GTK-DOC Required Python3 module 'pygments' not found.





On Jan 9, 2022, at 4:27 AM, Pascal <p p14 orange fr> wrote:


Le 28 déc. 2021 à 21:07, Pascal <p p14 orange fr> a écrit :

Le 28 déc. 2021 à 17:18, john <jralls ceridwen us> a écrit :

On Dec 28, 2021, at 1:48 AM, Pascal <p p14 orange fr> wrote:

Hello,

For this build, I needed Python3, so I did:

%  jhbuild bootstrap-gtk-osx
%  jhbuild build python3
%  jhbuild build meta-gtk-osx-bootstrap
...
*** Configuring gtk-doc *** [8/9]
meson --prefix /usr/local/xnadalib-2021 --libdir lib -Dyelp_manual=false -Dtests=false 
--wrap-mode=nofallback /usr/local/src-2021/gtk-doc-1.33.2
The Meson build system
Version: 0.60.3
Source dir: /usr/local/src-2021/gtk-doc-1.33.2
Build dir: /usr/local/src-2021/cache/jhbuild/build/gtk-doc-1.33.2
Build type: native build
Project name: gtk-doc
Project version: 1.33.1
C compiler for the host machine: /Applications/Xcode.app/Contents/Developer/usr/bin/gcc (clang 13.0.0 
"Apple clang version 13.0.0 (clang-1300.0.29.3)")
C linker for the host machine: /Applications/Xcode.app/Contents/Developer/usr/bin/gcc ld64 711
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES (/usr/local/xnadalib-2021/bin/python3)

../../../../gtk-doc-1.33.2/meson.build:45:4: ERROR: Problem encountered: Required Python3 module 
'pygments' not found

The build used python3 installed in prefix (/usr/local/xnadalib-2021) which is expected, isn't it?

Do I need to install pygments in addition ?
If so how do to it? with jhbuild?
Thanks for help.

If you use pygments instead of python3 in your modules list it will pull in python3 and build pygments 
for you. If you're already into the build it's easier to just drop to a shell and say 'pip3 install 
pygments'.


Thanks John, I did the pip3 with success.

Hello John,

This time, i tried 'jhbuild build pygments'.
It works but pygments is installed in $prefix/lib/python3.10/site-packages.
That's odd if you install before Python3 which is version 3.9.
GTK-DOC is still puzzled.
Then in order to get pygments installed in $prefix/lib/python3.9/site-packages, I propose to change 
jhbuildrc as:

if ('python3' in modules or 'meta-gtk-osx-python3' in modules or
-    'pygments' in modules):
+    'pygments' in modules
+    or 'python3' in sys.argv or 'meta-gtk-osx-python3' in sys.argv
+    or 'pygments' in sys.argv):

What is your feedback?

I think that's getting a bit too convoluted and the whole approach is too fragile. Recalling that the 
original purpose--still required--of the segment was to make sure that libxml2's python module got put in the 
right $PREFIX/lib/pythonxx, none of that will work if the user does
  jhbuild build python3
  jhbuild meta-gtk-osx-bootstrap

Xcode 12's addition of a python3 framework that doesn't include the headers is another problem because pipenv 
is finding it and setting up the virtenv in spite of the directive in Pipfile to use 3.10 which is supposed 
to trigger an automatic build and install of python3.10 and create a virtenv from that. As long as one builds 
and installs python3 into $PREFIX it's not that important, but if one doesn't then building libxml2 and 
pygments will fail for no Python.h.

To add to the fun I discovered yesterday that librsvg has added two more PyPi dependencies, documents and 
go-documentation, in their master branch, and no configure option to disable making documentation and thus to 
avoid them.

It would be nice to have a pip3 module in jhbuild so one could just say
<moduleset>
  <pip3 id="pygments"/>
</moduleset>
and it would do the right thing. That still wouldn't fix libxml2 but it would take care of everything else.

Failing that we need logic in jhbuildrc that looks at the project modules list to see what jhbuild is 
actually going to build and checks for $PREFIX/bin/python3-config to see if python3 is already built. Easiest 
said than done, unfortunately.

Regards,
John Ralls




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]