commit python-django-sekizai for openSUSE:Factory
Hello community, here is the log from the commit of package python-django-sekizai for openSUSE:Factory checked in at 2019-05-24 11:33:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-django-sekizai (Old) and /work/SRC/openSUSE:Factory/.python-django-sekizai.new.5148 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-django-sekizai" Fri May 24 11:33:26 2019 rev:2 rq:705177 version:1.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-django-sekizai/python-django-sekizai.changes 2019-01-11 14:04:35.551854179 +0100 +++ /work/SRC/openSUSE:Factory/.python-django-sekizai.new.5148/python-django-sekizai.changes 2019-05-24 11:33:28.073364903 +0200 @@ -1,0 +2,9 @@ +Fri May 24 07:17:38 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com> + +- Update to 1.0.0: + * Fixes for new djangos/python releases +- Remove merged patches: + * django-sekizai-py37.patch + * django-sekizai-django2.patch + +------------------------------------------------------------------- Old: ---- 0.10.0.tar.gz django-sekizai-django2.patch django-sekizai-py37.patch New: ---- 1.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-django-sekizai.spec ++++++ --- /var/tmp/diff_new_pack.7ULQBO/_old 2019-05-24 11:33:28.941364572 +0200 +++ /var/tmp/diff_new_pack.7ULQBO/_new 2019-05-24 11:33:28.945364570 +0200 @@ -18,16 +18,14 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-django-sekizai -Version: 0.10.0 +Version: 1.0.0 Release: 0 Summary: Django Template Blocks with extra functionality License: MIT Group: Development/Languages/Python URL: https://github.com/ojii/django-sekizai Source: https://github.com/divio/django-sekizai/archive/%{version}.tar.gz -Patch0: django-sekizai-django2.patch -Patch1: django-sekizai-pycodestyle.patch -Patch2: django-sekizai-py37.patch +Patch0: django-sekizai-pycodestyle.patch BuildRequires: %{python_module Django >= 1.11} BuildRequires: %{python_module django-classy-tags >= 0.3.1} BuildRequires: %{python_module pycodestyle} @@ -44,9 +42,7 @@ %prep %setup -q -n django-sekizai-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 +%autopatch -p1 %build %python_build ++++++ 0.10.0.tar.gz -> 1.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-sekizai-0.10.0/.travis.yml new/django-sekizai-1.0.0/.travis.yml --- old/django-sekizai-0.10.0/.travis.yml 2016-08-28 06:25:48.000000000 +0200 +++ new/django-sekizai-1.0.0/.travis.yml 2019-04-11 14:03:34.000000000 +0200 @@ -1,19 +1,17 @@ +dist: xenial language: python sudo: false python: - 2.7 - - 3.3 - 3.4 - 3.5 + - 3.6 + - 3.7 env: - - DJANGO='django>=1.3,<1.4' - - DJANGO='django>=1.4,<1.5' - - DJANGO='django>=1.5,<1.6' - - DJANGO='django>=1.6,<1.7' - - DJANGO='django>=1.7,<1.8' - - DJANGO='django>=1.8,<1.9' - - DJANGO='django>=1.9,<1.10' - - DJANGO='django>=1.10,<1.11' + - DJANGO='django>=1.11,<2.0' + - DJANGO='django>=2.0,<2.1' + - DJANGO='django>=2.1,<2.2' + - DJANGO='django>=2.2a1,<3.0' install: - pip install $DJANGO django-classy-tags pep8 backport-collections script: python runtests.py @@ -21,25 +19,13 @@ email: false matrix: exclude: - - python: 3.3 - env: DJANGO='django>=1.3,<1.4' - - python: 3.3 - env: DJANGO='django>=1.4,<1.5' - - python: 3.3 - env: DJANGO='django>=1.9,<1.10' - - python: 3.3 - env: DJANGO='django>=1.10,<1.11' + - python: 2.7 + env: DJANGO='django>=2.0,<2.1' + - python: 2.7 + env: DJANGO='django>=2.1,<2.2' + - python: 2.7 + env: DJANGO='django>=2.2a1,<3.0' - python: 3.4 - env: DJANGO='django>=1.3,<1.4' + env: DJANGO='django>=2.1,<2.2' - python: 3.4 - env: DJANGO='django>=1.4,<1.5' - - python: 3.5 - env: DJANGO='django>=1.3,<1.4' - - python: 3.5 - env: DJANGO='django>=1.4,<1.5' - - python: 3.5 - env: DJANGO='django>=1.5,<1.6' - - python: 3.5 - env: DJANGO='django>=1.6,<1.7' - - python: 3.5 - env: DJANGO='django>=1.7,<1.8' + env: DJANGO='django>=2.2a1,<3.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-sekizai-0.10.0/README.rst new/django-sekizai-1.0.0/README.rst --- old/django-sekizai-0.10.0/README.rst 2016-08-28 06:25:48.000000000 +0200 +++ new/django-sekizai-1.0.0/README.rst 2019-04-11 14:03:34.000000000 +0200 @@ -7,7 +7,7 @@ forms in django, but really that doesn't work that well. Usually the frontend guys want to decide on css and javascript files to be included and they don't want to have to edit Python files to change that neither did I want them to -change my Python files. Therefor there was a need to allow you to edit contents +change my Python files. Therefore there was a need to allow you to edit contents of templates which are before or after the point where you are now. Also I wanted duplicates to be removed. As a result I wrote django-sekizai, which does exactly that. It's similar to blocks, just instead of inheriting them, you diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-sekizai-0.10.0/docs/index.rst new/django-sekizai-1.0.0/docs/index.rst --- old/django-sekizai-0.10.0/docs/index.rst 2016-08-28 06:25:48.000000000 +0200 +++ new/django-sekizai-1.0.0/docs/index.rst 2019-04-11 14:03:34.000000000 +0200 @@ -24,15 +24,14 @@ blocks. This is especially useful for css and javascript. Your sub-templates can now define css and Javascript files to be included, and the css will be nicely put at the top and the Javascript to the bottom, just like you should. Also -sekizai will ignore any duplicate content in a single block. +sekizai will ignore any duplicate content in a single block. ************ Dependencies ************ -* Python 2.7, 3.3, 3.4 or 3.5. -* Django 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9 or 1.10. +* Django 1.11, 2.0, 2.1, or 2.2. * django-classy-tags 0.3.1 or higher. ***** @@ -47,15 +46,10 @@ * Put 'sekizai' into your ``INSTALLED_APPS`` setting. * Use one of the following: - * For Django versions before 1.10, add - ``sekizai.context_processors.sekizai`` to your - ``TEMPLATE_CONTEXT_PROCESSORS`` setting and use + * Add ``sekizai.context_processors.sekizai`` to your + ``TEMPLATES['OPTIONS']['context_processors']`` setting and use ``django.template.RequestContext`` when rendering your templates. - For Django versions after 1.10, add ``sekizai.context_processors.sekizai`` - to your ``TEMPLATES['OPTIONS']['context_processors']`` setting and use - ``django.template.RequestContext`` when rendering your templates. - or * Use ``sekizai.context.SekizaiContext`` when rendering your templates. @@ -137,7 +131,7 @@ .. warning:: ``{% render_block %}`` tags **must not** be placed inside a template tag block (a template tag which has an - end tag, such as ``{% block %}...{% endblock %}`` or ``{% if %}...{% endif %}``). + end tag, such as ``{% block %}...{% endblock %}`` or ``{% if %}...{% endif %}``). .. warning:: @@ -148,6 +142,10 @@ If the ``{% addtoblock %}`` tag is used in an **extending** template, the tags **must** be placed within ``{% block %}...{% endblock %}`` tags. +.. warning:: + + ``{% addtoblock %}`` tags **must not** be used in a template included with ``only`` option! + Handling data ------------- @@ -430,6 +428,12 @@ Changelog ********* +0.11.0 +====== + +* Added support for Django 1.11, 2.0, 2.1, and 2.2 +* Removed support for Django < 1.11 + 0.10.0 ====== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-sekizai-0.10.0/runtests.py new/django-sekizai-1.0.0/runtests.py --- old/django-sekizai-0.10.0/runtests.py 2016-08-28 06:25:48.000000000 +0200 +++ new/django-sekizai-1.0.0/runtests.py 2019-04-11 14:03:34.000000000 +0200 @@ -4,8 +4,6 @@ urlpatterns = [] -TEMPLATE_DEBUG = True - DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', @@ -13,59 +11,38 @@ } } - INSTALLED_APPS = [ 'sekizai', ] -TEMPLATE_DIRS = [ - os.path.join(os.path.dirname(__file__), 'sekizai', 'test_templates'), -] - -TEMPLATE_CONTEXT_PROCESSORS = [ - 'sekizai.context_processors.sekizai', -] - - ROOT_URLCONF = 'runtests' - TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': TEMPLATE_DIRS, + 'DIRS': [os.path.join(os.path.dirname(__file__), 'sekizai', 'test_templates')], 'OPTIONS': { - 'context_processors': TEMPLATE_CONTEXT_PROCESSORS, - 'debug': TEMPLATE_DEBUG + 'context_processors': ['sekizai.context_processors.sekizai'], + 'debug': True, }, }, ] def runtests(): - from django import VERSION + from django import setup from django.conf import settings - if VERSION[0] == 1 and VERSION[1] < 6: - runner = 'django.test.simple.DjangoTestSuiteRunner' - else: - runner = 'django.test.runner.DiscoverRunner' + from django.test.utils import get_runner settings.configure( INSTALLED_APPS=INSTALLED_APPS, ROOT_URLCONF=ROOT_URLCONF, DATABASES=DATABASES, - TEST_RUNNER=runner, - TEMPLATE_DIRS=TEMPLATE_DIRS, - TEMPLATE_CONTEXT_PROCESSORS=TEMPLATE_CONTEXT_PROCESSORS, - TEMPLATE_DEBUG=TEMPLATE_DEBUG, - MIDDLEWARE_CLASSES=[], + TEST_RUNNER='django.test.runner.DiscoverRunner', TEMPLATES=TEMPLATES, ) - if VERSION[1] >= 7: - from django import setup - setup() + setup() # Run the test suite, including the extra validation tests. - from django.test.utils import get_runner TestRunner = get_runner(settings) test_runner = TestRunner(verbosity=1, interactive=False, failfast=False) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-sekizai-0.10.0/sekizai/__init__.py new/django-sekizai-1.0.0/sekizai/__init__.py --- old/django-sekizai-0.10.0/sekizai/__init__.py 2016-08-28 06:25:48.000000000 +0200 +++ new/django-sekizai-1.0.0/sekizai/__init__.py 2019-04-11 14:03:34.000000000 +0200 @@ -1 +1 @@ -__version__ = '0.10.0' +__version__ = '1.0.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-sekizai-0.10.0/sekizai/helpers.py new/django-sekizai-1.0.0/sekizai/helpers.py --- old/django-sekizai-0.10.0/sekizai/helpers.py 2016-08-28 06:25:48.000000000 +0200 +++ new/django-sekizai-1.0.0/sekizai/helpers.py 2019-04-11 14:03:34.000000000 +0200 @@ -5,11 +5,6 @@ from django.template.loader import get_template from django.template.loader_tags import BlockNode, ExtendsNode -try: - from django.template import engines -except ImportError: - engines = None - def _get_nodelist(tpl): if isinstance(tpl, Template): @@ -29,12 +24,9 @@ def get_context(): - if engines is not None: - context = Context() - context.template = Template('') - return context - else: - return Context() + context = Context() + context.template = Template('') + return context def _extend_blocks(extend_node, blocks): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-sekizai-0.10.0/sekizai/templatetags/sekizai_tags.py new/django-sekizai-1.0.0/sekizai/templatetags/sekizai_tags.py --- old/django-sekizai-0.10.0/sekizai/templatetags/sekizai_tags.py 2016-08-28 06:25:48.000000000 +0200 +++ new/django-sekizai-1.0.0/sekizai/templatetags/sekizai_tags.py 2019-04-11 14:03:34.000000000 +0200 @@ -29,12 +29,8 @@ try: template_debug = context.template.engine.debug except AttributeError: - try: - # Get the default engine debug value - template_debug = template.Engine.get_default().debug - except AttributeError: - # Django 1.9 and below fallback - template_debug = settings.TEMPLATE_DEBUG + # Get the default engine debug value + template_debug = template.Engine.get_default().debug if get_varname() in context: return True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-sekizai-0.10.0/sekizai/tests.py new/django-sekizai-1.0.0/sekizai/tests.py --- old/django-sekizai-0.10.0/sekizai/tests.py 2016-08-28 06:25:48.000000000 +0200 +++ new/django-sekizai-1.0.0/sekizai/tests.py 2019-04-11 14:03:34.000000000 +0200 @@ -8,8 +8,10 @@ from django import template from django.conf import settings from django.template.loader import render_to_string +from django.template.engine import Engine import pep8 +from sekizai import context_processors from sekizai.context import SekizaiContext from sekizai.helpers import get_namespaces from sekizai.helpers import get_varname @@ -39,7 +41,7 @@ class SettingsOverride(object): """ - Overrides Django settings within a context and resets them to their inital + Overrides Django settings within a context and resets them to their initial values on exit. Example: @@ -171,57 +173,40 @@ :return: SettingsOverride object """ - if django.VERSION[0] == 1 and django.VERSION[1] < 8: - return SettingsOverride(TEMPLATE_DEBUG=debug) - else: - # Create our overridden template settings with debug turned off. - templates_override = settings.TEMPLATES - templates_override[0]['OPTIONS'].update({ - 'debug': debug - }) - - from django.template.engine import Engine - # Engine gets created based on template settings initial value so - # changing the settings after the fact won't update, so do it - # manually. Necessary when testing validate_context - # with render method and want debug off. - Engine.get_default().debug = debug - return SettingsOverride(TEMPLATES=templates_override) + # Create our overridden template settings with debug turned off. + templates_override = settings.TEMPLATES + templates_override[0]['OPTIONS'].update({'debug': debug}) + # Engine gets created based on template settings initial value so + # changing the settings after the fact won't update, so do it + # manually. Necessary when testing validate_context + # with render method and want debug off. + Engine.get_default().debug = debug + return SettingsOverride(TEMPLATES=templates_override) class SekizaiTestCase(TestCase): - @classmethod - def setUpClass(cls): - cls._template_dirs = settings.TEMPLATE_DIRS - template_dir = os.path.join( - os.path.dirname(__file__), - 'test_templates' - ) - settings.TEMPLATE_DIRS = list(cls._template_dirs) + [template_dir] - - @classmethod - def tearDownClass(cls): - settings.TEMPLATE_DIRS = cls._template_dirs - def _render(self, tpl, ctx=None, ctxclass=SekizaiContext): - ctx = ctx or {} - return render_to_string(tpl, ctxclass(ctx)) + def _render(self, tpl, ctx=None, sekizai_context=True): + ctx = dict(ctx) if ctx else {} + if sekizai_context: + ctx.update(context_processors.sekizai()) + return render_to_string(tpl, ctx) - def _get_bits(self, tpl, ctx=None, ctxclass=SekizaiContext): + def _get_bits(self, tpl, ctx=None, sekizai_context=True): ctx = ctx or {} - rendered = self._render(tpl, ctx, ctxclass) + rendered = self._render(tpl, ctx, sekizai_context) bits = [ bit for bit in [bit.strip('\n') for bit in rendered.split('\n')] if bit ] return bits, rendered - def _test(self, tpl, res, ctx=None, ctxclass=SekizaiContext): + def _test(self, tpl, res, ctx=None, sekizai_context=True): """ Helper method to render template and compare it's bits """ ctx = ctx or {} - bits, rendered = self._get_bits(tpl, ctx, ctxclass) + bits, rendered = self._get_bits(tpl, ctx, sekizai_context) differ = BitDiff(res) result = differ.test(bits) self.assertTrue(result.status, result.message) @@ -257,7 +242,7 @@ def test_eat_content_before_render_block(self): """ - Testing that content get's eaten if no render_blocks is available + Testing that content gets eaten if no render_blocks is available """ bits = ["mycontent"] self._test("eat.html", bits) @@ -267,10 +252,8 @@ Test that the template tags properly fail if not used with either SekizaiContext or the context processor. """ - self.assertRaises( - template.TemplateSyntaxError, - self._render, 'basic.html', {}, template.Context - ) + with self.assertRaises(template.TemplateSyntaxError): + self._render('basic.html', {}, sekizai_context=False) def test_complex_template_inheritance(self): """ @@ -383,7 +366,7 @@ self.assertEqual(validate_context(django_ctx), False) self.assertEqual(validate_context(sekizai_ctx), True) bits = ['some content', 'more content', 'final content'] - self._test('basic.html', bits, ctxclass=template.Context) + self._test('basic.html', bits, sekizai_context=False) def test_post_processor_null(self): bits = ['header', 'footer'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-sekizai-0.10.0/setup.py new/django-sekizai-1.0.0/setup.py --- old/django-sekizai-0.10.0/setup.py 2016-08-28 06:25:48.000000000 +0200 +++ new/django-sekizai-1.0.0/setup.py 2019-04-11 14:03:34.000000000 +0200 @@ -14,6 +14,7 @@ zip_safe=False, include_package_data=True, install_requires=[ + 'django>=1.11', 'django-classy-tags>=0.3.1', ], test_suite='runtests.main', @@ -21,13 +22,18 @@ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', + 'Framework :: Django :: 1.11', + 'Framework :: Django :: 2.0', + 'Framework :: Django :: 2.1', + 'Framework :: Django :: 2.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', ] )
participants (1)
-
root