Closed agriyakhetarpal closed 3 months ago
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 435173f45cd7fb71cbdbfd12f5b42740dfb1d179; I added a note to docs/installation.md
, renaming the "Global installation" heading to "Customising your installation" as I felt that it was the best place to mention something related to pipx ensurepath
, similar to the --global
argument.
Please rebase.
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).