python313Packages.django: 4.2.x -> 5.2.x (bugfixes) (#396590)

This commit is contained in:
Martin Weinelt
2025-12-05 13:43:33 +00:00
committed by GitHub
11 changed files with 163 additions and 82 deletions
@@ -5,45 +5,52 @@
django-appconf,
fetchFromGitHub,
lib,
python,
pythonOlder,
pytestCheckHook,
pytest-django,
setuptools,
}:
buildPythonPackage rec {
buildPythonPackage {
pname = "django-cryptography";
version = "1.1";
disabled = pythonOlder "3.7";
format = "pyproject";
version = "1.1-unstable-2024-02-16";
pyproject = true;
src = fetchFromGitHub {
owner = "georgemarshall";
repo = "django-cryptography";
tag = version;
hash = "sha256-C3E2iT9JdLvF+1g+xhZ8dPDjjh25JUxLAtTMnalIxPk=";
rev = "a5cde9beed707a14a2ef2f1f7f1fee172feb8b5e";
hash = "sha256-Xj/fw8EapsYvVbZPRQ81yeE9QpIQ1TIuk+ASOCGh/Uc=";
};
nativeBuildInputs = [ setuptools ];
postPatch = ''
substituteInPlace setup.cfg \
--replace-fail "packages = django_cryptography" "packages = find:"
'';
propagatedBuildInputs = [
build-system = [ setuptools ];
dependencies = [
cryptography
django
django-appconf
];
patches = [
# See: https://github.com/georgemarshall/django-cryptography/pull/88
./fix-setup-cfg.patch
];
pythonImportsCheck = [ "django_cryptography" ];
checkPhase = ''
runHook preCheck
${python.interpreter} ./runtests.py
runHook postCheck
nativeCheckInputs = [
pytest-django
pytestCheckHook
];
preCheck = ''
export DJANGO_SETTINGS_MODULE=tests.settings
'';
disabledTests = [
# self.assertEqual(len(errors), 1) - AssertionError: 0 != 1
"test_field_checks"
];
meta = with lib; {
homepage = "https://github.com/georgemarshall/django-cryptography";
description = "Set of primitives for performing cryptography in Django";
@@ -1,16 +0,0 @@
diff --git a/setup.cfg b/setup.cfg
index 865b4c3..577d917 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -35,7 +35,10 @@ project_urls =
Documentation = https://django-cryptography.readthedocs.io
[options]
-packages = django_cryptography
+packages =
+ django_cryptography
+ django_cryptography.core
+ django_cryptography.utils
python_requires = >=3.6
include_package_data = True
install_requires =
@@ -1,20 +1,24 @@
{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
# build-system
setuptools,
# dependencies
django,
jinja2,
python,
# tests
pytest-django,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "django-jinja";
version = "2.11.0";
disabled = pythonOlder "3.8";
format = "setuptools";
pyproject = true;
src = fetchFromGitHub {
owner = "niwinz";
@@ -23,17 +27,34 @@ buildPythonPackage rec {
hash = "sha256-0gkv9xinHux8TRiNBLl/JgcimXU3CzysxzGR2jn7OZ4=";
};
propagatedBuildInputs = [
build-system = [ setuptools ];
dependencies = [
django
jinja2
];
checkPhase = ''
runHook preCheck
nativeCheckInputs = [
pytestCheckHook
pytest-django
];
${python.interpreter} testing/runtests.py
preCheck = ''
pushd testing
export DJANGO_SETTINGS_MODULE=settings
'';
runHook postCheck
pytestFlagsArray = [
"testapp/tests.py"
];
disabledTests = lib.optionals (lib.versionAtLeast django.version "5.2") [
# https://github.com/niwinz/django-jinja/issues/317
"test_autoscape_with_form_errors"
];
postCheck = ''
popd
'';
meta = {
@@ -5,9 +5,10 @@
djangorestframework,
fetchFromGitHub,
pytest-django,
pytest-xdist,
pytestCheckHook,
pythonOlder,
jwt,
pyjwt,
setuptools,
}:
@@ -35,16 +36,15 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytestCheckHook
pytest-django
jwt
pytest-xdist
pyjwt
];
pythonImportsCheck = [ "rest_registration" ];
disabledTests = [
# This test fails on Python 3.10
# Failed: DID NOT RAISE <class 'rest_registration.utils.html.MLStripperParseFailed'>
"test_convert_html_to_text_fails"
# This test is broken and was removed after 0.7.3. Remove this line once version > 0.7.3
"test_coreapi_autoschema_success"
];
meta = {
@@ -30,9 +30,9 @@ buildPythonPackage rec {
dependencies = [
django
icalendar
python-dateutil
pytz
icalendar
];
nativeCheckInputs = [
@@ -44,6 +44,24 @@ buildPythonPackage rec {
export DJANGO_SETTINGS_MODULE=tests.settings
'';
patches = [
# Remove in Django 5.1
# https://github.com/llazzaro/django-scheduler/pull/567
./index_together.patch
];
postPatch = ''
# Remove in Django 5.1
substituteInPlace tests/settings.py \
--replace-fail "SHA1PasswordHasher" "PBKDF2PasswordHasher"
'';
disabledTests = lib.optionals (lib.versionAtLeast django.version "5.1") [
# test_delete_event_authenticated_user - AssertionError: 302 != 200
"test_delete_event_authenticated_user"
"test_event_creation_authenticated_user"
];
pythonImportsCheck = [ "schedule" ];
meta = with lib; {
@@ -0,0 +1,65 @@
From d691550163941db6dbcec2f347fee4d3941615a0 Mon Sep 17 00:00:00 2001
From: Robin <robin@whoisearth.com>
Date: Wed, 1 Jan 2025 10:31:44 -0500
Subject: [PATCH 1/2] Update calendars.py
Django 5.1 ... index_together deprecated.
---
schedule/models/calendars.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/schedule/models/calendars.py b/schedule/models/calendars.py
index 81f8a7de..d37097a7 100644
--- a/schedule/models/calendars.py
+++ b/schedule/models/calendars.py
@@ -231,7 +231,7 @@ class CalendarRelation(models.Model):
class Meta:
verbose_name = _("calendar relation")
verbose_name_plural = _("calendar relations")
- index_together = [("content_type", "object_id")]
+ indexes = [models.Index(fields=["content_type", "object_id"])]
def __str__(self):
return "{} - {}".format(self.calendar, self.content_object)
From 768d2d3842ce6af8115741ef5758a72ab4659491 Mon Sep 17 00:00:00 2001
From: Robin <robin@whoisearth.com>
Date: Wed, 1 Jan 2025 10:32:56 -0500
Subject: [PATCH 2/2] Update events.py
Django 5.1 .... index_together deprecated
---
schedule/models/events.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/schedule/models/events.py b/schedule/models/events.py
index bf6fa5f1..bc9671c5 100644
--- a/schedule/models/events.py
+++ b/schedule/models/events.py
@@ -92,7 +92,7 @@ class Event(models.Model):
class Meta:
verbose_name = _("event")
verbose_name_plural = _("events")
- index_together = (("start", "end"),)
+ indexes = [models.Index(fields=["start", "end"])]
def __str__(self):
return gettext("%(title)s: %(start)s - %(end)s") % {
@@ -571,7 +571,7 @@ class EventRelation(models.Model):
class Meta:
verbose_name = _("event relation")
verbose_name_plural = _("event relations")
- index_together = [("content_type", "object_id")]
+ indexes = [models.Index(fields=["content_type", "object_id"])]
def __str__(self):
return "{}({})-{}".format(
@@ -594,7 +594,7 @@ class Occurrence(models.Model):
class Meta:
verbose_name = _("occurrence")
verbose_name_plural = _("occurrences")
- index_together = (("start", "end"),)
+ indexes = [models.Index(fields=["start", "end"])]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@@ -68,6 +68,8 @@ buildPythonPackage rec {
];
meta = with lib; {
# not updated to django 5.x
broken = lib.versionAtLeast django.version "5";
description = "Content management platform built using the Django framework";
mainProgram = "mezzanine-project";
longDescription = ''
@@ -9,21 +9,18 @@
poetry-core,
pylint-plugin-utils,
pytestCheckHook,
pythonOlder,
}:
buildPythonPackage rec {
pname = "pylint-django";
version = "2.6.1";
version = "2.6.1-unstable-2025-11-09";
pyproject = true;
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "PyCQA";
repo = "pylint-django";
tag = "v${version}";
hash = "sha256-9b0Sbo6E036UmUmP/CVPrS9cxxKtkMMZtqJsI53g4sU=";
rev = "e40d785abbf26af0738c14247fb4ac0aa7265b24";
hash = "sha256-INQSQjubcwQwspaxevXQOF92L2K9WRLMLYsP18Ffhos=";
};
build-system = [ poetry-core ];
@@ -2,18 +2,14 @@
lib,
buildPythonPackage,
fetchPypi,
# build-system
setuptools,
setuptools-scm,
wheel,
# dependencies
django,
pyscaffold,
configupdater,
pre-commit,
pytest,
pytest-cov,
pytest-xdist,
tox,
virtualenv,
}:
buildPythonPackage rec {
@@ -26,29 +22,19 @@ buildPythonPackage rec {
hash = "sha256-5yzF3VK/9VlCSrRsRJWX4arr9n34G2R6O5A51jTpLhg=";
};
nativeBuildInputs = [
build-system = [
setuptools
setuptools-scm
wheel
];
propagatedBuildInputs = [
dependencies = [
django
pyscaffold
];
optional-dependencies = {
testing = [
configupdater
pre-commit
pytest
pytest-cov
pytest-xdist
setuptools-scm
tox
virtualenv
];
};
pythonRelaxDeps = [ "django" ];
doCheck = false; # tests require git checkout
pythonImportsCheck = [ "pyscaffoldext.django" ];
+1
View File
@@ -26,6 +26,7 @@ lib.fix (
[1] 72a14ea563a3f5bf85db659349a533fe75a8b0ce
[2] f931bc81d63f5cfda55ac73d754c87b3fd63b291
*/
# https://gitlab.com/mailman/hyperkitty/-/merge_requests/681
django = super.django_4;
django-allauth = super.django-allauth.overrideAttrs (
+1 -1
View File
@@ -4093,7 +4093,7 @@ self: super: with self; {
django-ipware = callPackage ../development/python-modules/django-ipware { };
django-jinja = callPackage ../development/python-modules/django-jinja2 { };
django-jinja = callPackage ../development/python-modules/django-jinja { };
django-jquery-js = callPackage ../development/python-modules/django-jquery-js { };