diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-12 19:09:37 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-12 19:09:37 -0500 |
| commit | b590c8d7572b727d565cc0b8ff660d43569845de (patch) | |
| tree | 06f7a4102ea4e845df8b66660f252920d52952f9 /dev-python/django/files | |
| parent | 24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff) | |
| download | baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip | |
Adding metadata
Diffstat (limited to 'dev-python/django/files')
| -rw-r--r-- | dev-python/django/files/django-4.0-bashcomp.patch | 56 | ||||
| -rw-r--r-- | dev-python/django/files/django-4.2.21-py313.patch | 58 | ||||
| -rw-r--r-- | dev-python/django/files/django-5.2.7-py314.patch | 133 |
3 files changed, 247 insertions, 0 deletions
diff --git a/dev-python/django/files/django-4.0-bashcomp.patch b/dev-python/django/files/django-4.0-bashcomp.patch new file mode 100644 index 000000000000..06d121cce102 --- /dev/null +++ b/dev-python/django/files/django-4.0-bashcomp.patch @@ -0,0 +1,56 @@ +From 103a0f5559795f6517c24ab65d2305a8320acf8a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Wed, 6 May 2020 07:24:05 +0200 +Subject: [PATCH] Remove completions unsuitable for autoloading + +The override of 'python*' completions, as well as the attempt +to './manage.py' completion are not going to work with autoloader. +Strip them. +--- + extras/django_bash_completion | 33 +-------------------------------- + 1 file changed, 1 insertion(+), 32 deletions(-) + +diff --git a/extras/django_bash_completion b/extras/django_bash_completion +index 6fb941bef6..2f761ceb83 100755 +--- a/extras/django_bash_completion ++++ b/extras/django_bash_completion +@@ -36,35 +36,4 @@ _django_completion() + COMP_CWORD=$COMP_CWORD \ + DJANGO_AUTO_COMPLETE=1 $1 ) ) + } +-complete -F _django_completion -o default manage.py django-admin +- +-_python_django_completion() +-{ +- if [[ ${COMP_CWORD} -ge 2 ]]; then +- local PYTHON_EXE=${COMP_WORDS[0]##*/} +- if echo "$PYTHON_EXE" | grep -qE "python([3-9]\.[0-9])?"; then +- local PYTHON_SCRIPT=${COMP_WORDS[1]##*/} +- if echo "$PYTHON_SCRIPT" | grep -qE "manage\.py|django-admin"; then +- COMPREPLY=( $( COMP_WORDS=( "${COMP_WORDS[*]:1}" ) +- COMP_CWORD=$(( COMP_CWORD-1 )) +- DJANGO_AUTO_COMPLETE=1 ${COMP_WORDS[*]} ) ) +- fi +- fi +- fi +-} +- +-# Support for multiple interpreters. +-unset pythons +-if command -v whereis &>/dev/null; then +- python_interpreters=$(whereis python | cut -d " " -f 2-) +- for python in $python_interpreters; do +- [[ $python != *-config ]] && pythons="${pythons} ${python##*/}" +- done +- unset python_interpreters +- pythons=$(echo "$pythons" | tr " " "\n" | sort -u | tr "\n" " ") +-else +- pythons=python +-fi +- +-complete -F _python_django_completion -o default $pythons +-unset pythons ++complete -F _django_completion -o default django-admin +-- +2.34.1 + diff --git a/dev-python/django/files/django-4.2.21-py313.patch b/dev-python/django/files/django-4.2.21-py313.patch new file mode 100644 index 000000000000..e464efbe33a5 --- /dev/null +++ b/dev-python/django/files/django-4.2.21-py313.patch @@ -0,0 +1,58 @@ +From 18628d51012830f12a2a888223c6e5153729004d Mon Sep 17 00:00:00 2001 +From: Mariusz Felisiak <felisiak.mariusz@gmail.com> +Date: Tue, 20 Feb 2024 20:59:26 +0100 +Subject: [PATCH] Refs #34900 -- Fixed + CommandTypes.test_help_default_options_with_custom_arguments test on Python + 3.13+. + +https://github.com/python/cpython/commit/c4a2e8a2c5188c3288d57b80852e92c83f46f6f3 +--- + django/utils/version.py | 1 + + tests/admin_scripts/tests.py | 15 +++++++++++---- + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/django/utils/version.py b/django/utils/version.py +index 1e9c720299..71ec70bd67 100644 +--- a/django/utils/version.py ++++ b/django/utils/version.py +@@ -17,6 +17,7 @@ PY39 = sys.version_info >= (3, 9) + PY310 = sys.version_info >= (3, 10) + PY311 = sys.version_info >= (3, 11) + PY312 = sys.version_info >= (3, 12) ++PY313 = sys.version_info >= (3, 13) + + + def get_version(version=None): +diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py +index 6d67c2931a..8373560499 100644 +--- a/tests/admin_scripts/tests.py ++++ b/tests/admin_scripts/tests.py +@@ -33,6 +33,7 @@ from django.test import LiveServerTestCase, SimpleTestCase, TestCase, override_s + from django.test.utils import captured_stderr, captured_stdout + from django.urls import path + from django.utils.version import PY39 ++from django.utils.version import PY313 + from django.views.static import serve + + from . import urls +@@ -1900,10 +1901,16 @@ class CommandTypes(AdminScriptTestCase): + ] + for option in expected_options: + self.assertOutput(out, f"[{option}]") +- self.assertOutput(out, "--option_a OPTION_A, -a OPTION_A") +- self.assertOutput(out, "--option_b OPTION_B, -b OPTION_B") +- self.assertOutput(out, "--option_c OPTION_C, -c OPTION_C") +- self.assertOutput(out, "-v {0,1,2,3}, --verbosity {0,1,2,3}") ++ if PY313: ++ self.assertOutput(out, "--option_a, -a OPTION_A") ++ self.assertOutput(out, "--option_b, -b OPTION_B") ++ self.assertOutput(out, "--option_c, -c OPTION_C") ++ self.assertOutput(out, "-v, --verbosity {0,1,2,3}") ++ else: ++ self.assertOutput(out, "--option_a OPTION_A, -a OPTION_A") ++ self.assertOutput(out, "--option_b OPTION_B, -b OPTION_B") ++ self.assertOutput(out, "--option_c OPTION_C, -c OPTION_C") ++ self.assertOutput(out, "-v {0,1,2,3}, --verbosity {0,1,2,3}") + + def test_color_style(self): + style = color.no_style() diff --git a/dev-python/django/files/django-5.2.7-py314.patch b/dev-python/django/files/django-5.2.7-py314.patch new file mode 100644 index 000000000000..ba3fa0b0e617 --- /dev/null +++ b/dev-python/django/files/django-5.2.7-py314.patch @@ -0,0 +1,133 @@ +From 82592c9815409a1e023152f565a65b0105565ed2 Mon Sep 17 00:00:00 2001 +From: Mariusz Felisiak <felisiak.mariusz@gmail.com> +Date: Mon, 28 Jul 2025 23:21:17 +0200 +Subject: [PATCH] Fixed #36531 -- Added forkserver support to parallel test + runner. + +--- + django/db/backends/sqlite3/creation.py | 10 +++++----- + django/test/runner.py | 16 ++++++++++------ + tests/backends/sqlite/test_creation.py | 4 ++-- + tests/test_runner/test_discover_runner.py | 10 ++++++++++ + 4 files changed, 27 insertions(+), 13 deletions(-) + +diff --git a/django/db/backends/sqlite3/creation.py b/django/db/backends/sqlite3/creation.py +index 802e8b8357..8a07e0c417 100644 +--- a/django/db/backends/sqlite3/creation.py ++++ b/django/db/backends/sqlite3/creation.py +@@ -62,7 +62,7 @@ class DatabaseCreation(BaseDatabaseCreation): + start_method = multiprocessing.get_start_method() + if start_method == "fork": + return orig_settings_dict +- if start_method == "spawn": ++ if start_method in {"forkserver", "spawn"}: + return { + **orig_settings_dict, + "NAME": f"{self.connection.alias}_{suffix}.sqlite3", +@@ -99,9 +99,9 @@ class DatabaseCreation(BaseDatabaseCreation): + self.log("Got an error cloning the test database: %s" % e) + sys.exit(2) + # Forking automatically makes a copy of an in-memory database. +- # Spawn requires migrating to disk which will be re-opened in +- # setup_worker_connection. +- elif multiprocessing.get_start_method() == "spawn": ++ # Forkserver and spawn require migrating to disk which will be ++ # re-opened in setup_worker_connection. ++ elif multiprocessing.get_start_method() in {"forkserver", "spawn"}: + ondisk_db = sqlite3.connect(target_database_name, uri=True) + self.connection.connection.backup(ondisk_db) + ondisk_db.close() +@@ -137,7 +137,7 @@ class DatabaseCreation(BaseDatabaseCreation): + # Update settings_dict in place. + self.connection.settings_dict.update(settings_dict) + self.connection.close() +- elif start_method == "spawn": ++ elif start_method in {"forkserver", "spawn"}: + alias = self.connection.alias + connection_str = ( + f"file:memorydb_{alias}_{_worker_id}?mode=memory&cache=shared" +diff --git a/django/test/runner.py b/django/test/runner.py +index b83cd37343..cc2fb2ebdf 100644 +--- a/django/test/runner.py ++++ b/django/test/runner.py +@@ -387,8 +387,9 @@ def get_max_test_processes(): + The maximum number of test processes when using the --parallel option. + """ + # The current implementation of the parallel test runner requires +- # multiprocessing to start subprocesses with fork() or spawn(). +- if multiprocessing.get_start_method() not in {"fork", "spawn"}: ++ # multiprocessing to start subprocesses with fork(), forkserver(), or ++ # spawn(). ++ if multiprocessing.get_start_method() not in {"fork", "spawn", "forkserver"}: + return 1 + try: + return int(os.environ["DJANGO_TEST_PROCESSES"]) +@@ -433,9 +434,12 @@ def _init_worker( + counter.value += 1 + _worker_id = counter.value + +- start_method = multiprocessing.get_start_method() ++ is_spawn_or_forkserver = multiprocessing.get_start_method() in { ++ "forkserver", ++ "spawn", ++ } + +- if start_method == "spawn": ++ if is_spawn_or_forkserver: + if process_setup and callable(process_setup): + if process_setup_args is None: + process_setup_args = () +@@ -446,7 +450,7 @@ def _init_worker( + db_aliases = used_aliases if used_aliases is not None else connections + for alias in db_aliases: + connection = connections[alias] +- if start_method == "spawn": ++ if is_spawn_or_forkserver: + # Restore initial settings in spawned processes. + connection.settings_dict.update(initial_settings[alias]) + if value := serialized_contents.get(alias): +@@ -589,7 +593,7 @@ class ParallelTestSuite(unittest.TestSuite): + return iter(self.subsuites) + + def initialize_suite(self): +- if multiprocessing.get_start_method() == "spawn": ++ if multiprocessing.get_start_method() in {"forkserver", "spawn"}: + self.initial_settings = { + alias: connections[alias].settings_dict for alias in connections + } +diff --git a/tests/backends/sqlite/test_creation.py b/tests/backends/sqlite/test_creation.py +index 8aa24674d2..fe3959c85b 100644 +--- a/tests/backends/sqlite/test_creation.py ++++ b/tests/backends/sqlite/test_creation.py +@@ -36,8 +36,8 @@ class TestDbSignatureTests(SimpleTestCase): + clone_settings_dict = creation_class.get_test_db_clone_settings("1") + self.assertEqual(clone_settings_dict["NAME"], expected_clone_name) + +- @mock.patch.object(multiprocessing, "get_start_method", return_value="forkserver") ++ @mock.patch.object(multiprocessing, "get_start_method", return_value="unsupported") + def test_get_test_db_clone_settings_not_supported(self, *mocked_objects): +- msg = "Cloning with start method 'forkserver' is not supported." ++ msg = "Cloning with start method 'unsupported' is not supported." + with self.assertRaisesMessage(NotSupportedError, msg): + connection.creation.get_test_db_clone_settings(1) +diff --git a/tests/test_runner/test_discover_runner.py b/tests/test_runner/test_discover_runner.py +index 4f13cceeff..c6ce7f1e1d 100644 +--- a/tests/test_runner/test_discover_runner.py ++++ b/tests/test_runner/test_discover_runner.py +@@ -98,6 +98,16 @@ class DiscoverRunnerParallelArgumentTests(SimpleTestCase): + mocked_cpu_count, + ): + mocked_get_start_method.return_value = "forkserver" ++ self.assertEqual(get_max_test_processes(), 12) ++ with mock.patch.dict(os.environ, {"DJANGO_TEST_PROCESSES": "7"}): ++ self.assertEqual(get_max_test_processes(), 7) ++ ++ def test_get_max_test_processes_other( ++ self, ++ mocked_get_start_method, ++ mocked_cpu_count, ++ ): ++ mocked_get_start_method.return_value = "other" + self.assertEqual(get_max_test_processes(), 1) + with mock.patch.dict(os.environ, {"DJANGO_TEST_PROCESSES": "7"}): + self.assertEqual(get_max_test_processes(), 1) |
