-
Notifications
You must be signed in to change notification settings - Fork 446
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 a --prepend
option to the pipx ensurepath
command
#1451
Add a --prepend
option to the pipx ensurepath
command
#1451
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution. I think a quick note about this in the installation docs would be nice. Else lgtm.
Thanks for the review – addressed in 435173f; I added a note to |
Please rebase. |
Co-Authored-By: Robert <49005401+Gitznik@users.noreply.github.com>
6fc30c0
to
6fa587a
Compare
Done, @chrysle |
Thanks! |
changelog.d/
(if the patch affects the end users)Summary of changes
Closes #1424.
This PR adds an option to
pipx ensurepath
, i.e.,pipx ensurepath --prepend
to allow users to prependpipx
-installed applications to thePATH
environment variable rather than appending to it. This is disabled and set toFalse
by default; it is only enabled if the user doespipx ensurepath --prepend
(or its--force
counterparts such aspipx ensurepath --force --prepend
orpipx ensurepath --prepend --force
). The implementation is throughuserpath.prepend
, which is similar touserpath.append
(see https://github.com/ofek/userpath#api).Test plan
Tested by running
This modifies my
~/.zshrc
file on macOS accordingly:Therefore, the latter entry from these changes has prepended
pipx
's installation location toPATH
. The earlier entry is from an olderpipx
installation I had that had appended the location. I'm happy to add additional tests in an appropriate place intests/
as necessary (though I notice thatensurepath
doesn't have tests yet), and update the documentation (not sure where a mention of this would be best appropriate to add, though).