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

Add pipx environment command #793

Merged
merged 13 commits into from
Feb 16, 2022
Merged

Conversation

dukecat0
Copy link
Member

@dukecat0 dukecat0 commented Jan 13, 2022

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

Summary of changes

Add pipx environment command.
See #713

Example output:

$ pipx environment
PIPX_HOME=/home/user/.local/pipx
PIPX_BIN_DIR=/home/user/.local/bin
PIPX_SHARED_LIBS=/home/user/.local/pipx/shared
PIPX_LOCAL_VENVS=/home/user/.local/pipx/venvs
PIPX_LOG_DIR=/home/user/.local/pipx/logs
PIPX_TRASH_DIR=/home/user/.local/pipx/.trash
PIPX_VENV_CACHEDIR=/home/user/.local/pipx/.cache
$ pipx environment --value PIPX_HOME
/home/user/.local/pipx

Test plan

Tested by running

pipx install .
pipx environment
pipx environment --value PIPX_HOME
pipx environment -v PIPX_LOCAL_VENVS
pipx environment --value=PIPX_BIN_DIR

@dukecat0 dukecat0 marked this pull request as draft January 13, 2022 10:46
@dukecat0 dukecat0 marked this pull request as ready for review January 13, 2022 10:47
Copy link
Member

@cs01 cs01 left a comment

Choose a reason for hiding this comment

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

Looking good! Thanks for doing this. Just needs some slight updates.

src/pipx/commands/environment.py Outdated Show resolved Hide resolved
src/pipx/commands/environment.py Outdated Show resolved Hide resolved
src/pipx/main.py Outdated Show resolved Hide resolved
Comment on lines 16 to 25
def test_cli_with_args(monkeypatch, capsys):
assert not run_pipx_cli(["environment", "--value", "PIPX_HOME"])
assert not run_pipx_cli(["environment", "--value", "PIPX_BIN_DIR"])
assert not run_pipx_cli(["environment", "--value", "PIPX_SHARED_LIBS"])
assert not run_pipx_cli(["environment", "--value", "PIPX_LOCAL_VENVS"])
assert not run_pipx_cli(["environment", "--value", "PIPX_LOG_DIR"])
assert not run_pipx_cli(["environment", "--value", "PIPX_TRASH_DIR"])
assert not run_pipx_cli(["environment", "--value", "PIPX_VENV_CACHEDIR"])

run_pipx_cli(["environment", "--value", "SSS"])
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

@dukecat0 dukecat0 requested a review from cs01 February 15, 2022 05:49
@cs01 cs01 merged commit 599a765 into pypa:main Feb 16, 2022
@dukecat0 dukecat0 deleted the add-pipx-environment-command branch February 16, 2022 08:30
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.

None yet

2 participants