PEX(1)

πŸ“¦
version 1.5.3 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ’… NAME πŸ’…

hii bestie, this is the manual page for pex β€” yeah, the name is literally just pex, no notes, it's giving minimalist icon behavior. It lives in the User Commands corner of your man pages, section 1. πŸ‘‘


🌸 SYNOPSIS 🌸

pex [-o OUTPUT.PEX] [options] [-- arg1 arg2 ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the vibe: pex builds a PEX (a Python Executable) file, and it does that based on the specifications you hand it β€” your sources, your requirements, all their dependencies, and whatever other options you feel like throwing in there. ✨

It's basically ✨manifesting✨ a self-contained executable out of your specs. Obsessed, honestly. πŸ’–


πŸŽ€ OPTIONS πŸŽ€

no cap, here's every single one. buckle up, bestie, there's a lot and we're doing ALL of them. 🫢

  • --version β€” shows the program's version number and then exits. bye! πŸ‘‹
  • -h, --help β€” shows this help message and exits. the classic.
  • -o PEX_NAME, --output-file=PEX_NAME β€” the name of the generated .pex file. real talk though: if you omit this, PEX just runs immediately and doesn't save itself to a file at all. so it's either "make me a file" or "just go, girl". πŸ’…
  • -p FILE, --preamble-file=FILE β€” the name of a file that gets included as the preamble for the generated .pex file.
  • -D DIR, --sources-directory=DIR β€” add a sources directory to be packaged into the generated .pex file. you can use this option multiple times. πŸ’–
  • -R DIR, --resources-directory=DIR β€” add a resources directory to be packaged into the generated .pex file. also usable multiple times. πŸŽ€
  • -r FILE, --requirement=FILE β€” add requirements from the given requirements file. yep, multiple times is allowed here too.
  • --constraints=FILE β€” add constraints from the given constraints file. also multiple times, she's flexible. ✨
  • -v β€” turns on logging verbosity. can be specified multiple times, so go off, stack those v's. πŸ”₯
  • --pex-root=PEX_ROOT β€” specify the pex root used in this invocation of pex. [Default: ~/.pex]
  • --help-variables β€” prints out help about the various environment variables used to change the behavior of a running PEX file.

Resolver options:

Tailor how to find, resolve and translate the packages that get put into the PEX environment.

  • --pypi, --no-pypi, --no-index β€” whether to use pypi to resolve dependencies. Default: use pypi.
  • --pex-path=PEX_PATH β€” a colon separated list of other pex files to merge into the runtime environment.
  • -f PATH/URL, --find-links=PATH/URL, --repo=PATH/URL β€” an additional repository path (directory or URL) to look for requirements in.
  • -i URL, --index=URL, --index-url=URL β€” additional cheeseshop indices to use to satisfy requirements. πŸ§€
  • --pre, --no-pre β€” whether to include pre-release and development versions of requirements. Default: only stable versions are used, unless explicitly requested.
  • --disable-cache β€” disables caching in the pex tool entirely. she's raw-dogging it. 😭
  • --cache-dir=CACHE_DIR β€” the local cache directory to use for speeding up requirement lookups. [Default: ~/.pex/build]
  • --cache-ttl=CACHE_TTL β€” the cache TTL to use for inexact requirement specifications.
  • --wheel, --no-wheel, --no-use-wheel β€” whether to allow wheel distributions. Default: allow wheels. πŸ›ž
  • --build, --no-build β€” whether to allow building of distributions from source. Default: allow builds.
  • --manylinux, --no-manylinux, --no-use-manylinux β€” whether to allow resolution of manylinux dists for linux target platforms. Default: allow manylinux.

🫢 PEX output options 🫢

Tailor the behavior of the emitted .pex file if -o is specified. (iykyk β€” no -o, no file, no vibes.)

  • --zip-safe, --not-zip-safe β€” whether or not the sources in the pex file are zip safe. if they are not zip safe, they'll be written to disk prior to execution. Default: zip safe.
  • --always-write-cache β€” always write the internally cached distributions to disk prior to invoking the pex source code. this can use less memory in RAM constrained environments. [Default: False]
  • --ignore-errors β€” ignore run-time requirement resolution errors when invoking the pex. [Default: False]
  • --inherit-path=INHERIT_PATH β€” inherit the contents of sys.path (including sitepackages) when running the pex. possible values are: false (does not inherit sys.path), fallback (inherits sys.path after packaged dependencies), prefer (inherits sys.path before packaged dependencies), and no value at all (which is an alias for prefer, kept around for backwards compatibility). [Default: false]

🌈 PEX environment options 🌈

Tailor the interpreter and platform targets for the PEX environment. this is the main character section, fr fr.

  • --python=PYTHON β€” the Python interpreter to use to build the pex. either specify an explicit path to an interpreter, or specify a binary accessible on $PATH. this option can be passed multiple times to create a multi-interpreter compatible pex. Default: use the current interpreter.
  • --interpreter-constraint=INTERPRETER_CONSTRAINT β€” a constraint that determines the interpreter compatibility for this pex, using the Requirementstyle format, e.g. "CPython>=3", or ">=2.7" for requirements agnostic to interpreter class. this option can be passed multiple times.
  • --rcfile=RC_FILE β€” an additional path to a pexrc file to read during configuration parsing. used primarily for testing.
  • --python-shebang=PYTHON_SHEBANG β€” the exact shebang (#!...) line to add at the top of the PEX file, minus the #!. this overrides the default behavior, which picks an environment python interpreter compatible with the one used to build the PEX file. 🐍
  • --platform=PLATFORMS β€” the platform for which to build the PEX. this option can be passed multiple times to create a multiplatform pex. to use wheels for specific interpreter/platform tags, you can append them to the platform with hyphens like: PLATFORM-IMPL-PYVER-ABI (e.g. "linux_x86_64-cp-27-cp27mu", "macosx_10.12_x86_64-cp-36-cp36m"). PLATFORM is the host platform, e.g. "linux-x86_64", "macosx-10.12-x86_64", etc". IMPL is the python implementation abbreviation (e.g. "cp", "pp", "jp"). PYVER is a two-digit string representing the python version (e.g. "27", "36"). ABI is the ABI tag (e.g. "cp36m", "cp27mu", "abi3", "none"). Default: current platform.
  • --interpreter-cache-dir=INTERPRETER_CACHE_DIR β€” the interpreter cache to use for keeping track of interpreter dependencies for the pex tool. Default: ~/.pex/interpreters.

πŸ’œ PEX entry point options πŸ’œ

Specify what target/module the PEX should invoke, if any.

  • -m MODULE[:SYMBOL], -e MODULE[:SYMBOL], --entry-point=MODULE[:SYMBOL] β€” set the entry point to module or module:symbol. if you just specify module, pex behaves like python -m, e.g. python -m SimpleHTTPServer. if you specify module:symbol, pex imports that symbol and invokes it as if it were main.
  • -c SCRIPT_NAME, --script=SCRIPT_NAME, --console-script=SCRIPT_NAME β€” set the entry point to the script or console_script as defined by any of the distributions in the pex. for example: "pex -c fab fabric" or "pex -c mturk boto". πŸŽ€
  • --validate-entry-point β€” validate the entry point by importing it in a separate process.
⚠️ Warning: this could have side effects. for example, entry point a.b.c:m will translate to from a.b.c import m during validation. [Default: False]

and that's the whole page, bestie!! you made it, I'm so proud of you. πŸ₯ΉπŸ’– this absolute banger of a manual is pex 1.5.3-1, dated June 2022. go forth and build your little executables. slay, periodt, no cap. πŸ‘‘βœ¨πŸ¦‹

πŸ“¦ where this page comes from