]> git.pld-linux.org Git - packages/python-django.git/commitdiff
- updated to 1.11.29
authorJakub Bogusz <qboosh@pld-linux.org>
Fri, 29 Jan 2021 21:03:28 +0000 (22:03 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Fri, 29 Jan 2021 21:03:28 +0000 (22:03 +0100)
- removed obsolete python3.7 patch
- added sphinx patch (adjust for Sphinx 2+)

python-django-sphinx.patch [new file with mode: 0644]
python-django.spec
python3.7.patch [deleted file]

diff --git a/python-django-sphinx.patch b/python-django-sphinx.patch
new file mode 100644 (file)
index 0000000..aac6b71
--- /dev/null
@@ -0,0 +1,33 @@
+BuildEnvironment.note_versionchange was deprecated in 1.8.0, removed in 2.x
+HTMLTranslator.highlightlang and .highlightlinenothreshold as well
+--- Django-1.11.29/docs/_ext/djangodocs.py.orig        2020-03-04 09:46:40.000000000 +0100
++++ Django-1.11.29/docs/_ext/djangodocs.py     2021-01-29 20:23:42.880898935 +0100
+@@ -4,6 +4,7 @@
+ import json
+ import os
+ import re
++import sys
+ from docutils import nodes
+ from docutils.parsers.rst import Directive, directives
+@@ -98,8 +99,8 @@
+     """
+     HTML document generator visit handler
+     """
+-    lang = self.highlightlang
+-    linenos = node.rawsource.count('\n') >= self.highlightlinenothreshold - 1
++    lang = self.builder.config.highlight_language
++    linenos = node.rawsource.count('\n') >= sys.maxsize - 1
+     fname = node['filename']
+     highlight_args = node.get('highlight_args', {})
+     if 'language' in node:
+@@ -227,7 +228,8 @@
+         node['type'] = self.name
+         if self.content:
+             self.state.nested_parse(self.content, self.content_offset, node)
+-        env.note_versionchange(node['type'], node['version'], node, self.lineno)
++        node.line = self.lineno
++        env.get_domain('changeset').note_changeset(node)
+         return ret
index 8f82dae58cbe8499af38f6bcd8f99b3bfdfc4404..ba8b5ec3755c45de81783d8ae12d7b1c8e145b80 100644 (file)
@@ -3,7 +3,7 @@
 %bcond_without doc     # Sphinx documentation
 %bcond_without python2 # CPython 2.x module
 %bcond_without python3 # CPython 3.x module
-%bcond_with    tests   # unit tests [some fail randomly as of 1.11.x]
+%bcond_with    tests   # unit tests [failing: 1E, 1F as of 1.11.29]
 
 %define                module          django
 %define                egg_name        Django
@@ -12,13 +12,14 @@ Summary(pl.UTF-8):  Szkielet WWW dla perfekcjonistów z ograniczeniami czasowymi
 Name:          python-%{module}
 # stay on LTS line
 # https://www.djangoproject.com/download/#supported-versions
-Version:       1.11.15
-Release:       2
+# keep 1.11.x here for python2 support
+Version:       1.11.29
+Release:       1
 License:       BSD
 Group:         Libraries/Python
 Source0:       https://www.djangoproject.com/m/releases/1.11/Django-%{version}.tar.gz
-# Source0-md5: 9c25bc2575a2cd357bcc5764f809d29d
-Patch0:                python3.7.patch
+# Source0-md5: e725953dfc63ea9e3b5b0898a8027bd7
+Patch0:                %{name}-sphinx.patch
 URL:           https://www.djangoproject.com/
 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
 BuildRequires: glibc-localedb-all
@@ -41,6 +42,9 @@ BuildRequires:        python3-setuptools
 BuildRequires: python3-pytz
 %endif
 %endif
+%if %{with doc}
+BuildRequires: sphinx-pdg >= 1.8
+%endif
 Suggests:      python-MySQLdb
 Suggests:      python-PyGreSQL
 Suggests:      python-devel-tools
@@ -87,7 +91,6 @@ Dokumentacja do Django.
 
 %prep
 %setup -q -n Django-%{version}
-
 %patch0 -p1
 
 %build
@@ -97,7 +100,7 @@ Dokumentacja do Django.
 %if %{with tests}
 LC_ALL=C.UTF-8 \
 PYTHONPATH=$(pwd)/build-2/lib \
-%{__python} tests/runtests.py
+%{__python} tests/runtests.py --parallel 1
 %endif
 %endif
 
@@ -107,23 +110,25 @@ PYTHONPATH=$(pwd)/build-2/lib \
 %if %{with tests}
 LC_ALL=C.UTF-8 \
 PYTHONPATH=$(pwd)/build-3/lib \
-%{__python3} tests/runtests.py
+%{__python3} tests/runtests.py --parallel 1
 %endif
 %endif
 
 %if %{with doc}
 %{__make} -C docs html
-%{__rm} -r docs/_build/html/_sources
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
+
 %if %{with python2}
 %py_install
 %py_postclean
 
 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{django-admin.py,django-admin-2}
 ln -s django-admin-2 $RPM_BUILD_ROOT%{_bindir}/py2-django-admin
+
+%{__sed} -i -e '1s,/usr/bin/env python$,%{__python},' $RPM_BUILD_ROOT%{py_sitescriptdir}/django/conf/project_template/manage.py-tpl
 %endif
 
 %if %{with python3}
@@ -131,6 +136,9 @@ ln -s django-admin-2 $RPM_BUILD_ROOT%{_bindir}/py2-django-admin
 
 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{django-admin.py,django-admin-3}
 ln -s django-admin-3 $RPM_BUILD_ROOT%{_bindir}/py3-django-admin
+
+%{__sed} -i -e '1s,/usr/bin/env python$,%{__python3},' $RPM_BUILD_ROOT%{py3_sitescriptdir}/django/conf/project_template/manage.py-tpl
+%{__sed} -i -e '1s,/usr/bin/env python$,%{__python3},' $RPM_BUILD_ROOT%{py3_sitescriptdir}/django/bin/django-admin.py
 %endif
 
 # setup "django-admin" global alias
@@ -139,7 +147,6 @@ ln -s django-admin-3 $RPM_BUILD_ROOT%{_bindir}/py3-django-admin
 %if %{with python2}
 # default to python2 if built
 ln -sf py2-django-admin $RPM_BUILD_ROOT%{_bindir}/django-admin
-# default to python2 if built
 %else
 %if %{with python3}
 ln -sf py3-django-admin $RPM_BUILD_ROOT%{_bindir}/django-admin
@@ -433,6 +440,6 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with doc}
 %files doc
 %defattr(644,root,root,755)
-%doc docs/_build/html/*
+%doc docs/_build/html/{_downloads,_images,_modules,_static,faq,howto,internals,intro,misc,ref,releases,topics,*.html,*.js}
 %{_docdir}/python-django-doc
 %endif
diff --git a/python3.7.patch b/python3.7.patch
deleted file mode 100644 (file)
index db806ee..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-From 931c60c5216bd71bc11f489e00e063331cf21f40 Mon Sep 17 00:00:00 2001
-From: Tim Graham <timograham@gmail.com>
-Date: Fri, 17 Nov 2017 15:38:29 -0500
-Subject: [PATCH] Refs #28814 -- Fixed "SyntaxError: Generator expression must
- be parenthesized" on Python 3.7.
-
-Due to https://bugs.python.org/issue32012.
----
- django/contrib/admin/widgets.py | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
-
-diff --git a/django/contrib/admin/widgets.py b/django/contrib/admin/widgets.py
-index b9d45a10eed4..dfb288642e6b 100644
---- a/django/contrib/admin/widgets.py
-+++ b/django/contrib/admin/widgets.py
-@@ -162,9 +162,7 @@ def get_context(self, name, value, attrs):
-             params = self.url_parameters()
-             if params:
--                related_url += '?' + '&amp;'.join(
--                    '%s=%s' % (k, v) for k, v in params.items(),
--                )
-+                related_url += '?' + '&amp;'.join('%s=%s' % (k, v) for k, v in params.items())
-             context['related_url'] = mark_safe(related_url)
-             context['link_title'] = _('Lookup')
-             # The JavaScript code looks for this class.
This page took 0.182252 seconds and 4 git commands to generate.