Note: This project has been superceded by my
pipxu project which is a new
implementation of pipx that uses
uv.
pipxx is a simple command line utility to wrap the usage of
pipx to provide some minor improved functions. Consider
pipxx a proof of concept of some ideas for pipx.
- Global application installation by root.
- Enhancement of pipx list output.
- Automatic determination of pyenv Python path for install.
- Substitution of current directory with package name for uninstall.
See the description of these enhancements below.
pipxx is merely a wrapper for pipx so takes exactly the same command
line arguments and options. Just run pipxx the same as you would run
pipx. Type pipx or pipx -h to view the usage summary for pipx
(or type pipxx or pipxx -h to see the same usage summary).
The latest version and documentation is available at https://github.com/bulletmark/pipxx.
pipx is used normally to install applications for a single user. It
can also install applications
globally
as root but that is awkward
because you have to manually set environment variables. pipxx
recognises when it is run as root (or with sudo) and automatically
sets appropriate system global PIPX_BIN_DIR, PIPX_MAN_DIR, and
PIPX_HOME directories for pipx.
E.g. to install application as normal user:
$ pipxx install cowsayTo install application for all users (i.e. globally):
$ sudo pipxx install cowsayNote, to see the global directories selected by pipxx for your system:
$ sudo pipxx environmentpipx list
output lacks some useful information. pipxx adds the following
to the pipx list output:
- The PyPi package name, or source directory, or VCS URL from where the application was installed from,
- Whether the application is installed as editable.
When installing, you can tell pipx to use a specific version/path of
Python using the --python option. Unfortunately, you have to specify
the full path to the python interpreter you want. Very commonly,
pyenv is used to install multiple
versions of Python.
So to use a specific pyenv Python version with pipx you have to type:
$ pipx install --python ~/.pyenv/versions/3.12.0/bin/python cowsayWith pipxx you merely have to type:
$ pipxx install --python 3.12 cowsayI.e. pipxx will work out from 3.12 that you want the path
~/.pyenv/versions/3.12.0/bin/python, i.e. the latest 3.12 version
installed at the time of this example. You could alternately type pipxx install --python 3 cowsay, or pipxx install --python 3.12.0 cowsay.
Note the automatically selected path is dependent on your
system/installation and is derived by pipxx from the output of pyenv root.
Actually, --python is a commonly used option but unfortunately pipx
does not provide a short-form option for it. So pipxx also adds -P
as an alias for --python allowing you to simply type:
$ pipxx install -P 3.12 cowsayNote that pipxx also adds a description of the added pyenv version
option and the added -P alias option to the install --help output.
Developers often use pipx to install and run an application they are
working on from a local source directory. E.g. for an example
application myapp:
$ pwd
/home/myname/src/myapp
$ pipx install -e .
installed package myapp <...>To uninstall this application you have to type pipx uninstall myapp.
However, thinking symmetrically, you would expect pipx uninstall .
would suffice. So pipxx adds the ability to do this:
$ pipxx uninstall .
uninstalled myapp!Note pipxx is on PyPI so just ensure
that pipx is installed then type the
following:
To install:
$ pipx install pipxxTo upgrade:
$ pipx upgrade pipxxTo remove:
$ pipx uninstall pipxxpipxx requires Python >= 3.7 and requires no 3rd party packages. It
requires that pipx is in your $PATH.
Copyright (C) 2023 Mark Blakeney. This program is distributed under the terms of the GNU General Public License. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at https://en.wikipedia.org/wiki/GNU_General_Public_License for more details.