progval / Limnoria

A robust, full-featured, and user/programmer-friendly Python IRC bot, with many existing plugins.
https://docs.limnoria.net/
Other
615 stars 172 forks source link

Installing plugins with pip on modern Python #1582

Open progval opened 1 month ago

progval commented 1 month ago

Since version 2020.05.08, Limnoria supports installing plugin with pip, so users don't have to deal with Git repositories and adding extra plugin directories.

We also recommend people install Limnoria with their package manager, so it is kept up to date along with the rest of the distribution.

Unfortunately, recent Python versions (eg. as shipped on Debian 12) don't allow running pip outside a virtualenv. This means that we need to document somewhere how to use a system-installed Limnoria along with local plugins. This can take two forms:

  1. create a virtualenv with --system-site-packages (so the system's Limnoria can be found), install plugins, then restart Limnoria in that venv
  2. configure $PYTHONPATH to </path/to/venv>/lib/python3.XX/site-packages

Option 1 is inconvenient, option 2 will break on the next Python update.

Mikaela commented 1 month ago

Is it possible to use pipx instead?

progval commented 1 month ago

Hmm, good point, it does remove the hassle of dealing with virtualenvs.

However, it doesn't seem to have a way to use a system-wide limnoria: pipx install --system-site-packages limnoria would still install Limnoria itself (but give it access to system packages)