[Python] How to pass Python interpreter parameters -O/-OO to a console-script?...

Discussão em 'Python' iniciado por Stack, Abril 22, 2025.

  1. Stack

    Stack Membro Participativo

    In pyproject.toml, I have the following section:

    [project.scripts]
    work = "mypackage.worker_app:main"


    This means that after activating virtual environment, I can simply type work, and this will execute method main() from class worker_app from module mypackage.

    However, what about Python interpreter parameters related to optimization, such as -O (remove asserts) and -OO (remove docstrings)? Can I somehow pass them when running work? Or define them in pyproject.toml? Or do console-scripts always run with with full debug?

    Continue reading...

Compartilhe esta Página