Hello community, here is the log from the commit of package python-django-babel for openSUSE:Factory checked in at 2018-12-13 19:48:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-django-babel (Old) and /work/SRC/openSUSE:Factory/.python-django-babel.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-babel" Thu Dec 13 19:48:41 2018 rev:2 rq:657107 version:0.6.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-django-babel/python-django-babel.changes 2018-03-30 12:09:14.357793269 +0200 +++ /work/SRC/openSUSE:Factory/.python-django-babel.new.28833/python-django-babel.changes 2018-12-13 19:48:42.564680381 +0100 @@ -1,0 +2,6 @@ +Tue Dec 11 09:45:05 UTC 2018 - Tomáš Chvátal <tchva...@suse.com> + +- Add patch django21.patch +- Run tests + +------------------------------------------------------------------- New: ---- django21.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-django-babel.spec ++++++ --- /var/tmp/diff_new_pack.FWhn0Z/_old 2018-12-13 19:48:43.644678984 +0100 +++ /var/tmp/diff_new_pack.FWhn0Z/_new 2018-12-13 19:48:43.644678984 +0100 @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -23,16 +23,19 @@ Summary: Utilities for using Babel in Django License: BSD-3-Clause Group: Development/Languages/Python -Url: http://github.com/graingert/django-babel/ +URL: http://github.com/graingert/django-babel/ Source: https://files.pythonhosted.org/packages/source/d/django-babel/django-babel-%{version}.tar.gz -BuildRequires: %{python_module devel} +Patch0: django21.patch +BuildRequires: %{python_module Babel >= 1.3} +BuildRequires: %{python_module Django >= 1.8} +BuildRequires: %{python_module pytest-django} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} +BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-Babel >= 1.3 Requires: python-Django >= 1.8 -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch - %python_subpackages %description @@ -45,15 +48,20 @@ %prep %setup -q -n django-babel-%{version} +%patch0 -p1 %build %python_build %install %python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +export PYTHONDONTWRITEBYTECODE=1 +%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} -v %files %{python_files} -%defattr(-,root,root,-) %license COPYING %doc README.rst CHANGELOG.rst %{python_sitelib}/* ++++++ django21.patch ++++++ >From 051e0f87afbb5143734c3b3500943d3a5e5e7881 Mon Sep 17 00:00:00 2001 From: Ivan Tsouvarev <tsouva...@gmail.com> Date: Fri, 7 Sep 2018 19:24:14 +0300 Subject: [PATCH] Fix imports of token types for Django 2.1 --- django_babel/extract.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/django_babel/extract.py b/django_babel/extract.py index edb42c7..2b28ce6 100644 --- a/django_babel/extract.py +++ b/django_babel/extract.py @@ -1,5 +1,20 @@ # -*- coding: utf-8 -*- -from django.template.base import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK +try: + from django.template.base import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK +except ImportError: + try: + # Django 1.8 moved most stuff to .base + from django.template.base import ( + Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK, + ) + except ImportError: + # Django 2.1+ + from django.template.base import Lexer, TokenType + + TOKEN_TEXT = TokenType.TEXT + TOKEN_VAR = TokenType.VAR + TOKEN_BLOCK = TokenType.BLOCK + from django.utils.translation import trim_whitespace from django.utils.encoding import smart_text