Hello Everyone,
Happy new year!
I am pleased to announce several new releases for GNU Mailman project.
All the releases are published to PyPI and you can find links to all the PyPI projects:
https://docs.mailman3.org/en/latest/
A full list of change logs are available below:
Finally, the minimum Python version required is 3.7, and all the components now support Python 3.7 to 3.11.
Thanks to all the contributors for making this release possible!
If you find any issues, you can report them at the respective bug tracker for the projects. The links to issue trackers are available here: https://docs.mailman3.org/en/latest/
Installation documentation is available at
https://docs.mailman3.org/en/latest/install/install.html
and if you are upgrading an existing virtualenv install you can refer
https://docs.mailman3.org/en/latest/upgrade-3.2.html
I'm attempting this upgrade in my test environment which is a Docker container with Python 3.9.10 virtual environment. I was able to upgrade all the Python requirements but when I run mailman-web migrate I get an error. It seems related to the mailman-web package. See output below.
"(mailmanve) mailman@1d0e3a230c94:/var/www/mailman-www$ mailman-web migrate Traceback (most recent call last): File "/opt/mailmanve/bin/mailman-web", line 33, in <module> sys.exit(load_entry_point('mailman-web==0.0.6', 'console_scripts', 'mailman-web')()) File "/opt/mailmanve/lib/python3.9/site-packages/mailman_web/manage.py", line 37, in main execute_from_command_line(sys.argv) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/__init__.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/base.py", line 402, in run_from_argv self.execute(*args, **cmd_options) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/base.py", line 448, in execute output = self.handle(*args, **options) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/base.py", line 96, in wrapped res = handle_func(*args, **kwargs) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 97, in handle self.check(databases=[database]) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/base.py", line 475, in check all_issues = checks.run_checks( File "/opt/mailmanve/lib/python3.9/site-packages/django/core/checks/registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/checks/urls.py", line 14, in check_url_config return check_resolver(resolver) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/checks/urls.py", line 24, in check_resolver return check_method() File "/opt/mailmanve/lib/python3.9/site-packages/django/urls/resolvers.py", line 494, in check for pattern in self.url_patterns: File "/opt/mailmanve/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/opt/mailmanve/lib/python3.9/site-packages/django/urls/resolvers.py", line 715, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/opt/mailmanve/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/opt/mailmanve/lib/python3.9/site-packages/django/urls/resolvers.py", line 708, in urlconf_module return import_module(self.urlconf_name) File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 850, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/var/www/mailman-www/urls.py", line 20, in <module> from django.conf.urls import include, url ImportError: cannot import name 'url' from 'django.conf.urls' (/opt/mailmanve/lib/python3.9/site-packages/django/conf/urls/__init__.py)"
On 1/4/23 13:54, Dan Caballero wrote:
I'm attempting this upgrade in my test environment which is a Docker container with Python 3.9.10 virtual environment. I was able to upgrade all the Python requirements but when I run mailman-web migrate I get an error. It seems related to the mailman-web package. See output below.
"(mailmanve) mailman@1d0e3a230c94:/var/www/mailman-www$ mailman-web migrate Traceback (most recent call last): File "/opt/mailmanve/bin/mailman-web", line 33, in <module> sys.exit(load_entry_point('mailman-web==0.0.6', 'console_scripts', 'mailman-web')()) File "/opt/mailmanve/lib/python3.9/site-packages/mailman_web/manage.py", line 37, in main execute_from_command_line(sys.argv) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/__init__.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/base.py", line 402, in run_from_argv self.execute(*args, **cmd_options) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/base.py", line 448, in execute output = self.handle(*args, **options) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/base.py", line 96, in wrapped res = handle_func(*args, **kwargs) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 97, in handle self.check(databases=[database]) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/management/base.py", line 475, in check all_issues = checks.run_checks( File "/opt/mailmanve/lib/python3.9/site-packages/django/core/checks/registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/checks/urls.py", line 14, in check_url_config return check_resolver(resolver) File "/opt/mailmanve/lib/python3.9/site-packages/django/core/checks/urls.py", line 24, in check_resolver return check_method() File "/opt/mailmanve/lib/python3.9/site-packages/django/urls/resolvers.py", line 494, in check for pattern in self.url_patterns: File "/opt/mailmanve/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/opt/mailmanve/lib/python3.9/site-packages/django/urls/resolvers.py", line 715, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/opt/mailmanve/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/opt/mailmanve/lib/python3.9/site-packages/django/urls/resolvers.py", line 708, in urlconf_module return import_module(self.urlconf_name) File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 850, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/var/www/mailman-www/urls.py", line 20, in <module> from django.conf.urls import include, url ImportError: cannot import name 'url' from 'django.conf.urls' (/opt/mailmanve/lib/python3.9/site-packages/django/conf/urls/__init__.py)"
In Django 3.1 django.conf.urls.url was a deprecated alias to django.urls.re_path and in Django 4.0 it was removed. See, e.g. https://docs.djangoproject.com/en/3.2/ref/urls/ and https://docs.djangoproject.com/en/4.0/ref/urls/.
However, the above Traceback doesn't identify which module contains the
from django.conf.urls import include, url
import. If I look through our sources, I only find this import in mailman-suite/mailman-suite_project/urls.py as an example.
You need to look at your urls.py files. Try something like
grep -r 'from django.conf.urls import include, url' /opt/mailmanve/lib/python3.9/site-packages/
to find which module contains that import.
On 1/4/23 14:41, Mark Sapiro wrote:
On 1/4/23 13:54, Dan Caballero wrote:
...
File "/var/www/mailman-www/urls.py", line 20, in <module> from django.conf.urls import include, url ImportError: cannot import name 'url' from 'django.conf.urls' (/opt/mailmanve/lib/python3.9/site-packages/django/conf/urls/__init__.py)"
In Django 3.1 django.conf.urls.url was a deprecated alias to django.urls.re_path and in Django 4.0 it was removed. See, e.g. https://docs.djangoproject.com/en/3.2/ref/urls/ and https://docs.djangoproject.com/en/4.0/ref/urls/.
However, the above Traceback doesn't identify which module contains the
from django.conf.urls import include, url
Looking more closely, I see that it does. It is /var/www/mailman-www/urls.py.
That file probably has contents like
from django.conf.urls import include, url
from django.contrib import admin
from django.urls import reverse_lazy
from django.views.generic import RedirectView
urlpatterns = [
url(r'^$', RedirectView.as_view(
url=reverse_lazy('list_index'),
permanent=True)),
url(r'^postorius/', include('postorius.urls')),
url(r'^hyperkitty/', include('hyperkitty.urls')),
url(r'', include('django_mailman3.urls')),
url(r'^accounts/', include('allauth.urls')),
# Django admin
url(r'^admin/', admin.site.urls),
]
That needs to be changed to
from django.contrib import admin
from django.urls import include, reverse_lazy, re_path
from django.views.generic import RedirectView
urlpatterns = [
re_path(r'^$', RedirectView.as_view(
url=reverse_lazy('list_index'),
permanent=True)),
re_path(r'^postorius/', include('postorius.urls')),
re_path(r'^hyperkitty/', include('hyperkitty.urls')),
re_path(r'', include('django_mailman3.urls')),
re_path(r'^accounts/', include('allauth.urls')),
# Django admin
re_path(r'^admin/', admin.site.urls),
]
Thanks Mark. The migration completes after I updated the curls.py file.
I do see some warnings...
"WARNINGS: django_mailman3.MailDomain: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the DjangoMailman3Config.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. django_mailman3.Profile: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the DjangoMailman3Config.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. hyperkitty.Attachment: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. hyperkitty.Email: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. hyperkitty.Favorite: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. hyperkitty.LastView: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. hyperkitty.MailingList: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. hyperkitty.Profile: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. hyperkitty.Tag: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. hyperkitty.Tagging: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. hyperkitty.Thread: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. hyperkitty.ThreadCategory: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. hyperkitty.Vote: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. postorius.EmailTemplate: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the PostoriusConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'."
On 1/4/23 16:39, Dan Caballero wrote:
Thanks Mark. The migration completes after I updated the curls.py file.
I do see some warnings...
"WARNINGS: django_mailman3.MailDomain: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the DjangoMailman3Config.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
Set
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
in your Django settings to eliminate those warnings.