commit python-wheezy.template for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-wheezy.template for openSUSE:Factory checked in at 2024-01-03 12:24:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-wheezy.template (Old) and /work/SRC/openSUSE:Factory/.python-wheezy.template.new.28375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-wheezy.template" Wed Jan 3 12:24:42 2024 rev:4 rq:1136485 version:3.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-wheezy.template/python-wheezy.template.changes 2023-05-31 21:55:20.345303866 +0200 +++ /work/SRC/openSUSE:Factory/.python-wheezy.template.new.28375/python-wheezy.template.changes 2024-01-03 12:24:52.115215473 +0100 @@ -1,0 +2,15 @@ +Wed Jan 3 10:37:27 UTC 2024 - Dirk Müller <dmueller@suse.com> + +- update to 3.2.2: + * fix: added none type to builder rule union for value + * fix: updated build markup value type with union of str and + none + +------------------------------------------------------------------- +Fri Dec 29 10:12:40 UTC 2023 - Dirk Müller <dmueller@suse.com> + +- update to 3.2.1: + * fix: typing issues with cython. + * fix: test nocover pragma for conditional type definition. + +------------------------------------------------------------------- Old: ---- wheezy.template-3.1.0.tar.gz New: ---- wheezy.template-3.2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-wheezy.template.spec ++++++ --- /var/tmp/diff_new_pack.xp1SNC/_old 2024-01-03 12:24:53.095251280 +0100 +++ /var/tmp/diff_new_pack.xp1SNC/_new 2024-01-03 12:24:53.099251427 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-wheezy.template # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,14 +17,16 @@ Name: python-wheezy.template -Version: 3.1.0 +Version: 3.2.2 Release: 0 Summary: A lightweight template library License: MIT Group: Development/Languages/Python URL: https://github.com/akornatskyy/wheezy.template Source: https://files.pythonhosted.org/packages/source/w/wheezy.template/wheezy.template-%{version}.tar.gz +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires(post): update-alternatives @@ -44,10 +46,10 @@ %build export CFLAGS="%{optflags}" -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_clone -a %{buildroot}%{_bindir}/wheezy.template %python_expand %fdupes %{buildroot}%{$python_sitelib} ++++++ wheezy.template-3.1.0.tar.gz -> wheezy.template-3.2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/PKG-INFO new/wheezy.template-3.2.2/PKG-INFO --- old/wheezy.template-3.1.0/PKG-INFO 2021-04-17 09:07:39.007938000 +0200 +++ new/wheezy.template-3.2.2/PKG-INFO 2024-01-02 12:12:02.930339600 +0100 @@ -1,75 +1,11 @@ Metadata-Version: 2.1 Name: wheezy.template -Version: 3.1.0 +Version: 3.2.2 Summary: A lightweight template library Home-page: https://github.com/akornatskyy/wheezy.template Author: Andriy Kornatskyy Author-email: andriy.kornatskyy@live.com License: MIT -Description: # wheezy.template - - [![Build Status](https://travis-ci.org/akornatskyy/wheezy.template.svg?branch=master)](https://travis-ci.org/akornatskyy/wheezy.template) - [![Coverage Status](https://coveralls.io/repos/github/akornatskyy/wheezy.template/badge.svg?branch=master)](https://coveralls.io/github/akornatskyy/wheezy.template?branch=master) - [![Documentation Status](https://readthedocs.org/projects/wheezytemplate/badge/?version=latest)](https://wheezytemplate.readthedocs.io/en/latest/?badge=latest) - [![pypi version](https://badge.fury.io/py/wheezy.template.svg)](https://badge.fury.io/py/wheezy.template) - - [wheezy.template](https://pypi.org/project/wheezy.template/) is a - [python](https://www.python.org) package written in pure Python code. It - is a lightweight template library. The design goals achived: - - - **Compact, Expressive, Clean:** Minimizes the number of keystrokes - required to build a template. Enables fast and well read coding. You - do not need to explicitly denote statement blocks within HTML - (unlike other template systems), the parser is smart enough to - understand your code. This enables a compact and expressive syntax - which is really clean and just pleasure to type. - - **Intuitive, No time to Learn:** Basic Python programming skills - plus HTML markup. You are productive just from start. Use full power - of Python with minimal markup required to denote python statements. - - **Do Not Repeat Yourself:** Master layout templates for inheritance; - include and import directives for maximum reuse. - - **Blazingly Fast:** Maximum rendering performance: ultimate speed - and context preprocessor features. - - Simple template: - - ```txt - @require(user, items) - Welcome, @user.name! - @if items: - @for i in items: - @i.name: @i.price!s. - @end - @else: - No items found. - @end - ``` - - It is optimized for performance, well tested and documented. - - Resources: - - - [source code](https://github.com/akornatskyy/wheezy.template), - [examples](https://github.com/akornatskyy/wheezy.template/tree/master/demos) - and [issues](https://github.com/akornatskyy/wheezy.template/issues) - tracker are available on - [github](https://github.com/akornatskyy/wheezy.template) - - [documentation](https://wheezytemplate.readthedocs.io/en/latest/) - - ## Install - - [wheezy.template](https://pypi.org/project/wheezy.template/) requires - [python](https://www.python.org) version 3.6+. It is independent of - operating system. You can install it from - [pypi](https://pypi.org/project/wheezy.template/) site: - - ```sh - pip install -U wheezy.template - ``` - - If you run into any issue or have comments, go ahead and add on - [github](https://github.com/akornatskyy/wheezy.template). - Keywords: html markup template preprocessor Platform: any Classifier: Environment :: Web Environment @@ -78,10 +14,10 @@ Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Internet :: WWW/HTTP @@ -89,5 +25,70 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Software Development :: Widget Sets Classifier: Topic :: Text Processing :: Markup :: HTML -Requires-Python: >=3.6 +Requires-Python: >=3.8 Description-Content-Type: text/markdown +License-File: LICENSE + +# wheezy.template + +[![tests](https://github.com/akornatskyy/wheezy.template/actions/workflows/tests.yml/badge.svg)](https://github.com/akornatskyy/wheezy.template/actions/workflows/tests.yml) +[![Coverage Status](https://coveralls.io/repos/github/akornatskyy/wheezy.template/badge.svg?branch=master)](https://coveralls.io/github/akornatskyy/wheezy.template?branch=master) +[![Documentation Status](https://readthedocs.org/projects/wheezytemplate/badge/?version=latest)](https://wheezytemplate.readthedocs.io/en/latest/?badge=latest) +[![pypi version](https://badge.fury.io/py/wheezy.template.svg)](https://badge.fury.io/py/wheezy.template) + +[wheezy.template](https://pypi.org/project/wheezy.template/) is a +[python](https://www.python.org) package written in pure Python code. It +is a lightweight template library. The design goals achived: + +- **Compact, Expressive, Clean:** Minimizes the number of keystrokes + required to build a template. Enables fast and well read coding. You + do not need to explicitly denote statement blocks within HTML + (unlike other template systems), the parser is smart enough to + understand your code. This enables a compact and expressive syntax + which is really clean and just pleasure to type. +- **Intuitive, No time to Learn:** Basic Python programming skills + plus HTML markup. You are productive just from start. Use full power + of Python with minimal markup required to denote python statements. +- **Do Not Repeat Yourself:** Master layout templates for inheritance; + include and import directives for maximum reuse. +- **Blazingly Fast:** Maximum rendering performance: ultimate speed + and context preprocessor features. + +Simple template: + +```txt +@require(user, items) +Welcome, @user.name! +@if items: + @for i in items: + @i.name: @i.price!s. + @end +@else: + No items found. +@end +``` + +It is optimized for performance, well tested and documented. + +Resources: + +- [source code](https://github.com/akornatskyy/wheezy.template), + [examples](https://github.com/akornatskyy/wheezy.template/tree/master/demos) + and [issues](https://github.com/akornatskyy/wheezy.template/issues) + tracker are available on + [github](https://github.com/akornatskyy/wheezy.template) +- [documentation](https://wheezytemplate.readthedocs.io/en/latest/) + +## Install + +[wheezy.template](https://pypi.org/project/wheezy.template/) requires +[python](https://www.python.org) version 3.8+. It is independent of +operating system. You can install it from +[pypi](https://pypi.org/project/wheezy.template/) site: + +```sh +pip install -U wheezy.template +``` + +If you run into any issue or have comments, go ahead and add on +[github](https://github.com/akornatskyy/wheezy.template). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/README.md new/wheezy.template-3.2.2/README.md --- old/wheezy.template-3.1.0/README.md 2021-04-17 09:07:29.000000000 +0200 +++ new/wheezy.template-3.2.2/README.md 2024-01-02 12:11:54.000000000 +0100 @@ -1,6 +1,6 @@ # wheezy.template -[![Build Status](https://travis-ci.org/akornatskyy/wheezy.template.svg?branch=master)](https://travis-ci.org/akornatskyy/wheezy.template) +[![tests](https://github.com/akornatskyy/wheezy.template/actions/workflows/tests.yml/badge.svg)](https://github.com/akornatskyy/wheezy.template/actions/workflows/tests.yml) [![Coverage Status](https://coveralls.io/repos/github/akornatskyy/wheezy.template/badge.svg?branch=master)](https://coveralls.io/github/akornatskyy/wheezy.template?branch=master) [![Documentation Status](https://readthedocs.org/projects/wheezytemplate/badge/?version=latest)](https://wheezytemplate.readthedocs.io/en/latest/?badge=latest) [![pypi version](https://badge.fury.io/py/wheezy.template.svg)](https://badge.fury.io/py/wheezy.template) @@ -51,7 +51,7 @@ ## Install [wheezy.template](https://pypi.org/project/wheezy.template/) requires -[python](https://www.python.org) version 3.6+. It is independent of +[python](https://www.python.org) version 3.8+. It is independent of operating system. You can install it from [pypi](https://pypi.org/project/wheezy.template/) site: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/setup.py new/wheezy.template-3.2.2/setup.py --- old/wheezy.template-3.1.0/setup.py 2021-04-17 09:07:29.000000000 +0200 +++ new/wheezy.template-3.2.2/setup.py 2024-01-02 12:11:54.000000000 +0100 @@ -38,7 +38,7 @@ setup( name="wheezy.template", version=VERSION, - python_requires=">=3.6", + python_requires=">=3.8", description="A lightweight template library", long_description=README, long_description_content_type="text/markdown", @@ -53,10 +53,10 @@ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/__init__.py new/wheezy.template-3.2.2/src/wheezy/__init__.py --- old/wheezy.template-3.1.0/src/wheezy/__init__.py 2021-04-17 09:07:29.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy/__init__.py 2024-01-02 12:11:54.000000000 +0100 @@ -7,4 +7,6 @@ except ImportError: from pkgutil import extend_path - __path__: typing.Iterable[str] = extend_path(__path__, __name__) + __path__: typing.List[str] = extend_path( # type: ignore[no-redef] + __path__, __name__ + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/__init__.py new/wheezy.template-3.2.2/src/wheezy/template/__init__.py --- old/wheezy.template-3.1.0/src/wheezy/template/__init__.py 2021-04-17 09:07:37.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy/template/__init__.py 2024-01-02 12:12:02.000000000 +0100 @@ -17,4 +17,4 @@ "Preprocessor", ) -__version__ = "3.1.0" +__version__ = "3.2.2" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/builder.py new/wheezy.template-3.2.2/src/wheezy/template/builder.py --- old/wheezy.template-3.1.0/src/wheezy/template/builder.py 2021-04-17 09:07:29.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy/template/builder.py 2024-01-02 12:11:54.000000000 +0100 @@ -16,7 +16,6 @@ class BlockBuilder(Builder): - __slots__ = ("rules", "indent", "lineno", "buf") def __init__( @@ -87,7 +86,6 @@ class SourceBuilder(object): - __slots__ = ("rules", "lineno") def __init__( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/comp.py new/wheezy.template-3.2.2/src/wheezy/template/comp.py --- old/wheezy.template-3.1.0/src/wheezy/template/comp.py 2021-04-17 09:07:29.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy/template/comp.py 2024-01-02 12:11:54.000000000 +0100 @@ -1,4 +1,5 @@ import ast +import sys import typing from _thread import allocate_lock # noqa @@ -7,3 +8,17 @@ node = compile(source, name, "exec", ast.PyCF_ONLY_AST) ast.increment_lineno(node, lineno) return node + + +if sys.version_info <= (3, 9, 0): # pragma: nocover + from typing import List, Tuple +else: # pragma: nocover + Tuple = tuple # type: ignore + List = list # type: ignore + + +__all__ = ( + "adjust_source_lineno", + "Tuple", + "List", +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/console.py new/wheezy.template-3.2.2/src/wheezy/template/console.py --- old/wheezy.template-3.1.0/src/wheezy/template/console.py 2021-04-17 09:07:29.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy/template/console.py 2024-01-02 12:11:54.000000000 +0100 @@ -10,7 +10,7 @@ from wheezy.template.loader import FileLoader try: - from wheezy.html.utils import escape_html as escape # type: ignore[import] + from wheezy.html.utils import escape_html as escape except ImportError: # pragma: nocover from html import escape @@ -77,9 +77,7 @@ elif o == "-s": d.searchpath = a.split(";") elif o == "-w": # pragma: nocover - from wheezy.html.ext.template import ( # type: ignore[import] - WhitespaceExtension, - ) + from wheezy.html.ext.template import WhitespaceExtension d.extensions.append(WhitespaceExtension()) if not value: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/engine.py new/wheezy.template-3.2.2/src/wheezy/template/engine.py --- old/wheezy.template-3.1.0/src/wheezy/template/engine.py 2021-04-17 09:07:29.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy/template/engine.py 2024-01-02 12:11:54.000000000 +0100 @@ -1,3 +1,4 @@ +import sys import typing from types import ModuleType @@ -44,7 +45,9 @@ self.global_vars = {"_r": self.render, "_i": self.import_name} self.loader = loader self.template_class = template_class or Template - self.compiler = Compiler(self.global_vars, -2) + self.compiler = Compiler( + self.global_vars, sys.version_info >= (3, 11, 0) and -1 or -2 + ) self.lexer = Lexer(**lexer_scan(extensions)) self.parser = Parser(**parser_scan(extensions)) self.builder = SourceBuilder(**builder_scan(extensions)) @@ -66,7 +69,6 @@ ) -> str: """Renders template by name in given context.""" try: - return self.renders[name](ctx, local_defs, super_defs) except KeyError: self.compile_template(name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/ext/code.py new/wheezy.template-3.2.2/src/wheezy/template/ext/code.py --- old/wheezy.template-3.1.0/src/wheezy/template/ext/code.py 2021-04-17 09:07:29.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy/template/ext/code.py 2024-01-02 12:11:54.000000000 +0100 @@ -1,6 +1,7 @@ import re import typing +from wheezy.template.comp import Tuple from wheezy.template.typing import Builder, LexerRule, ParserRule, Token from wheezy.template.utils import find_balanced @@ -48,13 +49,10 @@ """Includes support for embedded python code.""" def __init__(self, token_start: str = "@") -> None: - self.lexer_rules: typing.Mapping[int, LexerRule] = { 300: (re.compile(r"\s*%s(?=\()" % token_start), code_token), } parser_rules: typing.Mapping[str, ParserRule] = {"code": parse_code} - builder_rules: typing.List[typing.Tuple[str, typing.Any]] = [ - ("code", build_code) - ] + builder_rules: typing.List[Tuple[str, typing.Any]] = [("code", build_code)] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/ext/core.py new/wheezy.template-3.2.2/src/wheezy/template/ext/core.py --- old/wheezy.template-3.1.0/src/wheezy/template/ext/core.py 2021-04-17 09:07:29.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy/template/ext/core.py 2024-01-02 12:11:54.000000000 +0100 @@ -1,6 +1,7 @@ import re import typing +from wheezy.template.comp import Tuple from wheezy.template.typing import Builder, LexerRule, ParserConfig, Token from wheezy.template.utils import find_all_balanced @@ -83,12 +84,12 @@ return value.rstrip()[8:-1] -def parse_import(value: str) -> typing.Tuple[str, str]: +def parse_import(value: str) -> Tuple[str, str]: name, var = value[7:].rsplit(" as ", 1) return name, var -def parse_from(value: str) -> typing.Tuple[str, str, str]: +def parse_from(value: str) -> Tuple[str, str, str]: name, var = value[5:].rsplit(" import ", 1) s = var.rsplit(" as ", 1) if len(s) == 2: @@ -100,7 +101,7 @@ def parse_var( value: str, -) -> typing.Tuple[str, typing.Optional[typing.List[str]]]: +) -> Tuple[str, typing.Optional[typing.List[str]]]: if "!!" not in value: return value, None var, var_filter = value.rsplit("!!", 1) @@ -144,7 +145,7 @@ def build_import( - builder: Builder, lineno: int, token: str, value: typing.Tuple[str, str] + builder: Builder, lineno: int, token: str, value: Tuple[str, str] ) -> bool: assert token == "import " name, var = value @@ -156,7 +157,7 @@ builder: Builder, lineno: int, token: str, - value: typing.Tuple[str, str, str], + value: Tuple[str, str, str], ) -> bool: assert token == "from " name, var, alias = value @@ -353,7 +354,7 @@ def build_markup( - builder: Builder, lineno: int, token: str, value: str + builder: Builder, lineno: int, token: str, value: typing.Union[str, None] ) -> bool: assert token == "markup" if value: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/ext/determined.py new/wheezy.template-3.2.2/src/wheezy/template/ext/determined.py --- old/wheezy.template-3.1.0/src/wheezy/template/ext/determined.py 2021-04-17 09:07:29.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy/template/ext/determined.py 2024-01-02 12:11:54.000000000 +0100 @@ -1,6 +1,7 @@ import re import typing +from wheezy.template.comp import Tuple from wheezy.template.utils import find_balanced RE_ARGS = re.compile(r'\s*(?P<expr>(([\'"]).*?\3|.+?))\s*\,') @@ -117,7 +118,7 @@ def parse_params( text: str, -) -> typing.Tuple[typing.List[str], typing.Mapping[str, str]]: +) -> Tuple[typing.List[str], typing.Mapping[str, str]]: """Parses function parameters. >>> parse_params('') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/loader.py new/wheezy.template-3.2.2/src/wheezy/template/loader.py --- old/wheezy.template-3.1.0/src/wheezy/template/loader.py 2021-04-17 09:07:29.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy/template/loader.py 2024-01-02 12:11:54.000000000 +0100 @@ -4,6 +4,7 @@ import time import typing +from wheezy.template.comp import Tuple from wheezy.template.engine import Engine from wheezy.template.typing import Loader, SupportsRender @@ -27,7 +28,7 @@ self.searchpath = searchpath self.encoding = encoding - def list_names(self) -> typing.Tuple[str, ...]: + def list_names(self) -> Tuple[str, ...]: """Return a list of names relative to directories. Ignores any files and directories that start with dot. """ @@ -83,7 +84,7 @@ def __init__(self, templates: typing.Mapping[str, str]) -> None: self.templates = templates - def list_names(self) -> typing.Tuple[str, ...]: + def list_names(self) -> Tuple[str, ...]: """List all keys from internal dict.""" return tuple(sorted(self.templates.keys())) @@ -100,7 +101,7 @@ def __init__(self, loaders: typing.List[Loader]) -> None: self.loaders = loaders - def list_names(self) -> typing.Tuple[str, ...]: + def list_names(self) -> Tuple[str, ...]: """Returns as list of names from all loaders.""" names = set() for loader in self.loaders: @@ -127,7 +128,7 @@ self.engine = engine self.ctx = ctx or {} - def list_names(self) -> typing.Tuple[str, ...]: + def list_names(self) -> Tuple[str, ...]: return self.engine.loader.list_names() def load(self, name: str) -> str: @@ -155,7 +156,7 @@ from warnings import warn self.engine = engine - self.names: typing.Dict[str, int] = {} + self.names: typing.Dict[str, float] = {} warn( "autoreload limitation: master (inherited), imported " "and preprocessed templates. It is recommended to use " @@ -190,7 +191,7 @@ def file_changed(self, name: str) -> bool: try: last_known_stamp = self.names[name] - current_time = int(time.time()) + current_time = time.time() if current_time - last_known_stamp <= 2: return False except KeyError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/typing.py new/wheezy.template-3.2.2/src/wheezy/template/typing.py --- old/wheezy.template-3.1.0/src/wheezy/template/typing.py 2021-04-17 09:07:29.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy/template/typing.py 2024-01-02 12:11:54.000000000 +0100 @@ -1,7 +1,9 @@ import typing from abc import abstractmethod -Token = typing.Tuple[int, str, str] +from wheezy.template.comp import List, Tuple + +Token = Tuple[int, str, str] class Builder: @@ -33,27 +35,27 @@ ... # pragma: nocover -Tokenizer = typing.Callable[[typing.Match], Token] -LexerRule = typing.Tuple[typing.Pattern, Tokenizer] +Tokenizer = typing.Callable[[typing.Match[str]], Token] +LexerRule = Tuple[typing.Pattern[str], Tokenizer] PreProcessorRule = typing.Callable[[str], str] -PostProcessorRule = typing.Callable[[typing.List[Token]], str] +PostProcessorRule = typing.Callable[[List[Token]], str] BuilderRule = typing.Callable[ [ Builder, int, str, - typing.Union[str, typing.List[str], typing.Iterable[Token]], + typing.Union[str, List[str], typing.Iterable[Token], None], ], bool, ] -ParserRule = typing.Callable[[str], typing.Union[str, typing.List[str]]] +ParserRule = typing.Callable[[str], typing.Union[str, List[str]]] class ParserConfig: - end_tokens: typing.List[str] - continue_tokens: typing.List[str] - compound_tokens: typing.List[str] - out_tokens: typing.List[str] + end_tokens: List[str] + continue_tokens: List[str] + compound_tokens: List[str] + out_tokens: List[str] RenderTemplate = typing.Callable[ @@ -77,7 +79,7 @@ class Loader: @abstractmethod - def list_names(self) -> typing.Tuple[str, ...]: + def list_names(self) -> Tuple[str, ...]: ... # pragma: nocover @abstractmethod diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy.template.egg-info/PKG-INFO new/wheezy.template-3.2.2/src/wheezy.template.egg-info/PKG-INFO --- old/wheezy.template-3.1.0/src/wheezy.template.egg-info/PKG-INFO 2021-04-17 09:07:38.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy.template.egg-info/PKG-INFO 2024-01-02 12:12:02.000000000 +0100 @@ -1,75 +1,11 @@ Metadata-Version: 2.1 Name: wheezy.template -Version: 3.1.0 +Version: 3.2.2 Summary: A lightweight template library Home-page: https://github.com/akornatskyy/wheezy.template Author: Andriy Kornatskyy Author-email: andriy.kornatskyy@live.com License: MIT -Description: # wheezy.template - - [![Build Status](https://travis-ci.org/akornatskyy/wheezy.template.svg?branch=master)](https://travis-ci.org/akornatskyy/wheezy.template) - [![Coverage Status](https://coveralls.io/repos/github/akornatskyy/wheezy.template/badge.svg?branch=master)](https://coveralls.io/github/akornatskyy/wheezy.template?branch=master) - [![Documentation Status](https://readthedocs.org/projects/wheezytemplate/badge/?version=latest)](https://wheezytemplate.readthedocs.io/en/latest/?badge=latest) - [![pypi version](https://badge.fury.io/py/wheezy.template.svg)](https://badge.fury.io/py/wheezy.template) - - [wheezy.template](https://pypi.org/project/wheezy.template/) is a - [python](https://www.python.org) package written in pure Python code. It - is a lightweight template library. The design goals achived: - - - **Compact, Expressive, Clean:** Minimizes the number of keystrokes - required to build a template. Enables fast and well read coding. You - do not need to explicitly denote statement blocks within HTML - (unlike other template systems), the parser is smart enough to - understand your code. This enables a compact and expressive syntax - which is really clean and just pleasure to type. - - **Intuitive, No time to Learn:** Basic Python programming skills - plus HTML markup. You are productive just from start. Use full power - of Python with minimal markup required to denote python statements. - - **Do Not Repeat Yourself:** Master layout templates for inheritance; - include and import directives for maximum reuse. - - **Blazingly Fast:** Maximum rendering performance: ultimate speed - and context preprocessor features. - - Simple template: - - ```txt - @require(user, items) - Welcome, @user.name! - @if items: - @for i in items: - @i.name: @i.price!s. - @end - @else: - No items found. - @end - ``` - - It is optimized for performance, well tested and documented. - - Resources: - - - [source code](https://github.com/akornatskyy/wheezy.template), - [examples](https://github.com/akornatskyy/wheezy.template/tree/master/demos) - and [issues](https://github.com/akornatskyy/wheezy.template/issues) - tracker are available on - [github](https://github.com/akornatskyy/wheezy.template) - - [documentation](https://wheezytemplate.readthedocs.io/en/latest/) - - ## Install - - [wheezy.template](https://pypi.org/project/wheezy.template/) requires - [python](https://www.python.org) version 3.6+. It is independent of - operating system. You can install it from - [pypi](https://pypi.org/project/wheezy.template/) site: - - ```sh - pip install -U wheezy.template - ``` - - If you run into any issue or have comments, go ahead and add on - [github](https://github.com/akornatskyy/wheezy.template). - Keywords: html markup template preprocessor Platform: any Classifier: Environment :: Web Environment @@ -78,10 +14,10 @@ Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Internet :: WWW/HTTP @@ -89,5 +25,70 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Software Development :: Widget Sets Classifier: Topic :: Text Processing :: Markup :: HTML -Requires-Python: >=3.6 +Requires-Python: >=3.8 Description-Content-Type: text/markdown +License-File: LICENSE + +# wheezy.template + +[![tests](https://github.com/akornatskyy/wheezy.template/actions/workflows/tests.yml/badge.svg)](https://github.com/akornatskyy/wheezy.template/actions/workflows/tests.yml) +[![Coverage Status](https://coveralls.io/repos/github/akornatskyy/wheezy.template/badge.svg?branch=master)](https://coveralls.io/github/akornatskyy/wheezy.template?branch=master) +[![Documentation Status](https://readthedocs.org/projects/wheezytemplate/badge/?version=latest)](https://wheezytemplate.readthedocs.io/en/latest/?badge=latest) +[![pypi version](https://badge.fury.io/py/wheezy.template.svg)](https://badge.fury.io/py/wheezy.template) + +[wheezy.template](https://pypi.org/project/wheezy.template/) is a +[python](https://www.python.org) package written in pure Python code. It +is a lightweight template library. The design goals achived: + +- **Compact, Expressive, Clean:** Minimizes the number of keystrokes + required to build a template. Enables fast and well read coding. You + do not need to explicitly denote statement blocks within HTML + (unlike other template systems), the parser is smart enough to + understand your code. This enables a compact and expressive syntax + which is really clean and just pleasure to type. +- **Intuitive, No time to Learn:** Basic Python programming skills + plus HTML markup. You are productive just from start. Use full power + of Python with minimal markup required to denote python statements. +- **Do Not Repeat Yourself:** Master layout templates for inheritance; + include and import directives for maximum reuse. +- **Blazingly Fast:** Maximum rendering performance: ultimate speed + and context preprocessor features. + +Simple template: + +```txt +@require(user, items) +Welcome, @user.name! +@if items: + @for i in items: + @i.name: @i.price!s. + @end +@else: + No items found. +@end +``` + +It is optimized for performance, well tested and documented. + +Resources: + +- [source code](https://github.com/akornatskyy/wheezy.template), + [examples](https://github.com/akornatskyy/wheezy.template/tree/master/demos) + and [issues](https://github.com/akornatskyy/wheezy.template/issues) + tracker are available on + [github](https://github.com/akornatskyy/wheezy.template) +- [documentation](https://wheezytemplate.readthedocs.io/en/latest/) + +## Install + +[wheezy.template](https://pypi.org/project/wheezy.template/) requires +[python](https://www.python.org) version 3.8+. It is independent of +operating system. You can install it from +[pypi](https://pypi.org/project/wheezy.template/) site: + +```sh +pip install -U wheezy.template +``` + +If you run into any issue or have comments, go ahead and add on +[github](https://github.com/akornatskyy/wheezy.template). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy.template.egg-info/entry_points.txt new/wheezy.template-3.2.2/src/wheezy.template.egg-info/entry_points.txt --- old/wheezy.template-3.1.0/src/wheezy.template.egg-info/entry_points.txt 2021-04-17 09:07:38.000000000 +0200 +++ new/wheezy.template-3.2.2/src/wheezy.template.egg-info/entry_points.txt 2024-01-02 12:12:02.000000000 +0100 @@ -1,3 +1,2 @@ [console_scripts] wheezy.template = wheezy.template.console:main -
participants (1)
-
Source-Sync