Bug 250362

Summary: mail/mailman3: zope.interface>=5.0 is required
Product: Ports & Packages Reporter: Julien Cigar <julien>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: New ---    
Severity: Affects Many People CC: crest, drs-freebsd, dvl, einar, pi, rnejdl
Priority: ---    
Version: Latest   
Hardware: amd64   
OS: Any   
Description Flags
Add missing dependencies declared in setup.py none

Description Julien Cigar 2020-10-15 09:02:59 UTC
root@mailman:/ # pkg install py37-mailman
Message from py37-mailman-3.3.1:

To initialise Mailman's runtime directories, log files and database
for the first time, run

  service mailman info

You can then start Mailman by running:

  service mailman start
root@mailman:/ # service mailman info
Cannot 'info' mailman. Set mailman_enable to YES in /etc/rc.conf or use 'oneinfo' instead of 'info'.
root@mailman:/ # sysrc mailman_enable=YES
mailman_enable:  -> YES
root@mailman:/ # service mailman info
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (zope.interface 4.6.0 (/usr/local/lib/python3.7/site-packages), Requirement.parse('zope.interface>=5.0'), {'mailman'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/mailman", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3251, in <module>
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3235, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'zope.interface>=5.0' distribution was not found and is required by mailman
Comment 1 Bugzilla Automation freebsd_committer 2020-10-15 09:02:59 UTC
Maintainer informed via mail
Comment 2 crest 2020-10-27 12:57:29 UTC
I just ran into the same problem.
Comment 3 Dan Langille freebsd_committer 2020-11-25 22:08:59 UTC
I just hit there.  What's up?
Comment 4 Dan Langille freebsd_committer 2020-11-25 22:17:43 UTC
The original PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225543
Comment 5 Dan Langille freebsd_committer 2020-11-25 22:25:24 UTC
The zope5 dependency arrived with this commit 8 months ago in March 20202

Comment 6 Dan Langille freebsd_committer 2020-11-25 23:13:51 UTC
I managed to get mailman running by:

installing these:

* py37-importlib-resources
* py37-authres
* py37-authheaders
* py37-publicsuffix2
* py37-dkimpy

Modifying this line in /usr/local/etc/rc.d/mailman:


Running this to update /etc/rc.conf:

sudo sysrc mailman_config=/usr/local/lib/python3.7/site-packages/mailman/config/mailman.cfg

Modifying this file: /usr/local/lib/python3.7/site-packages/mailman-3.3.1-py3.7.egg-info/requires.txt

changing this line: zope.interface>=5.0

to: zope.interface>=4.0
Comment 7 Dan Langille freebsd_committer 2020-11-25 23:35:07 UTC
Documentation of how I got to the above:

Comment 8 Julien Cigar 2020-11-26 13:29:24 UTC
changing the zope.interface requirement from >= 5.0 to >= 4.0 should only be a temporary hack, there is a good reason, I guess, that it should be >= 5.0 (and you'll hit import errors or undefined errors or ...)

maybe we could create two separate ports: one for zope.interface 4.x and one for zope.interface 5.x (I haven't checked if there are backward incompatibilities between the two versions), and fix dependencies

now, I'm wondering if this port has ever been tested as there are other missing dependencies as well (gunicorn, ...) ...

(check https://gitlab.com/mailman/mailman/-/blob/c753dba53224cc6aacc426897577d9b098feae8d/setup.py#L106-128 for dependencies)
Comment 9 Dan Langille freebsd_committer 2020-11-26 13:33:01 UTC
(In reply to Julien Cigar from comment #8)

That is the list of dependencies I have been following. I have created a new list and imported the corresponding list from Mailman 2. That list has not been tested.

I don't see a reason to use zope.interface=4 because Mailman wants 5.

I don't see zope 5 in ports, but I don't know enough about zope to know what I'm looking for.
Comment 10 Kurt Jaeger freebsd_committer 2020-11-26 13:44:14 UTC
(In reply to Julien Cigar from comment #8)
Well, there's a reason that I had a "needs run-tests" in the original PR:

Comment 11 Dan Langille freebsd_committer 2020-11-26 14:01:08 UTC
I am in the process of updating an existing Mailman2 installation via https://docs.mailman3.org/en/latest/migration.html, we shall see. zfs snapshots have been taken. We shall soon see.

If others can work on the zope and run-test stuff. I'll work on this side.
Comment 12 Dan Langille freebsd_committer 2020-11-26 23:35:33 UTC
Four ports created:


via: https://svnweb.freebsd.org/ports?view=revision&revision=556421
Comment 13 Dan Langille freebsd_committer 2020-11-26 23:49:22 UTC
Created attachment 220017 [details]
Add missing dependencies declared in setup.py

Add some dependencies I know are missing.
Comment 14 Einar Bjarni Halldórsson 2020-11-27 08:15:19 UTC
Great work. I got it running on a test machine by installing needed dependencies with pip as they popped up. I still haven't tried sending mail, but  hopefully today.
Comment 15 Dan Langille freebsd_committer 2020-11-27 13:12:51 UTC
To get new #FreeBSD port www/py-hyperkitty to build:

* update devel/py-flufl.lock to 4.0
* update these ports to use www/py-django31 not www/py-django22:

And create these new #FreeBSD ports:

* www/py-django-q
* www/py-robot-detection
Comment 16 Dan Langille freebsd_committer 2020-11-27 13:46:21 UTC
These have not been commited to the FreeBSD ports tree because I'm not sure we
are heading down the HyperKitty path.

https://www.freshports.org/www/hypermail may be the new way.