Re: [Mailman-Developers] need tutorial for setting up python development environment on Ubuntu please

On May 03, 2012, at 09:20 PM, David wrote:
After a full day of stuff like this: error: Installed distribution zope.interface 3.6.1 conflicts with requirement zope.interface>=3.8.0 ... I need a good tutorial on setting up the development environment, including whatever related tools are needed, to build and install Mailman 3.0. Google hasn't turned up anything very helpful yet. I appreciate any recommendations.
For me, it depends on whether you want to develop mm3 or install it.
If you're going to develop it (i.e. fix bugs, work on features, etc), then it's best to use the buildout infrastructure. This is mainly because the test suite is more or less tied to buildout at the moment. So the steps to build a development environment would be:
$ python bootstrap.py $ bin/buildout
You'll need an internet connection so buildout can download all the stuff you need from the Cheeseshop. Once you've done that, look in bin/ for other commands you can run, such as
bin/test
to run the test suite, or parts of itbin/py
to give you a Python interpreter with the 'mailman' namespace accessible, but not loaded, and the system not initializedbin/mailman shell
to give you an interpreter prompt with the basic system initialized (i.e. database, Zope component architecture, loggers, etc.)
If instead you want to run Mailman 3, I recommend using virtualenv and skipping buildout. E.g.
$ virtualenv /some/path $ source /some/path/bin/activate $ python setup.py install
Now you can run mailman info
to get some basic information about how your
system is configured, mailman start
to start the system, etc. I do
recommend creating an etc/mailman.cfg to customize various aspects of Mailman
before you start. Take a look at src/mailman/config/schema.cfg and
.../mailman.cfg for the default settings.
BTW, is Python 3 recommended for Mailman 3? I'm using 2.7 atm.
Mailman 3 is not compatible with Python 3 right now. As soon as our dependency stack is available for Python 3, I plan on porting Mailman 3 to it. That is very unlikely to happen until after 3.0 is released. For now, you can use Python 2.6 or 2.7.
Cheers, -Barry

On Fri, May 4, 2012 at 12:54 AM, Barry Warsaw barry@list.org wrote:
On May 03, 2012, at 09:20 PM, David wrote:
... I need a good tutorial on setting up the development environment,
For me, it depends on whether you want to develop mm3 or install it.
I want to install and run it and play with it like a user. I'm not a python developer (at least not yet, and not sure if I'll ever get that far).
If instead you want to run Mailman 3, I recommend using virtualenv and skipping buildout.
OK. Thanks for the advice.
I'll detail my steps in case it helps someone else. (I also have a few questions mixed in below.) Here's what I did:
install Ubuntu 12.04 create DNS records ssh into Ubuntu server sudo apt-get install build-essential python-dev python-virtualenv cd /opt/ wget https://launchpad.net/mailman/3.0/3.0.0b1/+download/mailman-3.0.0b1.tar.gz tar -xf mailman-3.0.0b1.tar.gz mkdir mailman3 (for virtualenv - see note below about correcting my directory names; this should have been named mailman3_venv) # virtualenv /opt/mailman3/ (New python executable in /opt/mailman3/bin/python)
I do recommend creating an etc/mailman.cfg to customize various aspects of
Mailman before you start. Take a look at src/mailman/config/schema.cfg and .../mailman.cfg for the default settings.
# nano /etc/mailman.cfg done
sudo apt-get install postfix openssl-blacklist ssl-cert
# nano /etc/postfix/main.cf
***************** QUESTION ********************* Are the following paths correct??? transport_maps = hash:/opt/mailman3/var/data/postfix_lmtp local_recipient_maps = hash:/opt/mailman3/var/data/postfix_lmtp
After modifying main.cf, be sure to run '/etc/init.d/postfix reload'. root@li437-28:/etc/postfix# /etc/init.d/postfix reload
- Reloading Postfix
configuration... [ OK ]
# source /opt/mailman3/bin/activate python setup.py install Finished processing dependencies for mailman==3.0.0b1
NOTE: After doing all this, I see that I named my directories wrong. I think I'll repeat it and name the extracted tarball directory mailman3/ and the virtualenv directory mailman3_venv/ next time.
Now you can run mailman info
to get some basic information about how your
system is configured,
(mailman3)root@localhost:/opt/mailman-3.0.0b1# mailman info GNU Mailman 3.0.0b1 (The Twilight Zone) Python 2.7.3 (default, Apr 20 2012, 22:39:59) [GCC 4.6.3] config file: /etc/mailman.cfg db url: sqlite:////opt/mailman-3.0.0b1/var/data/mailman.db REST root url: http://mailman3.example.com:80/3.0/ REST credentials: yyyyyyyyyyyy:xxxxxxxxxxxxx
mailman start
to start the system, etc.
(mailman3)root@li437-28:/opt/mailman-3.0.0b1# mailman start Starting Mailman's master runner
Cheers,
-Barry
Thank you! That's a great help.
I also came across this useful tutorial: Python Ecosystem - An Introduction http://mirnazim.org/writings/python-ecosystem-introduction/
Next Questions:
- what are the first tests I should perform after starting mailman?
- a tutorial for setting up Posterious?
Thanks again.
participants (2)
-
Barry Warsaw
-
David