Maintaining Python Virtual Environments

From sokwedb
Jump to navigation Jump to search

Revision Control Support

Tools to create and manage Python virtual environments are in the sokwe_server code repository.

After checking out the repository, make the repo your current working directory and get help with:

make help

Package Upgrade

To upgrade a particular package in a venv to the latest version (run from a regular developer login, not root) follow the instructions found in the sokwe_server repository's Makefile. The instructions are presented by running:

make | less

After upgrading a package, update the corresponding requirements file then be sure to commit the change to the sokwe_server code repository. The instructions make presents explain how. This allows others, perhaps a future-you, to re-create an identical environment.

It is also safe to delete the entire virtual environment and re-create it with the latest available packages, although this will lead to interruption of service. Again, the sokwe_server repository should be updated to record the new package versions.

Service Restart

After a change to the virtual environment all daemons which use the virtual environment must be restarted. This varies by virtual environment.

PgAdmin4

systemctl restart pgadmin4_gnunicorn