Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python install sub-package from package

it is possible to install some special sub-package from package?

For example, I want to create package with slack, datadog, sentry plugins (wrappers). But I want to allow user what he wants to install.

Like:

pip install super_plugins --plugins slack, datadog

Can it be done without separating all plugins to different packages?

like image 973
Vladimir Chernenko Avatar asked Jan 30 '23 22:01

Vladimir Chernenko


1 Answers

Actually, It is quite simple. This is called Packaging namespace packages. https://packaging.python.org/guides/packaging-namespace-packages/

All you need is to separate all packages to sub - packages and after install it with a namespace.

# for all packages
pip install super_plugins

# for specific
pip install super_plugins.slack super_plugins.datadog
like image 120
Vladimir Chernenko Avatar answered Feb 02 '23 09:02

Vladimir Chernenko