pipx
pipx copied to clipboard
Preinjection feature
How would this feature be useful? This feature would add python modules to a virtualenv before installing the wanted tool
Describe the solution you'd like
for ex: pipx install gnomecast would return an error, because it requires first to have those 2 modules dbus-python PyGObject
Describe alternatives you've considered In my case I do this:
virtualenv $PIPX_HOME/venvs/gnomecastsource $PIPX_HOME/venvs/gnomecast/bin/activatepip install -U dbus-python PyGObjectpip install -U gnomecast && deactivatepipx install -f gnomecast
I have other tools which have the same issue like netzob, imagepy, polymorph, securetea, buster and others.
It would be nice to have an option like pipx install --preinject "MODULE1 MODULE2" APPNAME like: pipx install --preinject "dbus-python PyGObject" gnomecast
Python provides a native way to do this with PEP 517. It sound slike gnomecast should be repackaged to take advantage of this feature instead of bolting unnecessary features onto pipx.
You mean I need to open an issue in Gnomecast and other tools that have similar issue, ask them to use PEP 517.
What is this feature anyway and how can I use it ?
Yes, Gnomecast will need to fix it on their side, so you’d need to talk to its maintainers.
A project can specify its build-time dependencies in pyproject.toml, and an installer will install them before attempting to build the project (from setup.py in this case). Brett Cannon wrote a good rundown of the feature and its implications to project maintainers: https://snarky.ca/what-the-heck-is-pyproject-toml/
For Gnomecast, they can add those two packages to the requires list:
[build-system]
requires = ["setuptools >= 40.6.0", "wheel", "dbus-python", "PyGObject"]
build-backend = "setuptools.build_meta"
This feature is added in #900.