mailman.client conflicts with mailman installation

Bug #975668 reported by Richard Wackerbarth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
Low
Pavan Koli

Bug Description

If mailman.client is loaded as a separate module (as instructed), then mailman cannot exist in the same environment because there are two "mailman" modules to search.

I found this when I tried to generate sphinx documentation for mailman after I had installed postorius.

To reproduce:

mkvirtualenv BUG
bzr branch lp:mailman.client
cd mailman.client/
python setup.py develop
easy_install sphinx
cd ..
bzr branch lp:mailman
cd mailman
python bootstrap.py
bin/buildout
python setup.py build_sphinx

Results in:

Running Sphinx v1.1.3
Traceback (most recent call last):
  File "setup.py", line 112, in <module>
    'zope.testing<4',
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Volumes/UserSpace/rkw/.virtualenvs/BUG/lib/python2.7/site-packages/Sphinx-1.1.3-py2.7.egg/sphinx/setup_command.py", line 140, in run
    freshenv=self.fresh_env)
  File "/Volumes/UserSpace/rkw/.virtualenvs/BUG/lib/python2.7/site-packages/Sphinx-1.1.3-py2.7.egg/sphinx/application.py", line 102, in __init__
    confoverrides or {}, self.tags)
  File "/Volumes/UserSpace/rkw/.virtualenvs/BUG/lib/python2.7/site-packages/Sphinx-1.1.3-py2.7.egg/sphinx/config.py", line 216, in __init__
    exec code in config
  File "/Volumes/UserSpace/rkw/.virtualenvs/BUG/mailman/conf.py", line 54, in <module>
    from mailman.version import VERSION
ImportError: No module named version

Tags: mailman3
Barry Warsaw (barry)
Changed in mailman:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Pavan Koli (pskoli93) wrote :

I tried to reproduce this bug on mailman3, I created the virtualenvironment using pyvenv-3.4 venv-3.4 --without-pip and then manually installing pip and setuptools inside venv-3.4

cd venv-3.4
source bin/activate
cd ..
bzr branch lp:mailman.client
cd mailman.client/
python setup.py develop
easy_install sphinx
cd ..
bzr branch lp:mailman
cd mailman
python setup.py build_sphinx

As bootstrap.py is no longer present I omitted that step also I omitted the bin/buildout step

Resulted in:

running build_sphinx
creating /home/pkoli/Desktop/BUG/mailman/build
creating /home/pkoli/Desktop/BUG/mailman/build/sphinx
creating /home/pkoli/Desktop/BUG/mailman/build/sphinx/doctrees
creating /home/pkoli/Desktop/BUG/mailman/build/sphinx/html
Running Sphinx v1.3
loading pickled environment... not yet created
WARNING: 'default' html theme has been renamed to 'classic'. Please change your html_theme setting either to the new 'alabaster' default theme, or to 'classic' to keep using the old default.
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 122 source files that are out of date
updating environment: 122 added, 0 changed, 0 removed
reading sources... [100%] src/mailman/styles/docs/styles
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
WARNING: dot command 'dot' cannot be run (needed for graphviz output), check the graphviz_dot setting
writing output... [100%] src/mailman/styles/docs/styles
generating indices... genindex
writing additional pages... search
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 2 warnings.
index.html -> README.html

I am interested in fixing this bug, can someone assign it to me, I'll start by first testing different cases that can be used to reproduce it and then find a possible solution.

Pavan Koli (pskoli93)
description: updated
Changed in mailman:
assignee: nobody → Pavan Koli (pskoli93)
Revision history for this message
Barry Warsaw (barry) wrote : Re: [Bug 975668] Re: mailman.client conflicts with mailman installation

On Mar 14, 2015, at 01:29 PM, Pavan Koli wrote:

>If mailman.client is loaded as a separate module (as instructed), then
>mailman cannot exist in the same environment because there are two
>"mailman" modules to search.

Use mailman.client with Python 3 and install them both using namespace
packages. I haven't actually tried this, but it's (perhaps) how it should
work.

Revision history for this message
Pavan Koli (pskoli93) wrote :

I followed the steps as mentioned to reproduce the error.

mkvirtualenv BUGS
bzr branch lp:mailman.client
cd mailman.client/
python setup.py develop
easy_install sphinx
cd ..
bzr branch lp:mailman
cd mailman
python setup.py develop
python setup.py build_sphinx

The build succeeds with no warnings.

I ran through this documentation PEP420 (https://www.python.org/dev/peps/pep-0420/) to check about namespace packages, as I thought the error may be associated with it.

Checking the output error which Richard has got-

>File "/Volumes/UserSpace/rkw/.virtualenvs/BUG/mailman/conf.py", line 54, in <module>
No conf.py file present now, instead I looked in options.py

>from mailman.version import VERSION
The above line no longer exists, now the line given below exists.
from mailman.version import MAILMAN_VERSION(http://bazaar.launchpad.net/~mailman-coders/mailman/3.0/view/head:/src/mailman/options.py#L34)

>ImportError: No module named version
I think it was caused due to some namespace package and modules issues which were present and were resolved using PEP 420.

As this bug was reported on 2012-04-07 and the PEP 420 was created on 2012-04-19, maybe the BUG has been resolved by applying changes as recommended in PEP 420.

Further trying to confirm whether the issue has been resolved, I checked the file __init__.py(http://bazaar.launchpad.net/~mailman-coders/mailman/3.0/view/head:/src/mailman/__init__.py)

According to this post(http://stackoverflow.com/questions/1675734/how-do-i-create-a-namespace-package-in-python/27586272#27586272) the code given in __init__.py , is sufficient to handle the different modules and namespace packages issues.

So ideally we should be able to run import mailman.version without any errors, and the successful build which I got at the end confirms that the BUG has been resolved.

Pavan Koli (pskoli93)
Changed in mailman:
status: Triaged → Fix Released
Revision history for this message
Pavan Koli (pskoli93) wrote :

Some observations-

>Checking the output error which Richard has got-

>>File "/Volumes/UserSpace/rkw/.virtualenvs/BUG/mailman/conf.py", line 54, in <module>
>No conf.py file present now, instead I looked in options.py

>>from mailman.version import VERSION
>The above line no longer exists, now the line given below exists.
>from mailman.version import MAILMAN_VERSION(http://bazaar.launchpad.net/~mailman->coders/mailman/3.0/view/head:/src/mailman/options.py#L34)

The file conf.py is present in mailman folder, I was looking for it in src/mailman folder.

>>from mailman.version import VERSION
>The above line no longer exists, now the line given below exists.
>from mailman.version import MAILMAN_VERSION(http://bazaar.launchpad.net/~mailman->coders/mailman/3.0/view/head:/src/mailman/options.py#L34)

The line exists at (http://bazaar.launchpad.net/~mailman-coders/mailman/3.0/view/head:/conf.py#L54)

Submitting a minor patch for print statement.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.