mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
python3Packages.django_6: fix flaky test on aarch64-linux
(cherry picked from commit 83f160689f)
This commit is contained in:
parent
a37b229b12
commit
4a5860b8f8
2 changed files with 57 additions and 0 deletions
|
|
@ -62,6 +62,9 @@ buildPythonPackage (finalAttrs: {
|
|||
./6.x/pythonpath.patch
|
||||
# test_incorrect_timezone should raise but doesn't
|
||||
./6.x/disable-failing-test.patch
|
||||
# https://code.djangoproject.com/ticket/36997
|
||||
# https://github.com/django/django/pull/21019
|
||||
./6.x/invalidate-importlib-cache.patch
|
||||
]
|
||||
++ lib.optionals withGdal [
|
||||
(replaceVars ./6.x/gdal.patch {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
From 130ccbf51a5ad4810dcef46584661a818b7964d3 Mon Sep 17 00:00:00 2001
|
||||
From: gghezext <gghezext@comgest.com>
|
||||
Date: Sun, 29 Mar 2026 03:46:48 +0200
|
||||
Subject: [PATCH 1/2] Fixed #36997 -- Invalidated importlib caches after
|
||||
writing migration files.
|
||||
|
||||
---
|
||||
django/core/management/commands/makemigrations.py | 3 +++
|
||||
django/core/management/commands/squashmigrations.py | 2 ++
|
||||
docs/releases/6.1.txt | 5 ++++-
|
||||
3 files changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/django/core/management/commands/makemigrations.py b/django/core/management/commands/makemigrations.py
|
||||
index 7f711ed7aec4..355d626ce2c4 100644
|
||||
--- a/django/core/management/commands/makemigrations.py
|
||||
+++ b/django/core/management/commands/makemigrations.py
|
||||
@@ -1,3 +1,4 @@
|
||||
+import importlib
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
@@ -395,6 +396,7 @@ def write_migration_files(self, changes, update_previous_migration_paths=None):
|
||||
)
|
||||
self.log(writer.as_string())
|
||||
run_formatters(self.written_files, stderr=self.stderr)
|
||||
+ importlib.invalidate_caches()
|
||||
|
||||
@staticmethod
|
||||
def get_relative_path(path):
|
||||
@@ -502,6 +504,7 @@ def all_items_equal(seq):
|
||||
with open(writer.path, "w", encoding="utf-8") as fh:
|
||||
fh.write(writer.as_string())
|
||||
run_formatters([writer.path], stderr=self.stderr)
|
||||
+ importlib.invalidate_caches()
|
||||
if self.verbosity > 0:
|
||||
self.log("\nCreated new merge migration %s" % writer.path)
|
||||
if self.scriptable:
|
||||
diff --git a/django/core/management/commands/squashmigrations.py b/django/core/management/commands/squashmigrations.py
|
||||
index 9845b4d4567b..abc87717b66b 100644
|
||||
--- a/django/core/management/commands/squashmigrations.py
|
||||
+++ b/django/core/management/commands/squashmigrations.py
|
||||
@@ -1,3 +1,4 @@
|
||||
+import importlib
|
||||
import os
|
||||
import shutil
|
||||
|
||||
@@ -208,6 +209,7 @@ def handle(self, **options):
|
||||
with open(writer.path, "w", encoding="utf-8") as fh:
|
||||
fh.write(writer.as_string())
|
||||
run_formatters([writer.path], stderr=self.stderr)
|
||||
+ importlib.invalidate_caches()
|
||||
|
||||
if self.verbosity > 0:
|
||||
self.stdout.write(
|
||||
Loading…
Add table
Add a link
Reference in a new issue