diff --git a/Django-4.2.7.tar.gz b/Django-4.2.11.tar.gz similarity index 57% rename from Django-4.2.7.tar.gz rename to Django-4.2.11.tar.gz index d98225048e76c3108f050876842d48cdfd448775..bb776426e52d047a4c7f62371ee19dc8be42487f 100644 Binary files a/Django-4.2.7.tar.gz and b/Django-4.2.11.tar.gz differ diff --git a/dirty-hack-remove-assert.patch b/dirty-hack-remove-assert.patch deleted file mode 100644 index 7aa4002c61ebd2a6a75e67339ab4b57cef9ba757..0000000000000000000000000000000000000000 --- a/dirty-hack-remove-assert.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 36736edaf595d2bbf1fe881609b2a4c8e3bac68a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Thu, 29 Jun 2023 12:29:21 +0200 -Subject: [PATCH] Dirty hack: Remove a failing assert, failure does not seem - critical - ---- - tests/settings_tests/tests.py | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/tests/settings_tests/tests.py b/tests/settings_tests/tests.py -index 62cbffb..b7432d3 100644 ---- a/tests/settings_tests/tests.py -+++ b/tests/settings_tests/tests.py -@@ -397,7 +397,6 @@ class TestComplexSettingOverride(SimpleTestCase): - with self.assertWarnsMessage(UserWarning, msg) as cm: - with override_settings(TEST_WARN="override"): - self.assertEqual(settings.TEST_WARN, "override") -- self.assertEqual(cm.filename, __file__) - - - class SecureProxySslHeaderTest(SimpleTestCase): --- -2.40.1 - diff --git a/python-django.spec b/python-django.spec index c162dadb1c411088e161d8ce9a654e55f1597157..78d7a921e399dffdfd5c02b73990755e314e23f1 100644 --- a/python-django.spec +++ b/python-django.spec @@ -1,16 +1,21 @@ -%define anolis_release 2 +%define anolis_release 1 %global pkgname Django Name: python-django -Version: 4.2.7 +%global pkgname Django +%global ver 4.2.11 +#global pre ... +%global real_version %{ver}%{?pre:%{pre}} +Version: %{ver}%{?pre:~%{pre}} Release: %{anolis_release}%{?dist} Summary: A high-level Python Web framework License: BSD-3-Clause URL: https://www.djangoproject.com/ -Source0: %{pypi_source %{pkgname} %{version}} -# FAIL: test_complex_override_warning (settings_tests.tests.TestComplexSettingOverride.test_complex_override_warning) -Patch0: dirty-hack-remove-assert.patch +Source: %{pypi_source %{pkgname} %{real_version}} + +# This allows to build the package without tests, e.g. when bootstrapping new Python version +%bcond tests 1 BuildArch: noarch @@ -23,12 +28,12 @@ principle.} %description %_description -%package -n python3-django-bash-completion +%package bash-completion Summary: Bash completion files for Django BuildRequires: bash-completion Requires: bash-completion -%description -n python3-django-bash-completion +%description bash-completion This package contains the Bash completion files form Django high-level Python Web framework. @@ -46,7 +51,7 @@ Python Web framework. %package -n python3-django Summary: A high-level Python Web framework -Recommends: (python3-django-bash-completion = %{version}-%{release} if bash-completion) +Recommends: (%{name}-bash-completion = %{version}-%{release} if bash) BuildRequires: python3-devel BuildRequires: python3-asgiref @@ -57,7 +62,7 @@ Provides: bundled(xregexp) = 2.0.0 %description -n python3-django %_description %prep -%autosetup -p1 -n %{pkgname}-%{version} +%autosetup -p1 -n %{pkgname}-%{real_version} # hard-code python3 in django-admin pushd django @@ -75,10 +80,11 @@ sed -i '/^tzdata$/d' tests/requirements/py3.txt # Remove deps on code checkers/linters sed -i '/^black\b/d' tests/requirements/py3.txt +sed -i '/^black\b/d' docs/requirements.txt sed -i '/^blacken-docs\b/d' docs/requirements.txt %generate_buildrequires -%pyproject_buildrequires -r tests/requirements/{py3,mysql}.txt docs/requirements.txt +%pyproject_buildrequires -r %{?with_tests:tests/requirements/{py3,postgres,mysql,oracle}.txt} docs/requirements.txt %build %pyproject_wheel @@ -97,13 +103,12 @@ mkdir -p %{buildroot}%{_mandir}/man1/ cp -p docs/man/* %{buildroot}%{_mandir}/man1/ # install bash completion script -bashcompdir=$(pkg-config --variable=completionsdir bash-completion) -mkdir -p %{buildroot}$bashcompdir +mkdir -p %{buildroot}%{bash_completions_dir} install -m 0644 -p extras/django_bash_completion \ - %{buildroot}$bashcompdir/django-admin.py + %{buildroot}%{bash_completions_dir}/django-admin.py for file in django-admin django-admin-3 django-admin-%{python3_version} python3-django-admin manage.py ; do - ln -s django-admin.py %{buildroot}$bashcompdir/$file + ln -s django-admin.py %{buildroot}%{bash_completions_dir}/$file done # Add backward compatible links to %%{_bindir} @@ -116,20 +121,36 @@ find %{buildroot} -name "*.po" | xargs rm -f sed -i '/.po$/d' %{pyproject_files} %check -cd %{_builddir}/%{pkgname}-%{version} +# many contrib modules assume a configured app, "Requested setting INSTALLED_APPS..." +# the rest needs optional dependencies +%{pyproject_check_import \ + -e 'django.contrib.*' \ + -e 'django.core.serializers.pyyaml' \ + -e 'django.db.backends.mysql*' \ + -e 'django.db.backends.oracle*' \ + -e 'django.db.backends.postgresql*'} + +%if %{with tests} +cd %{_builddir}/%{pkgname}-%{real_version} export PYTHONPATH=$(pwd) cd tests -%{python3} runtests.py --settings=test_sqlite --verbosity=2 --parallel 1 +# disable two tests due to regression in 3.12b4: +# https://github.com/python/cpython/issues/106669 +%{python3} runtests.py --settings=test_sqlite --verbosity=2 --parallel 1 \ +%if v"%{python3_version}" >= v"3.12" + -k "not test_safe_mime_multipart and not test_unicode_address_header" +%endif +%endif -%files -n python3-django-bash-completion -%{_datadir}/bash-completion/* +%files bash-completion +%{bash_completions_dir}/* %files -n python3-django-doc -%doc AUTHORS README.rst %doc docs/_build/html/* %files -n python3-django -f %{pyproject_files} +%doc AUTHORS README.rst %license LICENSE %{_bindir}/django-admin %{_bindir}/django-admin-3 @@ -138,6 +159,10 @@ cd tests %{_mandir}/man1/django-admin.1* %changelog +* Tue May 9 2024 Cui lichen - 4.2.11-1 +- Fix for CVE-2024-27351 +- Fix for CVE-2024-24680 + * Wed Mar 27 2024 Zhao Hang - 4.2.7-2 - Rebuild with python3.11