• 9 Posts
  • 156 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle

  • Ah, you are using pretty different deployment then, even the used postgres image is different then the usual deployment ( pgautoupgrade/pgautoupgrade:16-alpine instead of postgres:16-alpine) this might or might not cause differences.

    I would try increasing POSTGRES_POOL_SIZE to 10-20, but I am guessing here, the idea being that lemmy is hammering postgres through the default 5 conns which increases CPU but that is a bit of stretch














  • Using pip to install packages outside of venv was always a risk, (newer) pip now has this mechanism to really drive the point home that this can break stuff.

    Do I have to do this everytime I start the script via console?

    Yes, one way to get rid of this requirement is to package the script as binary/executable package (add pyproject.toml with some sane defaults and with proper [project.scripts]) and then install the project using pipx - pipx install -e path/to/the/project/, the -e flag stands for editable and is nice to have here as you won’t have to reinstall everytime you change the script.
    What pipx does is that it creates the local virtualenv, installs everything the package declares as needed and adds a special executable script into location like ~/.local/bin/ that first sources the venv and then starts the entry script - keeping everything isolated.



  • pipx won’t work for that, it’s a library.

    If you are working on your own project/script, you should use virtualenv for development and install all required libraries there.
    If you need it because some system installed application or part of your system does not work without it then… you are in bad place - pip is python package manager primarily used for general python development (installing depending packages, and in theory also for packaging python projects) but it should never be used as system wide package manager - you will break stuff (especially when used with sudo).