Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement quiet and verbose logging for pipx subcommands #1044

Closed
wants to merge 3 commits into from

Conversation

chrysle
Copy link
Contributor

@chrysle chrysle commented Aug 19, 2023

  • I have added an entry to docs/changelog.md

Summary of changes

I have implemented --quiet and --verbose options (and their short forms) for all of the pipx subcommands.

Fixes #946

Test plan

Tested by running

$ python src/pipx run --verbose conan
pipx >(setup:881): 2023-08-19 17:11:03
pipx >(setup:882): src/pipx run --verbose conan
pipx >(setup:883): pipx version is 1.2.0.1.dev0
pipx >(setup:884): Default python interpreter is '/home/user/.virtualenvs/pipx/bin/python'
pipx >(needs_upgrade:69): Time since last upgrade of shared libs, in seconds: 168381. Upgrade will be run by pipx if greater than 2592000.
pipx >(_remove_all_expired_venvs:308): Removing expired venv /home/user/.local/pipx/.cache/CACHEDIR.TAG
pipx >(run_subprocess:173): running /home/user/.local/pipx/.cache/e3ae91e5bef9401/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:186): stdout: /home/user/.local/pipx/.cache/e3ae91e5bef9401/lib/python3.8/site-packages
pipx >(run_subprocess:189): returncode: 0
pipx >(run_package:148): Reusing cached venv /home/user/.local/pipx/.cache/e3ae91e5bef9401
pipx >(run_subprocess:173): running /home/user/.local/pipx/.cache/e3ae91e5bef9401/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:186): stdout: /home/user/.local/pipx/.cache/e3ae91e5bef9401/lib/python3.8/site-packages
pipx >(run_subprocess:189): returncode: 0
pipx >(exec_app:388): exec_app: /home/user/.local/pipx/.cache/e3ae91e5bef9401/bin/conan

Consumer commands
cache      Perform file operations in the local cache (of recipes and/or packages).
config     Manage the Conan configuration in the Conan home.
...........................

Type "conan <command> -h" for help
$ python src/pipx run conan
pipx version is 1.2.0.1.dev0
Default python interpreter is '/home/user/.virtualenvs/pipx/bin/python'
Time since last upgrade of shared libs, in seconds: 168433. Upgrade will be run by pipx if greater than 2592000.
Removing expired venv /home/user/.local/pipx/.cache/CACHEDIR.TAG
running /home/user/.local/pipx/.cache/e3ae91e5bef9401/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
Reusing cached venv /home/user/.local/pipx/.cache/e3ae91e5bef9401
running /home/user/.local/pipx/.cache/e3ae91e5bef9401/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
exec_app: /home/user/.local/pipx/.cache/e3ae91e5bef9401/bin/conan

Consumer commands
cache      Perform file operations in the local cache (of recipes and/or packages).
config     Manage the Conan configuration in the Conan home.
...........................

Type "conan <command> -h" for help
$ python src/pipx run --quiet conan

Consumer commands
cache      Perform file operations in the local cache (of recipes and/or packages).
config     Manage the Conan configuration in the Conan home.
...........................

Type "conan <command> -h" for help

src/pipx/main.py Outdated Show resolved Hide resolved
@chrysle chrysle requested a review from uranusjr September 5, 2023 19:28
tests/test_install.py Outdated Show resolved Hide resolved
uranusjr
uranusjr previously approved these changes Sep 6, 2023
Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question, otherwise lgtm.

@chrysle chrysle force-pushed the add-quiet-verbose-mode branch from 1d3bba7 to 895cf0a Compare September 6, 2023 14:30
@thcrt
Copy link

thcrt commented Nov 15, 2023

I'd love to see this merged, I'm using pipx in a Docker build process and would really appreciate quiet logging :)

Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs merge conflicts fixed.

@gaborbernat gaborbernat marked this pull request as draft December 2, 2023 05:45
@gaborbernat
Copy link
Contributor

Seems stalled, we can reopen if you pick it up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pipx run --quiet mode
4 participants