From e9f18c3ed9956bec07d6b71e391f7e275534663b Mon Sep 17 00:00:00 2001 From: bleizi Date: Wed, 24 Jan 2024 19:18:02 +0100 Subject: [PATCH] migrate to django 4.2 (LTS), change requirement and tests. remove depreciated ifnotequal --- .gitlab-ci.yml | 34 +++++++++--------- apps/note/templates/note/amount_input.html | 2 +- note_kfet/templates/autocomplete_model.html | 2 +- requirements.txt | 38 ++++++++++----------- tox.ini | 6 ++-- 5 files changed, 42 insertions(+), 40 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 97110ecd..98fbac88 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,21 +7,6 @@ stages: variables: GIT_SUBMODULE_STRATEGY: recursive -# Debian Buster -py37-django22: - stage: test - image: debian:buster-backports - before_script: - - > - apt-get update && - apt-get install --no-install-recommends -t buster-backports -y - python3-django python3-django-crispy-forms - python3-django-extensions python3-django-filters python3-django-polymorphic - python3-djangorestframework python3-django-oauth-toolkit python3-psycopg2 python3-pil - python3-babel python3-lockfile python3-pip python3-phonenumbers python3-memcache - python3-bs4 python3-setuptools tox texlive-xetex - script: tox -e py37-django22 - # Ubuntu 20.04 py38-django22: stage: test @@ -54,9 +39,26 @@ py39-django22: python3-bs4 python3-setuptools tox texlive-xetex script: tox -e py39-django22 +# Debian Bookworm +py311-django42: + stage: test + image: debian:bookworm + before_script: + - > + apt-get update && + apt-get install --no-install-recommends -y + python3-django python3-django-crispy-forms + python3-django-extensions python3-django-filters python3-django-polymorphic + python3-djangorestframework python3-django-oauth-toolkit python3-psycopg2 python3-pil + python3-babel python3-lockfile python3-pip python3-phonenumbers python3-memcache + python3-bs4 python3-setuptools tox texlive-xetex + script: tox -e py311-django42 + + + linters: stage: quality-assurance - image: debian:buster-backports + image: debian:bookworm before_script: - apt-get update && apt-get install -y tox script: tox -e linters diff --git a/apps/note/templates/note/amount_input.html b/apps/note/templates/note/amount_input.html index d4873115..cbe9d160 100644 --- a/apps/note/templates/note/amount_input.html +++ b/apps/note/templates/note/amount_input.html @@ -9,7 +9,7 @@ SPDX-License-Identifier: GPL-3.0-or-later name="{{ widget.name }}" {# Other attributes are loaded #} {% for name, value in widget.attrs.items %} - {% ifnotequal value False %}{{ name }}{% ifnotequal value True %}="{{ value|stringformat:'s' }}"{% endifnotequal %}{% endifnotequal %} + {% if value is not False %}{{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %} {% endfor %}>
diff --git a/note_kfet/templates/autocomplete_model.html b/note_kfet/templates/autocomplete_model.html index fa24213f..5ffe971d 100644 --- a/note_kfet/templates/autocomplete_model.html +++ b/note_kfet/templates/autocomplete_model.html @@ -8,7 +8,7 @@ SPDX-License-Identifier: GPL-3.0-or-later {% if widget.value != None and widget.value != "" %}value="{{ widget.value }}"{% endif %} name="{{ widget.name }}_name" autocomplete="off" {% for name, value in widget.attrs.items %} - {% ifnotequal value False %}{{ name }}{% ifnotequal value True %}="{{ value|stringformat:'s' }}"{% endifnotequal %}{% endifnotequal %} + {% if value is not False %}{{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %} {% endfor %} aria-describedby="{{widget.attrs.id}}_tooltip"> {% if widget.resetable %} diff --git a/requirements.txt b/requirements.txt index f4ece220..5548fd4b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,19 +1,19 @@ -beautifulsoup4~=4.7.1 -Django~=2.2.15 -django-bootstrap-datepicker-plus~=3.0.5 -django-cas-server~=1.2.0 -django-colorfield~=0.3.2 -django-crispy-forms~=1.7.2 -django-extensions>=2.1.4 -django-filter~=2.1 -django-htcpcp-tea~=0.3.1 -django-mailer~=2.0.1 -django-oauth-toolkit~=1.3.3 -django-phonenumber-field~=5.0.0 -django-polymorphic>=2.0.3,<3.0.0 -djangorestframework>=3.9.0,<3.13.0 -django-rest-polymorphic~=0.1.9 -django-tables2~=2.3.1 -python-memcached~=1.59 -phonenumbers~=8.9.10 -Pillow>=5.4.1 +beautifulsoup4~=4.12.3 +Django~=4.2.9 +django-bootstrap-datepicker-plus~=5.0.5 +django-cas-server~=2.0.0 +django-colorfield~=0.11.0 +django-crispy-forms~=2.1.0 +django-extensions>=3.2.3 +django-filter~=23.5 +django-htcpcp-tea~=0.8.1 +django-mailer~=2.3.1 +django-oauth-toolkit~=2.3.0 +django-phonenumber-field~=7.3.0 +django-polymorphic~=3.1.0 +djangorestframework~=3.14.0 +django-rest-polymorphic~=0.1.10 +django-tables2~=2.7.0 +python-memcached~=1.62 +phonenumbers~=8.13.28 +Pillow>=10.2.0 diff --git a/tox.ini b/tox.ini index ad3c6798..0526236f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,14 @@ [tox] envlist = - # Debian Buster Python - py37-django22 - # Ubuntu 20.04 Python py38-django22 # Debian Bullseye Python py39-django22 + # Debian Bookworm Python + py311-django42 + linters skipsdist = True