Where should Postfix, Django, Hyperkitty, Postorius, Dart-Sass, etc. be installed if MM3 is in a python virtual environment?
Greetings, Mailman3 List !
mailman3 was installed into the below virtual environment: (venv) [mailman3@localhost-live ~]$ pip install wheel mailman psycopg2-binary Should, or must, any of Django, Hyperkitty, Postorius, Dart-Sass, or any other supporting programs be installed into this virtual environment ?
PostgreSQL and Postfix have been successfully installed outside of the mailman3 virtual environment and start properly, I assume this is correct.
Thanks in advance.
---- Keith
Keith Christian wrote on 2024-05-24 16:41:
pip install wheel mailman psycopg2-binary
Should, or must, any of Django, Hyperkitty, Postorius, Dart-Sass, or any other supporting programs be installed into this virtual environment ?
As I understand it, mailman-hyperkitty get installed into the venv, but django and postorius are pulled in as a dependency of mailman-web (I believe?)
I don't seem to see any SASS modules when I run pip list | grep -i sass
in the venv.
This handled the SASS stuff:
sudo apt install python3-dev python3-venv sassc lynx
I created a file called requirements.txt
which I use thusly in the venv:
pip install -r requirements.txt
I don't know if I can attach it to messages to the list, so I've included it below:
===%<--- requirements.txt --->%===
mailman mailman-web mailman-hyperkitty
## PyMySQL is used in the database connection def in mailman.cfg: ## PyMySQL ## ## For mailman-web migrate with MySQL, mysqlclient is required! ## mysqlclient
## PostgreSQL: psycopg2-binary
uwsgi
## Wheel is advised, but (mostly) works without. wheel
## module error on missing "xapian_backend" when running
## mailman-web update_index_one_list
##
##
## ModuleNotFoundError: No module named 'xapian_backend'
##
## Requires separate build process (and wheel): see docs
xapian-haystack
Hopefully I'm not too wrong in what I've posted.
rb
Ron / BCLUG <admin@bclug.ca> wrote:
Keith Christian wrote on 2024-05-24 16:41:
pip install wheel mailman psycopg2-binary
Should, or must, any of Django, Hyperkitty, Postorius, Dart-Sass, or any other supporting programs be installed into this virtual environment ?
As I understand it, mailman-hyperkitty get installed into the venv, but django and postorius are pulled in as a dependency of mailman-web (I believe?)
Yes that is correct. I've actually a slightly different approach and when creating the env choose to bring in system packages as well:
python3 -m venv --system-site-packages --symlinks venv
The packages I install on a fresh system are: sudo apt install python3-dev python3-wheel python3-psycopg2 sassc python3-rcssmin python3-venv python3-certbot-nginx postgresql exim4-daemon-light Then in venv I just run pip install mailman mailman-hyperkitty mailman-web uwsgi
My goal here is that I want as minimum compilation tools on the system as possible. I installed the Ubuntu version of the psycopg2 package as it's the same version of the Postgresql software also maintained by Ubuntu. I seem to remember rcsmin needing compilation tools so installed the Ubuntu maintained package. I typically don't install Links on my systems but remember it was a requirement at some point so will probably include it on a new Ubuntu 24.04 host I am planning. The Certbott installation does itself pull in a few Python libraries that Mailman uses so when installing Mailman in the venv it doesn't have to pull as many packages. I did try and see what packages I could include from the system in this way but when we start adding more packages Apt starts to get crazy with dependencies, so I made the goal of just pulling in packages which required compilation.
Originally I used Gunicorn as the wsgi backend for the Django stuff from Nginx. This is because Gunicorn gets installed as a dependency when you pull in Mailman. When I did it this way I didn't need to install Python3-Dev, I only needed to install the Python3-Venv package. However my old setup using Gunicorn didn't use Mailman-Web, and when I migrated to using Mailman-Web as part of a Ubuntu 22.04 setup I had trouble getting Gunicorn to pick up the Django backend: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/G...
I discussed this here: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/G...
Apparently the installation doc is now updated with a Gunicorn example so when I go Ubuntu 24.04 I will try that method.
I have configured a system in this way in the past using Xapian and pulled in the Ubuntu Xapian packages. My new system uses Woosh as I migrated to Mailman-Web and that installed Woosh as a dependency, and I had forgotten to back up the Xapian indexes.
Andrew.
On 5/24/24 7:41 PM, Keith Christian wrote:
mailman3 was installed into the below virtual environment: (venv) [mailman3@localhost-live ~]$ pip install wheel mailman psycopg2-binary Should, or must, any of Django, Hyperkitty, Postorius, Dart-Sass, or any other supporting programs be installed into this virtual environment ?
If you follow the doc at https://docs.mailman3.org/en/latest/install/virtualenv.html you will install Mailman core, psycopg2-binary, mailman-web and mailman-hyperkitty in the venv. mailman-web will install Django, django-mailman3, MailmanClient, HyperKitty and Postorius as dependencies in the venv.
PostgreSQL and Postfix have been successfully installed outside of the mailman3 virtual environment and start properly, I assume this is correct.
Since these are not python packages, they and sassc (or Dart-Sass) are installed outside the venv. Also, Postfix in particular and possibly PostgreSQL may be used by things other than Mailman so you don't want them in the venv even if they could be installed there.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (4)
-
Andrew Hodgson
-
Keith Christian
-
Mark Sapiro
-
Ron / BCLUG