CLI with local PG processing for static representations

20 views
Skip to first unread message

Alex Jordan

unread,
Jun 6, 2026, 5:05:22 PM (14 days ago) Jun 6
to prete...@googlegroups.com

Rob Beezer

unread,
Jun 6, 2026, 9:31:59 PM (14 days ago) Jun 6
to prete...@googlegroups.com
I think the CLI takes a slightly different approach to specifying executables.
Like PERL.

Speculation:

(a) there is no way (currently) to specify your `perl` executable

(b) the error message when this fails needs some work

But Oscar should have the real answers.

Rob
> Generating any needed assets.
> string parameters passed to extraction stylesheet: {'publisher': '/Users/
> alex.jordan/palladium/publication/publication.xml'}
> discovering source file's directory name: /Users/alex.jordan/palladium/src
> verifying and expanding input directory: /Users/alex.jordan/palladium/src/../
> generated-assets
> input directory expanded to absolute path: /Users/alex.jordan/palladium/
> generated-assets
> verifying and expanding input directory: /Users/alex.jordan/palladium/src/../assets
> input directory expanded to absolute path: /Users/alex.jordan/palladium/assets
> XSL conversion of /Users/alex.jordan/palladium/src/palladium.ptx by /Users/
> alex.jordan/.ptx/2.41.0/core/xsl/extract-pg.xsl
> successful application of /Users/alex.jordan/.ptx/2.41.0/core/xsl/extract-pg.xsl
> XSL conversion of /Users/alex.jordan/palladium/src/palladium.ptx by /Users/
> alex.jordan/.ptx/2.41.0/core/xsl/pretext-ww-problem-sets.xsl
> successful application of /Users/alex.jordan/.ptx/2.41.0/core/xsl/pretext-ww-
> problem-sets.xsl
> XSL conversion of /Users/alex.jordan/palladium/src/palladium.ptx by /Users/
> alex.jordan/.ptx/2.41.0/core/xsl/support/pretext-pg-macros.xsl
> successful application of /Users/alex.jordan/.ptx/2.41.0/core/xsl/support/
> pretext-pg-macros.xsl
> validating, cleaning server URL: https://webwork.pcc.edu <https://webwork.pcc.edu>
> error: Unable to generate webwork.  If you already have a webwork-
> representations.xml file, this might result in unpredictable behavior.
> warning: 'perl'
> Removing temporary directory /var/folders/kz/9h51ybtj493_4f_czy1ty8x40000gr/T/
> ptx-ubewc63t
> Removing temporary directory /var/folders/kz/9h51ybtj493_4f_czy1ty8x40000gr/T/
> ptx-b81ignkj
> Finished generating assets.
>
> string parameters passed to extraction stylesheet: {'publisher': '/Users/
> alex.jordan/palladium/publication/publication.xml'}
> discovering source file's directory name: /Users/alex.jordan/palladium/src
> verifying and expanding input directory: /Users/alex.jordan/palladium/src/../
> generated-assets
> input directory expanded to absolute path: /Users/alex.jordan/palladium/
> generated-assets
> verifying and expanding input directory: /Users/alex.jordan/palladium/src/../assets
> input directory expanded to absolute path: /Users/alex.jordan/palladium/assets
> XSL conversion of /Users/alex.jordan/palladium/src/palladium.ptx by /Users/
> alex.jordan/.ptx/2.41.0/core/xsl/extract-pg.xsl
> successful application of /Users/alex.jordan/.ptx/2.41.0/core/xsl/extract-pg.xsl
> XSL conversion of /Users/alex.jordan/palladium/src/palladium.ptx by /Users/
> alex.jordan/.ptx/2.41.0/core/xsl/pretext-ww-problem-sets.xsl
> successful application of /Users/alex.jordan/.ptx/2.41.0/core/xsl/pretext-ww-
> problem-sets.xsl
> XSL conversion of /Users/alex.jordan/palladium/src/palladium.ptx by /Users/
> alex.jordan/.ptx/2.41.0/core/xsl/support/pretext-pg-macros.xsl
> successful application of /Users/alex.jordan/.ptx/2.41.0/core/xsl/support/
> pretext-pg-macros.xsl
> validating, cleaning server URL: https://webwork.pcc.edu <https://webwork.pcc.edu>
> error: Unable to generate webwork.  If you already have a webwork-
> representations.xml file, this might result in unpredictable behavior.
> warning: 'perl'
> Removing temporary directory /var/folders/kz/9h51ybtj493_4f_czy1ty8x40000gr/T/
> ptx-y7jt67yo
> Removing temporary directory /var/folders/kz/9h51ybtj493_4f_czy1ty8x40000gr/T/
> ptx-wj1twu9b
> Finished generating assets.
>
> critical: There were errors during the generate process.  See above.
> ------------------------
> critical: Generating assets as failed.  Exiting...
>
> ----------------------------------------------------
> While running pretext, the following errors occurred:
>
> (see log messages above or in the 'logs' folder for more information)
> error: Unable to generate webwork.  If you already have a webwork-
> representations.xml file, this might result in unpredictable behavior.
> error: Unable to generate webwork.  If you already have a webwork-
> representations.xml file, this might result in unpredictable behavior.
> critical: There were errors during the generate process.  See above.
> critical: Generating assets as failed.  Exiting...
> ----------------------------------------------------
> alex.jordan@CASS317M4138 palladium % ls generated-assets/webwork
> images pg
> alex.jordan@CASS317M4138 palladium % ls generated-assets/webwork
>
>
>
>
> --
> Alex Jordan
> Mathematics Instructor
> Portland Community College
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-dev...@googlegroups.com <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> CA%2BR-jrd-sUN26CczRyKpz8ZtTS8_P7_iJQ5Y%2BDNVdL4R4zW5Zw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-dev/CA%2BR-jrd-
> sUN26CczRyKpz8ZtTS8_P7_iJQ5Y%2BDNVdL4R4zW5Zw%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.

Oscar Levin

unread,
Jun 6, 2026, 10:29:13 PM (14 days ago) Jun 6
to prete...@googlegroups.com
I do not know what is required to build webwork locally, but I can confirm that the CLI is not expecting a `perl` executable.  I'm adding that to the next release (2.41.1) which should be available in a few minutes.  Maybe just having a default value is all that you will need.

The "warning: perl: is just the exception that is coming through from core.  You can get a better error message I suspect by running `pretext -v debug generate webwork`.

To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDA0NS5iZWV6ZXI.1780795917%40pnsh.

Alex Jordan

unread,
Jun 6, 2026, 10:47:27 PM (14 days ago) Jun 6
to prete...@googlegroups.com
Thanks Oscar. After getting 2.41.1, I only get errors from trying to use the CLI. For example:

alex.jordan@CASS317M4138 palladium % pretext --version            
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pretext/core/__init__.py", line 2, in <module>
    from .pretext import *
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pretext/core/pretext.py", line 128, in <module>
    from . import common
ImportError: cannot import name 'common' from partially initialized module 'pretext.core' (most likely due to a circular import) (/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pretext/core/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/bin/pretext", line 3, in <module>
    from pretext.cli import main
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pretext/cli.py", line 21, in <module>
    from . import (
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pretext/utils.py", line 30, in <module>
    from . import core, constants, resources, VERSION
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pretext/core/__init__.py", line 6, in <module>
    raise ImportError(
ImportError: Failed to import the core pretext.py file. Perhaps the file is unavailable? Run `scripts/fetch_core.py` to grab a copy of pretex core.
The original error message is: cannot import name 'common' from partially initialized module 'pretext.core' (most likely due to a circular import) (/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pretext/core/__init__.py)

Rob Beezer

unread,
Jun 6, 2026, 11:47:55 PM (14 days ago) Jun 6
to prete...@googlegroups.com
The Python got re-architected slightly, just a few days ago. common.py is one of the new files, so the tail end of your log is concerning.

You could check if it is with pretext.py, webwork.py, and stack.py wherever the CLI puts these.
>> https://groups.google.com/d/msgid/pretext-dev/CAOU9BaVJJTBGUP%3DtrRrbh5ffSa3u_w2k1MFLvK0snrTWCt5bhw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pretext-dev/CAOU9BaVJJTBGUP%3DtrRrbh5ffSa3u_w2k1MFLvK0snrTWCt5bhw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

Oscar Levin

unread,
Jun 7, 2026, 11:04:40 AM (13 days ago) Jun 7
to PreTeXt development
This is my fault.  I forgot to adjust one of the spots that needed attention with the new python architecture.  Will release a patch momentarily.  
Reply all
Reply to author
Forward
0 new messages