[arch-commits] Commit in postorius/repos (8 files)
David Runge
dvzrv at gemini.archlinux.org
Sun Feb 20 15:14:19 UTC 2022
Date: Sunday, February 20, 2022 @ 15:14:18
Author: dvzrv
Revision: 1135287
archrelease: copy trunk to community-testing-any
Added:
postorius/repos/community-testing-any/
postorius/repos/community-testing-any/PKGBUILD
(from rev 1135286, postorius/trunk/PKGBUILD)
postorius/repos/community-testing-any/postorius-1.3.2-settings.patch
(from rev 1135286, postorius/trunk/postorius-1.3.2-settings.patch)
postorius/repos/community-testing-any/postorius-1.3.6-django4.0.patch
(from rev 1135286, postorius/trunk/postorius-1.3.6-django4.0.patch)
postorius/repos/community-testing-any/postorius.install
(from rev 1135286, postorius/trunk/postorius.install)
postorius/repos/community-testing-any/postorius.sysusers
(from rev 1135286, postorius/trunk/postorius.sysusers)
postorius/repos/community-testing-any/postorius.tmpfiles
(from rev 1135286, postorius/trunk/postorius.tmpfiles)
postorius/repos/community-testing-any/postorius.uwsgi
(from rev 1135286, postorius/trunk/postorius.uwsgi)
---------------------------------+
PKGBUILD | 93 +++++++++++++++++++++
postorius-1.3.2-settings.patch | 31 +++++++
postorius-1.3.6-django4.0.patch | 163 ++++++++++++++++++++++++++++++++++++++
postorius.install | 9 ++
postorius.sysusers | 1
postorius.tmpfiles | 7 +
postorius.uwsgi | 18 ++++
7 files changed, 322 insertions(+)
Copied: postorius/repos/community-testing-any/PKGBUILD (from rev 1135286, postorius/trunk/PKGBUILD)
===================================================================
--- community-testing-any/PKGBUILD (rev 0)
+++ community-testing-any/PKGBUILD 2022-02-20 15:14:18 UTC (rev 1135287)
@@ -0,0 +1,93 @@
+# Maintainer: David Runge <dvzrv at archlinux.org>
+
+pkgname=postorius
+pkgver=1.3.6
+pkgrel=3
+pkgdesc="The New Mailman Web UI"
+arch=(any)
+url="https://gitlab.com/mailman/postorius"
+license=(GPL3)
+depends=(python-cmarkgfm python-django python-django-mailman3
+python-mailmanclient python-readme-renderer)
+makedepends=(git python-setuptools)
+checkdepends=(mailman3 python-beautifulsoup4 python-isort python-mock
+python-pytest python-pytest-django python-vcrpy)
+optdepends=('mailman3: for configuring a local mailman instance'
+ 'uwsgi-plugin-python: for running inside uwsgi')
+replaces=(python-django-postorius)
+backup=("etc/uwsgi/${pkgname}.ini"
+ "etc/webapps/${pkgname}/settings_local.py"
+ "etc/webapps/${pkgname}/urls.py"
+)
+install="${pkgname}.install"
+# the signature for the pypi sdist tarball for 1.3.6 is missing the chain of trust:
+# https://gitlab.com/mailman/postorius/-/issues/537
+# source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/${pkgname}/${pkgname}-${pkgver}.tar.gz"{,.asc}
+source=(
+ git+https://gitlab.com/mailman/$pkgname#tag=$pkgver?signed
+ $pkgname-1.3.2-settings.patch
+ $pkgname.sysusers
+ $pkgname.tmpfiles
+ $pkgname.uwsgi
+ $pkgname-1.3.6-django4.0.patch
+)
+sha512sums=('SKIP'
+ '53713874043e368c71543966e878ff7a49f03088b7ebcff9487935bef2c20a57a561a122dd6b4cbde126c25b935871288dadd7693b831a94b8f27da52afeaa0c'
+ '3884b818da2deb148279e50316f720c95f0aaa529777b1b3662d8ab253cda823a90682a9eb47e941ca5ba80eefcb9a2d4afacd29f0340d7f9828b36ebcee23b3'
+ '44925c7ce6d1c13bd5bdd2cb449fa978b8eaadaac7ecff74075c23a13478decc4acd1f2cd0399bf55c312d6a08985a3e80f6e7a6e85be9e3dcb93ffb526ca9fb'
+ 'c042f00d0d8dc72dadd19023152e55246c4d7a4b9d53bca3a05e7b8cb38cac5116417440d4ae82350820c7cb0cd414dcce45fa6af9be19296c4ebd0862dba896'
+ '3ebb4f0f02d1ef793504b6e2fb7f2cecf5ed3acc8c1fdda6fa2fc2808644aa55f979203d070aa1ca1f1f8430a6e9c30ee653ede99523600f499db872a0640fce')
+b2sums=('SKIP'
+ 'c4017fe87b8743ae516e360be97efd767d726b043733a6dd880503e796e28f65c9ad5924b0fef53281e4fa73a1a329e818baedbe5dbbc0dc07db2af0cf25f1b7'
+ '1ef6dc98c6751e6d65e49812d08d813879b791a7f13622ea31ecadae6dd1859a918761d7723732ed2e4872b9cae61b84c8dbfec2dd2522de9f0929a1ee1cec24'
+ '502d59cb0009b7cdf108a1611d17470d1a73c2d06bf6d9509799b63d4bbb4bb0a2cb71a39eddb0dc5990ee6489625174de6ce2d7e04e77a601c90a6da6d69c84'
+ '4b80d60c88d46edd0e6e61ad2ff37ba3568c6c56a2abd449f903f7302aeec4a3bc91bbd3ee846731513fa1906df2e3d7d1c52b75a55214051fb96b048f9b4999'
+ 'a74dc3e0c818e753320f15fa063bdfa531b6c3405475f2da45a7203c1c188819d90adc164f917577ac09a5216255a896c1fa0d11ea1aa2f680bd73fddd246422')
+validpgpkeys=('541EA0448453394FF77A0ECC9D9B2BA061D0A67C') # Abhilash Raj <raj.abhilash1 at gmail.com>
+
+prepare() {
+ # patch global paths into settings.py
+ patch -d $pkgname -p1 -i ../$pkgname-1.3.2-settings.patch
+ # make compatible with django 4.0: https://gitlab.com/mailman/postorius/-/merge_requests/694
+ patch -d $pkgname -p1 -i ../$pkgname-1.3.6-django4.0.patch
+
+ touch settings_local.py
+}
+
+build() {
+ cd $pkgname
+ python setup.py build
+}
+
+check() {
+ cd $pkgname/example_project
+
+ export PYTHONPATH="../build/lib:$PYTHONPATH"
+ PYTHONDONTWRITEBYTECODE=1
+ pytest -vv ../build/lib/$pkgname
+}
+
+package() {
+ cd $pkgname
+ python setup.py install --optimize=1 --root="$pkgdir"
+ # django project
+ install -vDm 644 example_project/{__init__,manage,settings,wsgi}.py -t "$pkgdir/usr/share/webapps/$pkgname"
+ # symlink locale and static dirs to state dir
+ ln -svf /var/lib//$pkgname/locale/ "$pkgdir/usr/share/webapps/$pkgname"
+ ln -svf /var/lib/$pkgname/static/ "$pkgdir/usr/share/webapps/$pkgname"
+ # state dir
+ install -vdm 750 "$pkgdir/var/lib/$pkgname/data"
+ install -vdm 755 "$pkgdir/var/lib/$pkgname/"{locale,static}
+ # log dir
+ install -vdm 750 "$pkgdir/var/log/$pkgname"
+ # config
+ install -vDm 640 ../settings_local.py example_project/urls.py -t "$pkgdir/etc/webapps/$pkgname"
+ ln -svf /etc/webapps/$pkgname/settings_local.py "$pkgdir/usr/share/webapps/$pkgname/settings_local.py"
+ ln -svf /etc/webapps/$pkgname/urls.py "$pkgdir/usr/share/webapps/$pkgname/urls.py"
+ # uwsgi
+ install -vDm 644 ../$pkgname.uwsgi "$pkgdir/etc/uwsgi/$pkgname.ini"
+ # tmpfiles.d
+ install -vDm 644 ../$pkgname.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
+ # sysusers.d
+ install -vDm 644 ../$pkgname.sysusers "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
+}
Copied: postorius/repos/community-testing-any/postorius-1.3.2-settings.patch (from rev 1135286, postorius/trunk/postorius-1.3.2-settings.patch)
===================================================================
--- community-testing-any/postorius-1.3.2-settings.patch (rev 0)
+++ community-testing-any/postorius-1.3.2-settings.patch 2022-02-20 15:14:18 UTC (rev 1135287)
@@ -0,0 +1,31 @@
+diff --git c/example_project/settings.py w/example_project/settings.py
+index c54af7e..d05535b 100644
+--- c/example_project/settings.py
++++ w/example_project/settings.py
+@@ -136,7 +136,7 @@ WSGI_APPLICATION = 'wsgi.application'
+ DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+- 'NAME': os.path.join(BASE_DIR, 'postorius.db'),
++ 'NAME': '/var/lib/postorius/data/postorius.db',
+ }
+ }
+
+@@ -180,7 +180,7 @@ USE_TZ = True
+ # Don't put anything in this directory yourself; store your static files
+ # in apps' "static/" subdirectories and in STATICFILES_DIRS.
+ # Example: "/var/www/example.com/static/"
+-STATIC_ROOT = os.path.join(BASE_DIR, 'static')
++STATIC_ROOT = '/var/lib/postorius/static'
+
+ # URL prefix for static files.
+ # Example: "http://example.com/static/", "http://static.example.com/"
+@@ -259,7 +259,7 @@ LOGGING = {
+ 'level': 'INFO',
+ #'class': 'logging.handlers.RotatingFileHandler',
+ 'class': 'logging.handlers.WatchedFileHandler',
+- 'filename': os.path.join(BASE_DIR, 'logs', 'postorius.log'),
++ 'filename': '/var/log/postorius/postorius.log',
+ 'formatter': 'verbose',
+ },
+ },
Copied: postorius/repos/community-testing-any/postorius-1.3.6-django4.0.patch (from rev 1135286, postorius/trunk/postorius-1.3.6-django4.0.patch)
===================================================================
--- community-testing-any/postorius-1.3.6-django4.0.patch (rev 0)
+++ community-testing-any/postorius-1.3.6-django4.0.patch 2022-02-20 15:14:18 UTC (rev 1135287)
@@ -0,0 +1,163 @@
+From 7c9c080333d5340c2c031ad4258489fe3f91b64a Mon Sep 17 00:00:00 2001
+From: David Runge <dave at sleepmap.de>
+Date: Sun, 20 Feb 2022 15:42:27 +0100
+Subject: [PATCH 1/4] forms/fields compatibility with django >= 4.0
+
+src/postorius/forms/fields.py:
+Use `django.utils.encoding.smart_str` (introduced with django 4.0) by
+default and fall back to `django.utils.encoding.smart_text` (django <
+4.0) otherwise.
+---
+ src/postorius/forms/fields.py | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/postorius/forms/fields.py b/src/postorius/forms/fields.py
+index f1578615..6235260b 100644
+--- a/src/postorius/forms/fields.py
++++ b/src/postorius/forms/fields.py
+@@ -19,7 +19,14 @@
+
+
+ from django import forms
+-from django.utils.encoding import smart_text
++
++
++try:
++ from django.utils.encoding import smart_str
++except ImportError:
++ # django < 4.0
++ from django.utils.encoding import smart_text as smart_str
++
+ from django.utils.translation import gettext_lazy as _
+
+ from postorius.utils import with_empty_choice
+@@ -62,7 +69,7 @@ class ListOfStringsField(forms.Field):
+ line = line.strip()
+ if not line:
+ continue
+- result.append(smart_text(line))
++ result.append(smart_str(line))
+ return result
+
+
+--
+GitLab
+
+
+From 1b711c0adb063f165e00ed604a398c769f34b9e3 Mon Sep 17 00:00:00 2001
+From: David Runge <dave at sleepmap.de>
+Date: Sun, 20 Feb 2022 15:45:19 +0100
+Subject: [PATCH 2/4] Move the upper boundary for django to < 4.1
+
+setup.py:
+As postorius is compatible with django 4.0, set the upper boundary to <
+4.1.
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 9a900eee..18374c10 100644
+--- a/setup.py
++++ b/setup.py
+@@ -54,7 +54,7 @@ setup(
+ include_package_data=True,
+ install_requires=[
+ 'django-mailman3>=1.3.7',
+- 'django>=2.2,<3.3',
++ 'django>=2.2,<4.1',
+ 'mailmanclient>=3.3.3',
+ 'readme_renderer[md]',
+ ],
+--
+GitLab
+
+
+From 3dfa2cca5ea7d764e69e6a4c37feb3808755b69d Mon Sep 17 00:00:00 2001
+From: David Runge <dave at sleepmap.de>
+Date: Sun, 20 Feb 2022 15:46:30 +0100
+Subject: [PATCH 3/4] Add python 3.10 and django 4.0 support to tox
+
+tox.ini:
+Add environments for python 3.10 and django 4.0
+---
+ tox.ini | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/tox.ini b/tox.ini
+index 744dbbc8..bce92d5a 100644
+--- a/tox.ini
++++ b/tox.ini
+@@ -1,5 +1,5 @@
+ [tox]
+-envlist = py{36,37,38,39}-django{22,31,32,-latest},qa
++envlist = py{36,37,38,39,310}-django{22,31,32,-latest},qa
+
+ [testenv]
+ usedevelop = True
+@@ -20,6 +20,7 @@ deps =
+ django30: Django>=3.0,<3.1
+ django31: Django>=3.1,<3.2
+ django32: Django>=3.2,<3.3
++ django40: Django>=4.0,<4.1
+ django-latest: https://github.com/django/django/archive/main.tar.gz
+ commands =
+ pytest {posargs:../src}
+@@ -31,7 +32,7 @@ setenv =
+ basepython = python3
+ deps =
+ {[testenv]deps}
+- Django>=3.2,<3.3
++ Django>=3.2,<4.1
+ coverage
+ commands =
+ coverage run -m pytest {posargs:../src/postorius}
+--
+GitLab
+
+
+From b5e9c49cf710295f53b340f22c7d2ec5cbb7a9da Mon Sep 17 00:00:00 2001
+From: David Runge <dave at sleepmap.de>
+Date: Sun, 20 Feb 2022 15:47:44 +0100
+Subject: [PATCH 4/4] Add python 3.10 and django 4.0 targets to gitlab CI
+
+.gitlab-ci.yml:
+Run tests against latest django using python 3.10.
+Add test targets against django 3.2 and 4.0 on python 3.10.
+---
+ .gitlab-ci.yml | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
+index ba6cea8c..9e9da7f4 100644
+--- a/.gitlab-ci.yml
++++ b/.gitlab-ci.yml
+@@ -66,13 +66,23 @@ py39-django32:
+ script:
+ - tox -e py39-django32
+
+-py39-django-latest:
++py310-django32:
++ stage: test
++ script:
++ - tox -e py310-django32
++
++py310-django40:
++ stage: test
++ script:
++ - tox -e py310-django40
++
++py310-django-latest:
+ stage: test
+ allow_failure: true
+ script:
+ - printf "Remove all django version restriction from setup.py.\n"
+ - sed -E 's/django[<=>,.[:digit:]]+/django/' -i setup.py
+- - tox -e py39-django-latest
++ - tox -e py310-django-latest
+
+ coverage:
+ stage: test
+--
+GitLab
+
Copied: postorius/repos/community-testing-any/postorius.install (from rev 1135286, postorius/trunk/postorius.install)
===================================================================
--- community-testing-any/postorius.install (rev 0)
+++ community-testing-any/postorius.install 2022-02-20 15:14:18 UTC (rev 1135287)
@@ -0,0 +1,9 @@
+post_install() {
+ echo "Run the following to create/migrate the database:"
+ echo "sudo -u postorius django-admin migrate --pythonpath /usr/share/webapps/postorius/ --settings settings"
+}
+
+post_upgrade() {
+ echo "Run the following to update static files and compress them:"
+ echo "sudo -u postorius django-admin collectstatic --pythonpath /usr/share/webapps/postorius --settings settings"
+}
Copied: postorius/repos/community-testing-any/postorius.sysusers (from rev 1135286, postorius/trunk/postorius.sysusers)
===================================================================
--- community-testing-any/postorius.sysusers (rev 0)
+++ community-testing-any/postorius.sysusers 2022-02-20 15:14:18 UTC (rev 1135287)
@@ -0,0 +1 @@
+u postorius - "GNU Mailman Web User Interface" -
Copied: postorius/repos/community-testing-any/postorius.tmpfiles (from rev 1135286, postorius/trunk/postorius.tmpfiles)
===================================================================
--- community-testing-any/postorius.tmpfiles (rev 0)
+++ community-testing-any/postorius.tmpfiles 2022-02-20 15:14:18 UTC (rev 1135287)
@@ -0,0 +1,7 @@
+z /etc/webapps/postorius/settings_local.py 0640 root postorius -
+z /etc/webapps/postorius/urls.py 0640 root postorius -
+d %L/postorius 750 postorius postorius -
+d %S/postorius/data 750 postorius postorius -
+d %S/postorius/locale - postorius postorius -
+d %S/postorius/static - postorius postorius -
+d %t/postorius - postorius postorius -
Copied: postorius/repos/community-testing-any/postorius.uwsgi (from rev 1135286, postorius/trunk/postorius.uwsgi)
===================================================================
--- community-testing-any/postorius.uwsgi (rev 0)
+++ community-testing-any/postorius.uwsgi 2022-02-20 15:14:18 UTC (rev 1135287)
@@ -0,0 +1,18 @@
+[uwsgi]
+procname-master = postorius
+master = true
+plugins = python
+socket = /run/postorius/%n.sock
+stats = /run/postorius/%n-stats.sock
+uid = postorius
+gid = postorius
+processes = 10
+cheaper = 2
+cheaper-step = 1
+idle = 120
+die-on-idle = true
+chdir = /usr/share/webapps/postorius
+module = wsgi
+home = /
+touch-reload = %p
+vacuum = true
More information about the arch-commits
mailing list