Skip to content

Any way to make multiple scripts available in .pex? #2755

Answered by jsirois
mconigliaro asked this question in Q&A
Discussion options

You must be logged in to vote

There are 18 ways to accomplish this. Here's a few by example:

  • Using PEX runtime environment variables:

    :; pex flask gunicorn -o multi-tool.pex
    
    :; PEX_SCRIPT=flask ./multi-tool.pex --version
    Python 3.11.12
    Flask 3.1.0
    Werkzeug 3.1.3
    
    :; PEX_SCRIPT=gunicorn ./multi-tool.pex --help | head
    usage: multi-tool.pex [OPTIONS] [APP_MODULE]
    
    options:
      -h, --help            show this help message and exit
      -v, --version         show program's version number and exit
      -c CONFIG, --config CONFIG
                            :ref:`The Gunicorn config file<configuration_file>`.
                            [./gunicorn.conf.py]
      -b ADDRESS, --bind ADDRESS
                            The socket to bind. [['127.0…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mconigliaro
Comment options

Answer selected by mconigliaro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants