diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2022-07-13 12:48:43 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2022-07-13 12:48:43 +0900 |
commit | 1453709e39f942db482f52b9afbfd88b0c90057d (patch) | |
tree | 2c92675387bf63837d002ecc430a3908a96c482b | |
parent | a72ea79ea76fbfe6288600663643fddb3a249295 (diff) | |
download | python3-Cheetah-1453709e39f942db482f52b9afbfd88b0c90057d.tar.gz python3-Cheetah-1453709e39f942db482f52b9afbfd88b0c90057d.tar.bz2 python3-Cheetah-1453709e39f942db482f52b9afbfd88b0c90057d.zip |
Imported Upstream version 3.2.5upstream/3.2.5
48 files changed, 1242 insertions, 380 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f42d00c --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +*.py[co] +*.py.bak +*.swp +*.so +.eggs/ +.tox/ +Cheetah3.egg-info/ +build +dist +docs/*.html +docs/_build/ +docs/html/ diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000..84a0ddb --- /dev/null +++ b/.mailmap @@ -0,0 +1,8 @@ +Chuck Esterbrook <echuck@mindspring.com> echuck <echuck> +Ian Bicking <ian@ianbicking.org> ianbicking <ianbicking> +Jean-Baptiste Quenot <jbq@caraldi.com> Jean-Baptiste Quenot <jbq@nomao.com> +Mike Orr <sluggoster@gmail.com> hierro <hierro> +R. Tyler Croy <tyler@monkeypox.org> R. Tyler Ballance <tyler@monkeypox.org> +R. Tyler Croy <tyler@monkeypox.org> R. Tyler Ballance <tyler@slide.com> +Shannon JJ Behrens <jjinux@gmail.com> jjinux <jjinux> +Tavis Rudd <tavis@damnsimple.com> tavis_rudd <tavis_rudd> diff --git a/.travis.yml b/.travis.yml index 7e1f038..71dcc86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ dist: xenial language: python python: - - "3.7" + - "2.7" cache: pip @@ -17,10 +17,6 @@ addons: matrix: include: - python: "2.7" - env: TOXENV=py27-flake8 - - python: "3.7" - env: TOXENV=py37-flake8 - - python: "2.7" env: TOXENV=py27 - python: "3.4" env: TOXENV=py34 @@ -30,6 +26,12 @@ matrix: env: TOXENV=py36 - python: "3.7" env: TOXENV=py37 + - python: "3.8" + env: TOXENV=py38 + - python: "2.7" + env: TOXENV=py27-flake8 + - python: "3.8" + env: TOXENV=py38-flake8 - os: osx # No version of Python is available via virtualenv on OS X workers, see https://github.com/travis-ci/travis-ci/issues/2312 language: generic @@ -43,6 +45,9 @@ matrix: - os: osx language: generic env: TOXENV=py37 + - os: osx + language: generic + env: TOXENV=py38 - python: "pypy2.7-6.0" env: TOXENV=pypy @@ -59,7 +64,7 @@ before_install: fi install: - - travis_retry pip install --upgrade "pip < 19.1" setuptools tox ppu + - travis_retry pip install --upgrade "pip<19.2" "setuptools<44" tox ppu script: - tox diff --git a/ANNOUNCE.rst b/ANNOUNCE.rst index d8df163..9096938 100644 --- a/ANNOUNCE.rst +++ b/ANNOUNCE.rst @@ -1,13 +1,22 @@ Hello! -I'm pleased to announce version 3.2.4, a bugfix release of branch -3.2 of CheetahTemplate3. +I'm pleased to announce version 3.2.5, a minor feature release +of branch 3.2 of CheetahTemplate3. What's new in CheetahTemplate3 ============================== -Contributors for this release are +The contributor for this release is Yegor Yefremov. + +Build: + + - Install ``Cheetah3`` + ``markdown`` (used in ``Cheetah.Filters``) + using ``pip install cheetah3[filters]`` (or ``cheetah3[markdown]``). + +CI: + + - Run tests with Python 3.8 at Travis CI. What is CheetahTemplate3 @@ -29,7 +38,7 @@ Development: https://github.com/CheetahTemplate3 Download: -https://pypi.org/project/Cheetah3/3.2.4 +https://pypi.org/project/Cheetah3/3.2.5 News and changes: https://cheetahtemplate.org/news.html diff --git a/Cheetah/CheetahWrapper.py b/Cheetah/CheetahWrapper.py index 6bbef13..4a95bb2 100755 --- a/Cheetah/CheetahWrapper.py +++ b/Cheetah/CheetahWrapper.py @@ -226,10 +226,10 @@ Files are %s""", args, pprint.pformat(vars(opts)), files) print('>> Available Cheetah compiler settings:') from Cheetah.Compiler import _DEFAULT_COMPILER_SETTINGS listing = _DEFAULT_COMPILER_SETTINGS - listing.sort(key=lambda l: l[0][0].lower()) + listing.sort(key=lambda _l: _l[0][0].lower()) - for l in listing: - print('\t%s (default: "%s")\t%s' % l) + for _l in listing: + print('\t%s (default: "%s")\t%s' % _l) sys.exit(0) # cleanup trailing path separators diff --git a/Cheetah/Template.py b/Cheetah/Template.py index 4d34ab2..a9bb08f 100644 --- a/Cheetah/Template.py +++ b/Cheetah/Template.py @@ -83,9 +83,9 @@ class PreprocessError(Error): pass -def hashList(l): +def hashList(v_list): hashedList = [] - for v in l: + for v in v_list: if isinstance(v, dict): v = hashDict(v) elif isinstance(v, list): diff --git a/Cheetah/Version.py b/Cheetah/Version.py index d1537a3..1bf83f7 100755 --- a/Cheetah/Version.py +++ b/Cheetah/Version.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -Version = '3.2.4' -VersionTuple = (3, 2, 4, 'final', 0) +Version = '3.2.5' +VersionTuple = (3, 2, 5, 'final', 0) MinCompatibleVersion = '3.0.0a1' MinCompatibleVersionTuple = (3, 0, 0, 'alpha', 1) diff --git a/Cheetah3.egg-info/PKG-INFO b/Cheetah3.egg-info/PKG-INFO deleted file mode 100644 index 026677c..0000000 --- a/Cheetah3.egg-info/PKG-INFO +++ /dev/null @@ -1,68 +0,0 @@ -Metadata-Version: 2.1 -Name: Cheetah3 -Version: 3.2.4 -Summary: Cheetah is a template engine and code generation tool -Home-page: https://cheetahtemplate.org/ -Author: Tavis Rudd -Author-email: tavis@damnsimple.com -Maintainer: Oleg Broytman -Maintainer-email: phd@phdru.name -License: MIT -Download-URL: https://pypi.org/project/Cheetah3/3.2.4 -Project-URL: Wikipedia, https://en.wikipedia.org/wiki/CheetahTemplate -Project-URL: Documentation, https://cheetahtemplate.org/users_guide/index.html -Project-URL: Github repo, https://github.com/CheetahTemplate3 -Project-URL: Issue tracker, https://github.com/CheetahTemplate3/cheetah3/issues -Project-URL: Download, https://pypi.org/project/Cheetah3/3.2.4/ -Project-URL: Homepage, https://cheetahtemplate.org/ -Description: Cheetah3 is a free and open source template engine and code generation tool. - - It can be used standalone or combined with other tools and frameworks. Web - development is its principle use, but Cheetah is very flexible and - is also being used to generate C++ game code, Java, sql, form emails - and even Python code. - - It's a fork of the original CheetahTemplate library. - - Documentation - ================================================================================ - For a high-level introduction to Cheetah please refer to the User's Guide - at https://cheetahtemplate.org/users_guide/index.html - - Credits - ================================================================================ - https://cheetahtemplate.org/authors.html - - https://github.com/CheetahTemplate3/cheetah3/blob/master/LICENSE - - Recent Changes - ================================================================================ - See https://cheetahtemplate.org/news.html for full details - - -Keywords: template -Platform: Any -Classifier: Development Status :: 5 - Production/Stable -Classifier: Intended Audience :: Developers -Classifier: Intended Audience :: System Administrators -Classifier: License :: OSI Approved :: MIT License -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python :: Implementation :: CPython -Classifier: Programming Language :: Python :: Implementation :: PyPy -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Topic :: Internet :: WWW/HTTP -Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content -Classifier: Topic :: Internet :: WWW/HTTP :: Site Management -Classifier: Topic :: Software Development :: Code Generators -Classifier: Topic :: Software Development :: Libraries :: Python Modules -Classifier: Topic :: Software Development :: User Interfaces -Classifier: Topic :: Text Processing -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* -Description-Content-Type: text/x-rst diff --git a/Cheetah3.egg-info/SOURCES.txt b/Cheetah3.egg-info/SOURCES.txt deleted file mode 100644 index ebfa4c2..0000000 --- a/Cheetah3.egg-info/SOURCES.txt +++ /dev/null @@ -1,214 +0,0 @@ -.travis.yml -ANNOUNCE.rst -BUGS -LICENSE -MANIFEST.in -README.rst -SetupConfig.py -SetupTools.py -TODO -buildandrun -setup.cfg -setup.py -tox.ini -Cheetah/CacheRegion.py -Cheetah/CacheStore.py -Cheetah/CheetahWrapper.py -Cheetah/Compiler.py -Cheetah/DirectiveAnalyzer.py -Cheetah/Django.py -Cheetah/DummyTransaction.py -Cheetah/ErrorCatchers.py -Cheetah/FileUtils.py -Cheetah/Filters.py -Cheetah/ImportHooks.py -Cheetah/ImportManager.py -Cheetah/LoadTemplate.py -Cheetah/NameMapper.py -Cheetah/Parser.py -Cheetah/Servlet.py -Cheetah/SettingsManager.py -Cheetah/SourceReader.py -Cheetah/Template.py -Cheetah/TemplateCmdLineIface.py -Cheetah/Unspecified.py -Cheetah/Version.py -Cheetah/__init__.py -Cheetah/compat.py -Cheetah/convertTmplPathToModuleName.py -Cheetah/Macros/I18n.py -Cheetah/Macros/__init__.py -Cheetah/Templates/SkeletonPage.py -Cheetah/Templates/SkeletonPage.tmpl -Cheetah/Templates/_SkeletonPage.py -Cheetah/Templates/__init__.py -Cheetah/Tests/Analyzer.py -Cheetah/Tests/Boinker.py -Cheetah/Tests/CheetahWrapper.py -Cheetah/Tests/Cheps.py -Cheetah/Tests/Filters.py -Cheetah/Tests/ImportHooks.py -Cheetah/Tests/LoadTemplate.py -Cheetah/Tests/Misc.py -Cheetah/Tests/NameMapper.py -Cheetah/Tests/NameMapper_pure.py -Cheetah/Tests/Parser.py -Cheetah/Tests/Performance.py -Cheetah/Tests/Pinger.py -Cheetah/Tests/Regressions.py -Cheetah/Tests/SyntaxAndOutput.py -Cheetah/Tests/Template.py -Cheetah/Tests/TemplateCmdLineIface.py -Cheetah/Tests/Test.py -Cheetah/Tests/Unicode.py -Cheetah/Tests/__init__.py -Cheetah/Tests/xmlrunner.py -Cheetah/Tests/ImportHooksTemplates/index.tmpl -Cheetah/Tests/ImportHooksTemplates/layout.tmpl -Cheetah/Tools/CGITemplate.py -Cheetah/Tools/MondoReport.py -Cheetah/Tools/MondoReportDoc.txt -Cheetah/Tools/RecursiveNull.py -Cheetah/Tools/SiteHierarchy.py -Cheetah/Tools/__init__.py -Cheetah/Tools/turbocheetah/__init__.py -Cheetah/Tools/turbocheetah/cheetahsupport.py -Cheetah/Tools/turbocheetah/tests/__init__.py -Cheetah/Tools/turbocheetah/tests/test_template.py -Cheetah/Utils/Indenter.py -Cheetah/Utils/Misc.py -Cheetah/Utils/WebInputMixin.py -Cheetah/Utils/__init__.py -Cheetah/Utils/htmlDecode.py -Cheetah/Utils/htmlEncode.py -Cheetah/Utils/statprof.py -Cheetah/c/_filters.c -Cheetah/c/_filters.h -Cheetah/c/_namemapper.c -Cheetah/c/_namemapper.h -Cheetah/c/_template.c -Cheetah3.egg-info/PKG-INFO -Cheetah3.egg-info/SOURCES.txt -Cheetah3.egg-info/dependency_links.txt -Cheetah3.egg-info/top_level.txt -bin/cheetah -bin/cheetah-analyze -bin/cheetah-compile -docs/Makefile -docs/authors.rst -docs/chep.rst -docs/conf.py -docs/developers.rst -docs/documentation.rst -docs/download.rst -docs/genapidocs -docs/index.rst -docs/make.bat -docs/news.rst -docs/news2.rst -docs/rebuild -docs/roadmap.rst -docs/api/Cheetah.CacheRegion.rst -docs/api/Cheetah.CacheStore.rst -docs/api/Cheetah.CheetahWrapper.rst -docs/api/Cheetah.Compiler.rst -docs/api/Cheetah.DirectiveAnalyzer.rst -docs/api/Cheetah.Django.rst -docs/api/Cheetah.DummyTransaction.rst -docs/api/Cheetah.ErrorCatchers.rst -docs/api/Cheetah.FileUtils.rst -docs/api/Cheetah.Filters.rst -docs/api/Cheetah.ImportHooks.rst -docs/api/Cheetah.ImportManager.rst -docs/api/Cheetah.Macros.I18n.rst -docs/api/Cheetah.Macros.rst -docs/api/Cheetah.NameMapper.rst -docs/api/Cheetah.Parser.rst -docs/api/Cheetah.Servlet.rst -docs/api/Cheetah.SettingsManager.rst -docs/api/Cheetah.SourceReader.rst -docs/api/Cheetah.Template.rst -docs/api/Cheetah.TemplateCmdLineIface.rst -docs/api/Cheetah.Templates.SkeletonPage.rst -docs/api/Cheetah.Templates.rst -docs/api/Cheetah.Tests.Analyzer.rst -docs/api/Cheetah.Tests.Boinker.rst -docs/api/Cheetah.Tests.CheetahWrapper.rst -docs/api/Cheetah.Tests.Cheps.rst -docs/api/Cheetah.Tests.Filters.rst -docs/api/Cheetah.Tests.Misc.rst -docs/api/Cheetah.Tests.NameMapper.rst -docs/api/Cheetah.Tests.NameMapper_pure.rst -docs/api/Cheetah.Tests.Parser.rst -docs/api/Cheetah.Tests.Performance.rst -docs/api/Cheetah.Tests.Pinger.rst -docs/api/Cheetah.Tests.Regressions.rst -docs/api/Cheetah.Tests.SyntaxAndOutput.rst -docs/api/Cheetah.Tests.Template.rst -docs/api/Cheetah.Tests.Test.rst -docs/api/Cheetah.Tests.Unicode.rst -docs/api/Cheetah.Tests.rst -docs/api/Cheetah.Tests.xmlrunner.rst -docs/api/Cheetah.Tools.CGITemplate.rst -docs/api/Cheetah.Tools.MondoReport.rst -docs/api/Cheetah.Tools.RecursiveNull.rst -docs/api/Cheetah.Tools.SiteHierarchy.rst -docs/api/Cheetah.Tools.rst -docs/api/Cheetah.Tools.turbocheetah.cheetahsupport.rst -docs/api/Cheetah.Tools.turbocheetah.rst -docs/api/Cheetah.Tools.turbocheetah.tests.rst -docs/api/Cheetah.Tools.turbocheetah.tests.test_template.rst -docs/api/Cheetah.Unspecified.rst -docs/api/Cheetah.Utils.Indenter.rst -docs/api/Cheetah.Utils.Misc.rst -docs/api/Cheetah.Utils.WebInputMixin.rst -docs/api/Cheetah.Utils.htmlDecode.rst -docs/api/Cheetah.Utils.htmlEncode.rst -docs/api/Cheetah.Utils.rst -docs/api/Cheetah.Utils.statprof.rst -docs/api/Cheetah.Version.rst -docs/api/Cheetah.compat.rst -docs/api/Cheetah.convertTmplPathToModuleName.rst -docs/api/Cheetah.rst -docs/api/modules.rst -docs/cheps/1_chep.rst -docs/cheps/2_import.rst -docs/cheps/3_super.rst -docs/dev_guide/cache.rst -docs/dev_guide/comments.rst -docs/dev_guide/design.rst -docs/dev_guide/errorHandling.rst -docs/dev_guide/flowControl.rst -docs/dev_guide/history.rst -docs/dev_guide/index.rst -docs/dev_guide/inheritanceEtc.rst -docs/dev_guide/introduction.rst -docs/dev_guide/output.rst -docs/dev_guide/parserInstructions.rst -docs/dev_guide/patching.rst -docs/dev_guide/placeholders.rst -docs/dev_guide/pyModules.rst -docs/dev_guide/safeDelegation.rst -docs/recipes/inheritance.rst -docs/recipes/precompiled.rst -docs/recipes/staticmethod.rst -docs/users_guide/comments.rst -docs/users_guide/comparisons.rst -docs/users_guide/editors.rst -docs/users_guide/errorHandling.rst -docs/users_guide/examples.rst -docs/users_guide/flowControl.rst -docs/users_guide/gettingStarted.rst -docs/users_guide/glossary.rst -docs/users_guide/index.rst -docs/users_guide/inheritanceEtc.rst -docs/users_guide/intro.rst -docs/users_guide/language.rst -docs/users_guide/libraries.rst -docs/users_guide/links.rst -docs/users_guide/nonHtml.rst -docs/users_guide/otherHtml.rst -docs/users_guide/output.rst -docs/users_guide/parserInstructions.rst -docs/users_guide/tipsAndTricks.rst -docs/users_guide/webware.rst
\ No newline at end of file diff --git a/Cheetah3.egg-info/dependency_links.txt b/Cheetah3.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/Cheetah3.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Cheetah3.egg-info/top_level.txt b/Cheetah3.egg-info/top_level.txt deleted file mode 100644 index 471a91a..0000000 --- a/Cheetah3.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -Cheetah diff --git a/PKG-INFO b/PKG-INFO deleted file mode 100644 index 026677c..0000000 --- a/PKG-INFO +++ /dev/null @@ -1,68 +0,0 @@ -Metadata-Version: 2.1 -Name: Cheetah3 -Version: 3.2.4 -Summary: Cheetah is a template engine and code generation tool -Home-page: https://cheetahtemplate.org/ -Author: Tavis Rudd -Author-email: tavis@damnsimple.com -Maintainer: Oleg Broytman -Maintainer-email: phd@phdru.name -License: MIT -Download-URL: https://pypi.org/project/Cheetah3/3.2.4 -Project-URL: Wikipedia, https://en.wikipedia.org/wiki/CheetahTemplate -Project-URL: Documentation, https://cheetahtemplate.org/users_guide/index.html -Project-URL: Github repo, https://github.com/CheetahTemplate3 -Project-URL: Issue tracker, https://github.com/CheetahTemplate3/cheetah3/issues -Project-URL: Download, https://pypi.org/project/Cheetah3/3.2.4/ -Project-URL: Homepage, https://cheetahtemplate.org/ -Description: Cheetah3 is a free and open source template engine and code generation tool. - - It can be used standalone or combined with other tools and frameworks. Web - development is its principle use, but Cheetah is very flexible and - is also being used to generate C++ game code, Java, sql, form emails - and even Python code. - - It's a fork of the original CheetahTemplate library. - - Documentation - ================================================================================ - For a high-level introduction to Cheetah please refer to the User's Guide - at https://cheetahtemplate.org/users_guide/index.html - - Credits - ================================================================================ - https://cheetahtemplate.org/authors.html - - https://github.com/CheetahTemplate3/cheetah3/blob/master/LICENSE - - Recent Changes - ================================================================================ - See https://cheetahtemplate.org/news.html for full details - - -Keywords: template -Platform: Any -Classifier: Development Status :: 5 - Production/Stable -Classifier: Intended Audience :: Developers -Classifier: Intended Audience :: System Administrators -Classifier: License :: OSI Approved :: MIT License -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python :: Implementation :: CPython -Classifier: Programming Language :: Python :: Implementation :: PyPy -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Topic :: Internet :: WWW/HTTP -Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content -Classifier: Topic :: Internet :: WWW/HTTP :: Site Management -Classifier: Topic :: Software Development :: Code Generators -Classifier: Topic :: Software Development :: Libraries :: Python Modules -Classifier: Topic :: Software Development :: User Interfaces -Classifier: Topic :: Text Processing -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* -Description-Content-Type: text/x-rst @@ -1,4 +1,4 @@ -Cheetah Template 3.2.4 +Cheetah Template 3.2.5 ====================== Cheetah3 is a free and open source template engine and code generation tool. diff --git a/SetupConfig.py b/SetupConfig.py index 5be2f3f..11e68a9 100644 --- a/SetupConfig.py +++ b/SetupConfig.py @@ -40,7 +40,7 @@ packages = ['Cheetah', 'Cheetah.Utils', ] classifiers = [line.strip() for line in '''\ - Development Status :: 5 - Production/Stable + Development Status :: 4 - Beta Intended Audience :: Developers Intended Audience :: System Administrators License :: OSI Approved :: MIT License @@ -55,6 +55,7 @@ classifiers = [line.strip() for line in '''\ Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 Topic :: Internet :: WWW/HTTP Topic :: Internet :: WWW/HTTP :: Dynamic Content Topic :: Internet :: WWW/HTTP :: Site Management @@ -130,3 +131,8 @@ See https://cheetahtemplate.org/news.html for full details long_description_content_type = "text/x-rst" python_requires = '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*' + +extras_require = { + 'filters': ['markdown'], + 'markdown': ['markdown'], +} diff --git a/TODO.old b/TODO.old new file mode 100644 index 0000000..975a80f --- /dev/null +++ b/TODO.old @@ -0,0 +1,253 @@ +NOTE: Please see https://github.com/CheetahTemplate3/cheetah3/issues +for reporting bugs and feature requests. + + +=============================================================================== +=============================================================================== + +Desired for Cheetah 2.0 +======================= +- Smart HTML filter that escapes all values except those individually marked as + preformatted, a la Kid/PTL/QPY. (MO) + + +TODO Items (many are just ideas. This is not an official roadmap!) +================================================================================ + +- "cheetah test" problem: subcommands fail mysteriously on Windows. Rewrite + to avoid using subcommands. Instead, set sys.argv and call the appropriate + main() for each test. + +- Documentation: document #encoding. Explain problems "cheetah test" if they + haven't been fixed yet. + +- There's a kludge in CheetahWrapper.py to abort with a helpful error message + if the user runs 'cheetah test' but doesn't have write permission in the + current directory. The tests should instead put their temporary files + under the system tmp directory. + +- Reset the current filter to the default (or to the constructor's filter + if specified) at the beginning of each fill. Currently, filter changes + leak from one fill to the next. + +- CheetahWrapper stuff: (MO) + * "cheetah preview [options] [FILES]" print template-specific portion of main + method(s) to stdout, with line numbers based on the .py template module. + Make a Template method to do the same thing, a la .generatedModuleCode(). + * Refactor, make compile/fill/code routines callbacks using a bundle arg. + * If an input file ends in a dot, intelligently add the input extension if + not found. + +- Debugging tools. See section below. + +- Provide a utility to list the names of all placeholders in the template. + Requested by Tracy Ruggles on Feb 21, 2003. + +- 'errorCatcher None' to stop catching errors in the middle of a template. + +- Utils.WebInputMixin: factor out Cheetah-specific code so it can be used in + non-Cheetah applications. Don't modify the searchList: have a Template + wrapper method do that. Consider turning it into a function that does not + require 'self'. Consider making Webware-specific code into plugins so that, + e.g., other cookie-handling methods can be grafted in. Maybe use callback + classes like the planned rewrite for CheetahWrapper. Low priority. (MO) + +- Look through Zope Page Templates (TAL) for ideas to borrow. + http://www.zope.org/Documentation/Books/ZopeBook/current/AppendixC.stx + http://www.owlfish.com/software/simpleTAL/index.html + +Debugging Tools (Dump Tools) +============================ +It would be nice to provide debugging tools for users who can't figure +out why a certain placeholder value isn't found or is being overridden. +My idea is to define $dumpSearchList() and $dumpSearchListFlat() in +Template, which would print a stanza in the output showing all searchList +variables and their values. $dumpSearchList would group by searchList +element; $dumpSearchListFlat would combine all into a single +alphabetical listing. + I made an experimental version but it printed only instance variables, +not methods and not inherited attributes. Also, it wouldn't print right +using the usual pattern of write-to-custom-StringIO-object-and-return- +the-.getvalue() and I couldn't figure out why. + The stanza should be set apart by a row of stars with the words +"BEGIN/END SEARCH LIST DUMP". Then for $dumpSearchList, precede each +group with "*** searchList[i], type <element type>, 142 variables ***". + Because some elements like 'self' may have hundreds of inherited +methods that would create a forest-through-trees situation for the user, +we may need an option to supress the variable listing for elements with +> 20 variables (just print the summary line instead). ? + The final version should be in Template so it has implicit +access to the searchList and perhaps later to other variables (locals, +globals, "#set global"s, builtins) too. This is such a central +debugging tool that you should not have to monopolize an #extends +(the template's only #extends) to use it. You could import it, however, +if you pass in the searchList explicitly as an argument. In that case, +perhaps we can base it on a generic module for dumping variables/values. + Note that we cannot simply depend on str() and pprint, because +we need to show instances as dictionaries. Likewise, dir() and vars() +may get us part of the distance, but only if they show methods and +inherited attributes too. + These functions should print only top-level variables, not +the subelements of collections. I.e, if the first searchList element +is a dictionary, show its keys/values, but do not expand any +subvalues if they are dictionaries too, unless the display tool happens +to default to that. + +#entry $func($arg1, $arg2="default", $**kw) +=============================================================================== +Make a wrapper function in the .py template module that builds a searchList +from its positional arguments, then instantiates and fills a template and +returns the result. The preceding example would create a function thus: + def func(arg1, arg2="default", searchList=None, **kw): + """Function docstring.""" + sl = {'arg1': arg1, 'arg2': arg2} + if searchList is None: + searchList = [sl] + elif type(searchList) == types.ListType: + searchList.insert(0, sl) + else: + raise TypeError("arg 'searchList'") + t = TheTemplate(searchList=searchList, **kw) + return str(t) +##doc-entry: and #*doc-entry: comments are appended to the function docstring. + Finally, make this function accessible directly from the shell. +If there are any non-option arguments on the command line, call the function +instead of filling the template the normal way. + This would perhaps make more sense as arguments to .respond(). But +.respond() has that pesky 'trans' argument that mustn't be interfered with, +and other programs may assume .respond() takes only one argument. Also, +when called via str(), str() cannot take arguments. + +#indent +======================================================================== +The current indenter (which exists but is undocumented) is a kludge that has an +indentation object, with implicit placeholder calls added at each line to +generate the indentation, and #silent calls to adjust the object. It should be +reimplemented to generate code to call the indentation object directly. Also, +the user interface should be cleaned up, the implementation and Users' Guide +synchronized, and test cases built. + +The desired implementation revolves around self._indenter, which knows the +current indentation level (a non-negative integer), chars (the string output +per level, default four spaces), and stack (the previous indentation levels). +The .indent() method returns the indentation string currently appropriate. +The desired interface for phase 1 (subject to change): + #indent strip ; strip leading whitespace from input lines + #indent add ; add indentation to output lines as appropriate + #indent on ; do both + #indent off ; do neither + #indent reset ; set level to 0 and clear stack + #indent ++ ; increment level + #indent -- ; decrement level + #indent pop [EXPR] ; revert to Nth previous level (default 1) + ; if pop past end of stack, set level to 0 and + ; clear stack. All +/-/= operations push the old level + ; onto the stack. + #indent debug ; dump level, chars and stack to template output + +Possible extensions: + #indent =EXPR ; set level to N (likely to be added to phase 1) + #indent +EXPR ; add N to level (not very necessary) + #indent -EXPR ; subtract N from level (not very necessary) + #indent balance BOOL ; require all indent changes in a #def/#block to be + ; popped before exiting the method. (difficult to + ; implement) + #indent implicitPop BOOL ; automatically pop indent changes within a + ; #def/block when that method exits. (difficult to + ; implement) + #indent ?? ; a 3-way switch that combines unbalanced, balanced and + ; implicit pop. (difficult to implement) + #indent ?? ; smart stripping: strip input indentation according to + ; nested directive level; e.g., + ; 01: #if foo=1 + ; 02: public int foo() + ; 03: { + ; 04: return FOO; + ; 05: } + ; 06: #end if + ; With smart stripping, line 4 would be indented and the + ; others not. With "on" or "strip" stripping, all lines + ; 2-5 would be unindented. With "off" stripping, + ; lines 2-5 would not be stripped. + +There should be one indentation object per Template instance, shared by +methods and include files. + + +Upload File +======================================================================== +@@TR: This is way outside Cheetah's scope! + +A mixin method in Cheetah.Utils (for Template) that handles file uploads -- +these are too complicated for .webInput(). The method should do a "safe" +file upload; e.g., http://us3.php.net/manual/en/features.file-upload.php , +within the limitations of Python's cgi module. The user has the choice of +three destinations for the file contents: (A) copied to a local +path you specify, (B) placed in a namespace variable like .cgiImport() +does, or (C) returned. (B) parallels .webInput, but (A) will certainly be +desirable situations where we just want to save the file, not read it into +memory. Reject files larger than a user-specified size or not in a list of +user-approved MIME types. Define appropriate exceptions for typical +file-upload errors. Method name .webUploadFileAsString? + One situation to support is when form has a text(area) field +related to a file-upload control on the same form, and the user has the choice +of typing into the field or uploading a text file. We need a method that +updates the text field's value if there is an uploaded file, but not if there +isn't. This may be handled by the regular method(s) or may require a separate +method. + +RPM Building +============ +From: John Landahl <john@landahl.org> +To: cheetahtemplate-discuss@lists.sourceforge.net +Subject: [Cheetahtemplate-discuss] Building Cheetah RPMs +Date: Wed, 05 Nov 2003 01:27:24 -0800 + +If anyone is interested in building Cheetah RPMs, simply add the following +lines to a file called MANIFEST.in in the Cheetah directory and you'll be +able to use the "bdist_rpm" option to setup.py (i.e. "python setup.py +bdist_rpm"): + + include SetupTools.py + include SetupConfig.py + include bin/* + +Also, I've found that using /usr/lib/site-python for add-on Python +packages is much more convenient than the default of +/usr/lib/pythonX/site-packages, especially when jumping back and forth +between 2.2 and 2.3. If you'd like Cheetah in /usr/lib/site-python, +createa a setup.cfg with the following contents: + + [install] + install-lib = /usr/lib/site-python + +Of course if you do have version specific libraries they should stay in +/usr/lib/pythonX/site-packages, but Cheetah seems happy in both 2.2 and +2.3 and so is a good candidate for /usr/lib/site-python. + + +User-defined directives +======================================================================= +IF we decide to support user-defined directives someday, consider Spyce's +interface. Spyce uses a base class which provides generic services to +custom "active tags". +http://spyce.sourceforge.net/docs/doc-tag.html +http://spyce.sourceforge.net/docs/doc-tag_new.html + + +Test Suite +================================================================================ +- add cases that test the cheetah-compile script +- add cases that test the integration with various webdev frameworks + +Examples +================================================================================ +- create some non-html code generation examples + - SQL + - LaTeX + - form email +- Template definitions in a database. .py template modules in a + database? Caching template classes and/or instances extracted from + a database. +- Pickled templates? + diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..cf50838 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,107 @@ +version: '{branch}-{build}' + +cache: + - '%LOCALAPPDATA%\pip\Cache' + # Cache chocolatey-installed packages (PyPy) + - C:\ProgramData\chocolatey\bin -> appveyor.yml, devscripts\CI\appveyor_install_pypy.cmd + - C:\ProgramData\chocolatey\lib -> appveyor.yml, devscripts\CI\appveyor_install_pypy.cmd + +# Match travis +clone_depth: 50 + +environment: + global: + # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the + # /E:ON and /V:ON options are not enabled in the batch script intepreter + # See: http://stackoverflow.com/a/13751649/163740 + CMD_IN_ENV: "cmd /E:ON /V:ON /C devscripts\\CI\\run_with_env.cmd" + + matrix: + - TOXENV: "py27" + PYTHON_VERSION: "2.7" + PYTHON_ARCH: "32" + PYTHON_HOME: "C:\\Python27" + - TOXENV: "py27" + PYTHON_VERSION: "2.7" + PYTHON_ARCH: "64" + PYTHON_HOME: "C:\\Python27-x64" + - TOXENV: "py34-w32" + PYTHON_VERSION: "3.4" + PYTHON_ARCH: "32" + PYTHON_HOME: "C:\\Python34" + - TOXENV: "py34-w32" + PYTHON_VERSION: "3.4" + PYTHON_ARCH: "64" + PYTHON_HOME: "C:\\Python34-x64" + - TOXENV: "py35" + PYTHON_VERSION: "3.5" + PYTHON_ARCH: "32" + PYTHON_HOME: "C:\\Python35" + - TOXENV: "py35" + PYTHON_VERSION: "3.5" + PYTHON_ARCH: "64" + PYTHON_HOME: "C:\\Python35-x64" + - TOXENV: "py36" + PYTHON_VERSION: "3.6" + PYTHON_ARCH: "32" + PYTHON_HOME: "C:\\Python36" + - TOXENV: "py36" + PYTHON_VERSION: "3.6" + PYTHON_ARCH: "64" + PYTHON_HOME: "C:\\Python36-x64" + - TOXENV: "py37" + PYTHON_VERSION: "3.7" + PYTHON_ARCH: "32" + PYTHON_HOME: "C:\\Python37" + - TOXENV: "py37" + PYTHON_VERSION: "3.7" + PYTHON_ARCH: "64" + PYTHON_HOME: "C:\\Python37-x64" + - TOXENV: "py38" + PYTHON_VERSION: "3.8" + PYTHON_ARCH: "32" + PYTHON_HOME: "C:\\Python38" + - TOXENV: "py38" + PYTHON_VERSION: "3.8" + PYTHON_ARCH: "64" + PYTHON_HOME: "C:\\Python38-x64" + - TOXENV: "pypy" + PYTHON_VERSION: "2.7" + PYTHON_ARCH: "32" + PYTHON_HOME: "C:\\tools\\pypy\\pypy" + +install: + # Ensure we use the right python version + - "SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\\Scripts;%PATH%" + - "SET TOXPYTHON=%PYTHON_HOME%\\python.exe" + - if "%TOXENV%" == "pypy" devscripts\\CI\\appveyor_install_pypy.cmd + - "python --version" + - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" + - if "%TOXENV%" == "pypy" SET TOXPYTHON=pypy.exe + - if "%TOXENV%" == "pypy" pypy --version + - "python -m pip install --upgrade \"pip<19.2\" \"setuptools<44\"" + - "pip install --upgrade \"tox<3.1\" ppu" + - "pip --version" + +# No build step - _namemapper extension will be built under tox +build: false + +test_script: + - "%CMD_IN_ENV% tox" + +after_test: + - remove-old-files.py -o 180 %LOCALAPPDATA%\\pip\\Cache + +deploy_script: + # If tests are successful and we've tested a tag, deploy binary wheel + # TWINE_USERNAME / TWINE_PASSWORD / TWINE_REPOSITORY_URL + # must be set in AppVeyor settings. + - if "%APPVEYOR_REPO_TAG%" == "true" ( + if "%PYTHON_VERSION%" == "3.4" ( + pip install --upgrade "readme-renderer<25.0" "twine<2.0" "wheel==0.31.1" + ) else ( + pip install --upgrade twine "wheel==0.34.1" + ) && + %CMD_IN_ENV% python setup.py bdist_wheel && + twine upload --skip-existing dist\\*.whl + ) diff --git a/contrib/editors/Cheetah.tmbundle.zip b/contrib/editors/Cheetah.tmbundle.zip Binary files differnew file mode 100644 index 0000000..914f745 --- /dev/null +++ b/contrib/editors/Cheetah.tmbundle.zip diff --git a/contrib/editors/kde-cheetah.xml b/contrib/editors/kde-cheetah.xml new file mode 100644 index 0000000..2d3179d --- /dev/null +++ b/contrib/editors/kde-cheetah.xml @@ -0,0 +1,339 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE language SYSTEM "language.dtd" +[ + <!ENTITY name "[A-Za-z_:][\w.:_-]*"> + <!ENTITY ident "[A-Za-z_][A-Za-z_0-9]*"> + <!ENTITY entref "&(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);"> + <!ENTITY block "block|def"> + <!ENTITY idcmd "attr|del|encoding|errorCatcher|extends|implements|import|include(\s+raw)?|raise|shBang"> +]> +<!-- + This file is part of KDE's kate project. + + copyright : (C) 2008 by David Zaslavsky + email : dzaslavs@ellipsix.net + + This file is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +--> +<!-- + You'll find the "Writing a Kate Highlighting XML File HOWTO" at + http://kate.kde.org/doc/hlhowto.php + This is a template for the XML format used for syntax highlight descriptions + for the Kate text editor (http://kate.kde.org), which is part of the KDE + desktop environment (http://www.kde.org). + + Use it as the base for your own syntax files. + + Look at language.dtd for some documentation of the allowed elements and their attributes. + There is also a description of how to validate your syntax file. + + You'll find the "Writing a Kate Highlighting XML File HOWTO" at + http://kate.kde.org/doc/hlhowto.php + --> + +<language version="1.00" kateversion="2.4" name="Cheetah" section="Markup" extensions="*.tmpl" mimetype="text/plain" author="David Zaslavsky" licence="GPL"> +<highlighting> + <list name="specialvars"> + <item>None</item> + <item>False</item> + <item>True</item> + </list> + <contexts> + <context name="Start" attribute="Normal Text" lineEndContext="#stay"> + <DetectSpaces/> + <IncludeRules context="FindCheetah"/> + <IncludeRules context="FindHTML"/> + </context> + <context name="FindCheetah" attribute="Normal Text" lineEndContext="#stay"> + <RegExpr attribute="Comment" String="##.*$" context="#stay"/> + <Detect2Chars char="#" char1="*" attribute="Comment" context="LongComment" beginRegion="MLComment"/> + <RegExpr String="#raw\s*($|#)" attribute="Command" context="Raw"/> + <RegExpr String="#from\s+&ident;\s+import\s+&ident;\s*($|#)" attribute="Command" context="#stay"/> + <RegExpr String="#block\s+&ident;\s*($|#)" attribute="Command" context="#stay" beginRegion="block"/> + <RegExpr String="#def\s+&ident;\s*($|#)" attribute="Command" context="#stay" beginRegion="def"/> + <RegExpr String="#block\s+&ident;\s*\(" attribute="Command" context="Def Expression" beginRegion="block"/> + <RegExpr String="#def\s+&ident;\s*\(" attribute="Command" context="Def Expression" beginRegion="def"/> + <StringDetect String="#for" attribute="Command" context="For Expression" beginRegion="for"/> + <StringDetect String="#if" attribute="Command" context="If Expression" beginRegion="if"/> + <RegExpr String="#(else\s+if|elif)" attribute="Command" context="Expression" endRegion="if" beginRegion="if"/> + <StringDetect String="#repeat" attribute="Command" context="Expression" beginRegion="repeat"/> + <StringDetect String="#unless" attribute="Command" context="Expression" beginRegion="unless"/> + <StringDetect String="#while" attribute="Command" context="Expression" beginRegion="while"/> + <RegExpr String="#end block(\s+&ident;)?\s*($|#)" attribute="Command" context="#stay" endRegion="block"/> + <RegExpr String="#end def(\s+&ident;)?\s*($|#)" attribute="Command" context="#stay" endRegion="def"/> + <RegExpr String="#end for\s*($|#)" attribute="Command" context="#stay" endRegion="for"/> + <RegExpr String="#end if\s*($|#)" attribute="Command" context="#stay" endRegion="if"/> + <RegExpr String="#end repeat\s*($|#)" attribute="Command" context="#stay" endRegion="repeat"/> + <RegExpr String="#end unless\s*($|#)" attribute="Command" context="#stay" endRegion="unless"/> + <RegExpr String="#end while\s*($|#)" attribute="Command" context="#stay" endRegion="while"/> + <!-- short-form block directives --> + <RegExpr String="#(block|def) &ident;:" attribute="Command" context="Short Block Body"/> + <!-- no-argument directives --> + <RegExpr String="#(break|breakpoint|cache|compiler-settings|continue|finally|else|indent|pass|raw|slurp|stop|try)\s*($|#)" attribute="Command" context="#stay"/> + <!-- one-argument directives --> + <RegExpr String="#(attr|del|encoding|errorCatcher|extends|implements|import|include(\s+raw)?|shBang)\s+&ident;\s*($|#)" attribute="Command" context="#stay"/> + <!-- expression-argument directives --> + <RegExpr String="#(assert|echo|except|filter|raise|set|silent)" attribute="Command" context="Expression"/> + <StringDetect String="<%" attribute="Element" context="Python"/> + <StringDetect String="<%=" attribute="Element" context="Python"/> + <DetectChar char="$" attribute="Placeholder" context="Placeholder"/> + </context> + <context name="FindHTML" attribute="Normal Text" lineEndContext="#stay"> + <DetectSpaces/> + <DetectIdentifier/> + <StringDetect attribute="Comment" context="HTMLComment" String="<!--" beginRegion="HTMLComment" /> + <StringDetect attribute="CDATA" context="CDATA" String="<![CDATA[" beginRegion="cdata" /> + <RegExpr attribute="Doctype" context="Doctype" String="<!DOCTYPE\s+" beginRegion="doctype" /> + <RegExpr attribute="Processing Instruction" context="PI" String="<\?[\w:-]*" beginRegion="pi" /> + <RegExpr attribute="Element" context="CSS" String="<style\b" insensitive="TRUE" beginRegion="style" /> + <RegExpr attribute="Element" context="JS" String="<script\b" insensitive="TRUE" beginRegion="script" /> + <RegExpr attribute="Element" context="El Open" String="<pre\b" insensitive="TRUE" beginRegion="pre" /> + <RegExpr attribute="Element" context="El Open" String="<div\b" insensitive="TRUE" beginRegion="div" /> + <RegExpr attribute="Element" context="El Open" String="<table\b" insensitive="TRUE" beginRegion="table" /> + <RegExpr attribute="Element" context="El Open" String="<&name;" /> + <RegExpr attribute="Element" context="El Close" String="</pre\b" insensitive="TRUE" endRegion="pre" /> + <RegExpr attribute="Element" context="El Close" String="</div\b" insensitive="TRUE" endRegion="div" /> + <RegExpr attribute="Element" context="El Close" String="</table\b" insensitive="TRUE" endRegion="table" /> + <RegExpr attribute="Element" context="El Close" String="</&name;" /> + <IncludeRules context="FindEntityRefs" /> + </context> + <context name="Directive" attribute="Command" lineEndContext="#pop"> + <DetectChar char="#" attribute="Command" context="#pop"/> + </context> + <context name="Expression" attribute="Command" lineEndContext="#pop"> + <DetectChar char="#" attribute="Command" context="#pop"/> + <DetectChar char="$" attribute="Placeholder" context="Placeholder"/> + <RangeDetect char="'" char1="'" attribute="String" context="#stay"/> + <RangeDetect char=""" char1=""" attribute="String" context="#stay"/> + <keyword String="specialvars" attribute="Special Variable" context="#stay"/> + </context> + <context name="Def Expression" attribute="Command" lineEndContext="#pop"> + <DetectChar char=")" attribute="Command" context="#stay"/> + <IncludeRules context="Expression"/> + </context> + <context name="For Expression" attribute="Command" lineEndContext="#pop"> + <StringDetect String="in" attribute="Command" context="#stay"/> + <IncludeRules context="Expression"/> + </context> + <context name="If Expression" attribute="Command" lineEndContext="#pop"> + <StringDetect String="then" attribute="Command" context="Then Clause" endRegion="if"/> + <IncludeRules context="Expression"/> + </context> + <context name="Then Clause" attribute="Normal Text" lineEndContext="#pop#pop"> + <DetectChar char="#" attribute="Command" context="#pop#pop"/> + <StringDetect String="else" attribute="Command" context="#stay"/> + <keyword String="specialvars" attribute="Special Variable" context="#stay"/> + <DetectChar char="$" attribute="Placeholder" context="Placeholder"/> + <IncludeRules context="FindHTML"/> + </context> + <context name="Short Block Body" attribute="Normal Text" lineEndContext="#pop#pop"> + <DetectChar char="#" attribute="Command" context="#pop#pop"/> + <DetectChar char="$" attribute="Placeholder" context="Placeholder"/> + <IncludeRules context="FindHTML"/> + </context> + <context name="Raw" attribute="Command" lineEndContext="Raw content"> + <DetectChar char="#" attribute="Command" context="Raw content"/> + </context> + <context name="Raw content" attribute="Normal Text" lineEndContext="#stay"> + <StringDetect String="#end raw" attribute="Command" context="#pop#pop#pop"/> + </context> + <context name="Placeholder" attribute="Placeholder" lineEndContext="#pop"> + <RegExpr String="([[({])" attribute="Placeholder" context="Placeholder Brackets"/> + <RegExpr String="[A-Za-z_][A-Za-z_0-9]*" attribute="Placeholder" context="#stay"/> + <DetectChar char="." attribute="Placeholder" context="#stay"/> + <DetectSpaces attribute="Normal Text" context="#pop"/> + <RegExpr String="." context="#pop" lookAhead="true"/> + </context> + <context name="Placeholder Brackets" attribute="Placeholder" lineEndContext="#pop"> + <RegExpr String="([[({])" attribute="Placeholder" context="Placeholder Brackets"/> + <DetectChar char="]" attribute="Placeholder" context="#pop"/> + <DetectChar char=")" attribute="Placeholder" context="#pop"/> + <DetectChar char="}" attribute="Placeholder" context="#pop"/> + <RangeDetect char="'" char1="'" attribute="String" context="#stay"/> + <RangeDetect char=""" char1=""" attribute="String" context="#stay"/> + <keyword String="specialvars" attribute="Special Variable" context="#stay"/> + <DetectChar char="#" attribute="Error" context="#stay"/> + </context> + <context name="ShortComment" attribute="Comment" lineEndContext="#pop"> + <DetectSpaces/> + <IncludeRules context="##Alerts" /> + </context> + <context name="LongComment" attribute="Comment" lineEndContext="#stay"> + <DetectSpaces/> + <Detect2Chars char="*" char1="#" attribute="Comment" context="#pop" endRegion="MLComment"/> + <IncludeRules context="##Alerts" /> + </context> + <context name="HTMLComment" attribute="Comment" lineEndContext="#stay"> + <DetectSpaces/> + <IncludeRules context="FindCheetah"/> + <IncludeRules context="##Alerts"/> + <DetectIdentifier/> + <StringDetect attribute="Comment" context="#pop" String="-->" endRegion="HTMLComment" /> + <RegExpr attribute="Error" context="#stay" String="-(-(?!->))+" /> + </context> + <context name="Python" attribute="Normal Text" lineEndContext="#stay"> + <Detect2Chars char="%" char1=">" attribute="Normal Text" context="#pop"/> + <IncludeRules context="##Python" includeAttrib="true"/> + </context> + <context name="FindEntityRefs" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <RegExpr attribute="EntityRef" context="#stay" String="&entref;" /> + <AnyChar attribute="Error" context="#stay" String="&<" /> + </context> + <context name="FindPEntityRefs" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <RegExpr attribute="EntityRef" context="#stay" String="&entref;" /> + <RegExpr attribute="PEntityRef" context="#stay" String="%&name;;" /> + <AnyChar attribute="Error" context="#stay" String="&%" /> + </context> + <context name="FindAttributes" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <RegExpr attribute="Attribute" context="#stay" String="&name;" column="0"/> + <RegExpr attribute="Attribute" context="#stay" String="\s+&name;" /> + <DetectChar attribute="Attribute" context="Value" char="=" /> + </context> + <context name="CDATA" attribute="Normal Text" lineEndContext="#stay"> + <DetectSpaces/> + <DetectIdentifier/> + <IncludeRules context="FindCheetah"/> + <StringDetect attribute="CDATA" context="#pop" String="]]>" endRegion="cdata" /> + <StringDetect attribute="EntityRef" context="#stay" String="]]&gt;" /> + </context> + <context name="PI" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1=">" endRegion="pi" /> + </context> + <context name="Doctype" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <DetectChar attribute="Doctype" context="#pop" char=">" endRegion="doctype" /> + <DetectChar attribute="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset" /> + </context> + <context name="Doctype Internal Subset" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" /> + <StringDetect attribute="Comment" context="LongComment" String="<!--" beginRegion="MLComment" /> + <RegExpr attribute="Processing Instruction" context="PI" String="<\?[\w:-]*" beginRegion="pi" /> + <IncludeRules context="FindPEntityRefs" /> + </context> + <context name="Doctype Markupdecl" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <DetectChar attribute="Doctype" context="#pop" char=">" /> + <DetectChar attribute="Value" context="Doctype Markupdecl DQ" char=""" /> + <DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="'" /> + </context> + <context name="Doctype Markupdecl DQ" attribute="Value" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <DetectChar attribute="Value" context="#pop" char=""" /> + <IncludeRules context="FindPEntityRefs" /> + </context> + <context name="Doctype Markupdecl SQ" attribute="Value" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <DetectChar attribute="Value" context="#pop" char="'" /> + <IncludeRules context="FindPEntityRefs" /> + </context> + <context name="El Open" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <Detect2Chars attribute="Element" context="#pop" char="/" char1=">" /> + <DetectChar attribute="Element" context="#pop" char=">" /> + <IncludeRules context="FindAttributes" /> + <RegExpr attribute="Error" context="#stay" String="\S" /> + </context> + <context name="El Close" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <DetectChar attribute="Element" context="#pop" char=">" /> + <RegExpr attribute="Error" context="#stay" String="\S" /> + </context> + <context name="El Close 2" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <DetectChar attribute="Element" context="#pop#pop#pop" char=">" /> + <RegExpr attribute="Error" context="#stay" String="\S" /> + </context> + <context name="El Close 3" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <DetectChar attribute="Element" context="#pop#pop#pop#pop" char=">" /> + <RegExpr attribute="Error" context="#stay" String="\S" /> + </context> + <context name="CSS" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <Detect2Chars attribute="Element" context="#pop" char="/" char1=">" endRegion="style" /> + <DetectChar attribute="Element" context="CSS content" char=">" /> + <IncludeRules context="FindAttributes" /> + <RegExpr attribute="Error" context="#stay" String="\S" /> + </context> + <context name="CSS content" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <RegExpr attribute="Element" context="El Close 2" String="</style\b" insensitive="TRUE" endRegion="style" /> + <IncludeRules context="##CSS" includeAttrib="true"/> + </context> + <context name="JS" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <Detect2Chars attribute="Element" context="#pop" char="/" char1=">" endRegion="script" /> + <DetectChar attribute="Element" context="JS content" char=">" /> + <IncludeRules context="FindAttributes" /> + <RegExpr attribute="Error" context="#stay" String="\S" /> + </context> + <context name="JS content" attribute="Normal Text" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <RegExpr attribute="Element" context="El Close 2" String="</script\b" insensitive="TRUE" endRegion="script" /> + <RegExpr attribute="Comment" context="JS comment close" String="//(?=.*</script\b)" insensitive="TRUE" /> + <IncludeRules context="##JavaScript" includeAttrib="true"/> + </context> + <context name="JS comment close" attribute="Comment" lineEndContext="#pop"> + <IncludeRules context="FindCheetah"/> + <RegExpr attribute="Element" context="El Close 3" String="</script\b" insensitive="TRUE" endRegion="script" /> + <IncludeRules context="##Alerts" /> + </context> + <context name="Value" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Value NQ"> + <IncludeRules context="FindCheetah"/> + <DetectChar attribute="Value" context="Value DQ" char=""" /> + <DetectChar attribute="Value" context="Value SQ" char="'" /> + <DetectSpaces /> + </context> + <context name="Value NQ" attribute="Normal Text" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop"> + <IncludeRules context="FindCheetah"/> + <IncludeRules context="FindEntityRefs" /> + <RegExpr attribute="Value" context="#stay" String="/(?!>)" /> + <RegExpr attribute="Value" context="#stay" String="[^/><"'\s]" /> + </context> + <context name="Value DQ" attribute="Value" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <DetectChar attribute="Value" context="#pop#pop" char=""" /> + <IncludeRules context="FindEntityRefs" /> + </context> + <context name="Value SQ" attribute="Value" lineEndContext="#stay"> + <IncludeRules context="FindCheetah"/> + <DetectChar attribute="Value" context="#pop#pop" char="'" /> + <IncludeRules context="FindEntityRefs" /> + </context> + </contexts> + <itemDatas> + <itemData name="Normal Text" defStyleNum="dsNormal"/> + <itemData name="Command" defStyleNum="dsFunction"/> + <itemData name="Comment" defStyleNum="dsComment"/> + <itemData name="String" defStyleNum="dsString"/> + <itemData name="Special Variable" defStyleNum="dsOthers"/> + <itemData name="Placeholder" defStyleNum="dsKeyword" color="#5555ff" selColor="#ffffff" bold="0" italic="0" /> + <itemData name="CDATA" defStyleNum="dsBaseN" bold="1" /> + <itemData name="Processing Instruction" defStyleNum="dsKeyword" /> + <itemData name="Doctype" defStyleNum="dsDataType" bold="1" /> + <itemData name="Element" defStyleNum="dsKeyword" /> + <itemData name="Attribute" defStyleNum="dsOthers" /> + <itemData name="Value" defStyleNum="dsString" color="#a00" /> + <itemData name="EntityRef" defStyleNum="dsDecVal" /> + <itemData name="PEntityRef" defStyleNum="dsDecVal" /> + <itemData name="Error" defStyleNum="dsError" /> + </itemDatas> +</highlighting> +<general> + <keywords casesensitive="1" additionalDeliminator="#"/> + <comments> + <comment name="singleLine" start="##"/> + <comment name="multiLine" start="#*" end="*#" region="MLComment"/> + <comment name="multiLine" start="<!--" end="-->" region="HTMLComment"/> + </comments> +</general> +</language> +<!-- kate: space-indent on; indent-width 4; replace-tabs on; indent-mode xml; --> diff --git a/devscripts/CI/appveyor_install_pypy.cmd b/devscripts/CI/appveyor_install_pypy.cmd new file mode 100644 index 0000000..12470be --- /dev/null +++ b/devscripts/CI/appveyor_install_pypy.cmd @@ -0,0 +1,7 @@ +REM curl -fsSL -o pypy2.zip https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.10.0-win32.zip
+REM 7z x pypy2.zip -oc:\
+
+REM Borrowed from https://github.com/pytest-dev/pytest/blob/master/scripts/install-pypy.bat
+REM install pypy using choco
+REM redirect to a file because choco install python.pypy is too noisy. If the command fails, write output to console
+choco install python.pypy > pypy-inst.log 2>&1 || (type pypy-inst.log & exit /b 1)
diff --git a/devscripts/CI/pip-19.1.1.tar.gz b/devscripts/CI/pip-19.1.1.tar.gz Binary files differnew file mode 100644 index 0000000..1348ea5 --- /dev/null +++ b/devscripts/CI/pip-19.1.1.tar.gz diff --git a/devscripts/CI/run_with_env.cmd b/devscripts/CI/run_with_env.cmd new file mode 100644 index 0000000..5da547c --- /dev/null +++ b/devscripts/CI/run_with_env.cmd @@ -0,0 +1,88 @@ +:: To build extensions for 64 bit Python 3, we need to configure environment +:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: +:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1) +:: +:: To build extensions for 64 bit Python 2, we need to configure environment +:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of: +:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0) +:: +:: 32 bit builds, and 64-bit builds for 3.5 and beyond, do not require specific +:: environment configurations. +:: +:: Note: this script needs to be run with the /E:ON and /V:ON flags for the +:: cmd interpreter, at least for (SDK v7.0) +:: +:: More details at: +:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows +:: http://stackoverflow.com/a/13751649/163740 +:: +:: Author: Olivier Grisel +:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ +:: +:: Notes about batch files for Python people: +:: +:: Quotes in values are literally part of the values: +:: SET FOO="bar" +:: FOO is now five characters long: " b a r " +:: If you don't want quotes, don't include them on the right-hand side. +:: +:: The CALL lines at the end of this file look redundant, but if you move them +:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y +:: case, I don't know why. +@ECHO OFF + +SET COMMAND_TO_RUN=%* +SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows +SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf + +:: Extract the major and minor versions, and allow for the minor version to be +:: more than 9. This requires the version number to have two dots in it. +SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1% +IF "%PYTHON_VERSION:~3,1%" == "." ( + SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1% +) ELSE ( + SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2% +) + +:: Based on the Python version, determine what SDK version to use, and whether +:: to set the SDK for 64-bit. +IF %MAJOR_PYTHON_VERSION% == 2 ( + SET WINDOWS_SDK_VERSION="v7.0" + SET SET_SDK_64=Y +) ELSE ( + IF %MAJOR_PYTHON_VERSION% == 3 ( + SET WINDOWS_SDK_VERSION="v7.1" + IF %MINOR_PYTHON_VERSION% LEQ 4 ( + SET SET_SDK_64=Y + ) ELSE ( + SET SET_SDK_64=N + IF EXIST "%WIN_WDK%" ( + :: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/ + REN "%WIN_WDK%" 0wdf + ) + ) + ) ELSE ( + ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" + EXIT 1 + ) +) + +IF %PYTHON_ARCH% == 64 ( + IF %SET_SDK_64% == Y ( + ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture + SET DISTUTILS_USE_SDK=1 + SET MSSdk=1 + "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% + "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release + ECHO Executing: %COMMAND_TO_RUN% + call %COMMAND_TO_RUN% || EXIT 1 + ) ELSE ( + ECHO Using default MSVC build environment for 64 bit architecture + ECHO Executing: %COMMAND_TO_RUN% + call %COMMAND_TO_RUN% || EXIT 1 + ) +) ELSE ( + ECHO Using default MSVC build environment for 32 bit architecture + ECHO Executing: %COMMAND_TO_RUN% + call %COMMAND_TO_RUN% || EXIT 1 +) diff --git a/devscripts/CI/setuptools-43.0.0.zip b/devscripts/CI/setuptools-43.0.0.zip Binary files differnew file mode 100644 index 0000000..15d756d --- /dev/null +++ b/devscripts/CI/setuptools-43.0.0.zip diff --git a/devscripts/CI/tox-install.cmd b/devscripts/CI/tox-install.cmd new file mode 100644 index 0000000..e5aeb33 --- /dev/null +++ b/devscripts/CI/tox-install.cmd @@ -0,0 +1,26 @@ +REM Downgrade pip/pkg_resources/setuptools to work around a bug in tox
+REM that upgrades packages too eagerly and installs incompatible versions.
+
+REM Cleanup
+del /q /s .tox\py34-w32\lib\site-packages\pip
+del /q /s .tox\py34-w32\lib\site-packages\pkg_resources
+del /q /s .tox\py34-w32\lib\site-packages\setuptools
+
+REM Install pkg_resources/setuptools
+python -m zipfile -e devscripts\CI\setuptools-43.0.0.zip .
+cd setuptools-43.0.0
+python bootstrap.py
+python setup.py install
+cd ..
+python -c "import setuptools; print(setuptools.__version__)"
+
+REM Install pip
+python -m tarfile -e devscripts\CI\pip-19.1.1.tar.gz
+cd pip-19.1.1.
+python bootstrap.py
+python setup.py install
+cd ..
+pip --version
+
+REM Use fixed pip to install dependencies
+pip install %*
diff --git a/devscripts/CI/travisci-release b/devscripts/CI/travisci-release new file mode 100755 index 0000000..ce1ad8e --- /dev/null +++ b/devscripts/CI/travisci-release @@ -0,0 +1,55 @@ +#! /usr/bin/env bash +set -e + +[[ "$TOXENV" == *-flake8 || "$TOXENV" == pypy* ]] && exit 0 + +umask 022 && +chmod -R a+rX . && + +py=$(python -c "import sys; print('.'.join(sys.version.split('.')[:2]))") +v=$(echo "$py" | sed 's/\.//') && + +pip install -U "pip<19.2" "setuptools<44" "readme-renderer<25.0" "twine<2.0" && +if [ "$py" == 3.4 ]; then + pip install -U "wheel==0.31.1" +else + pip install -U "wheel==0.34.1" +fi && +python setup.py sdist && + +if [ -d build ]; then find build -name '*.py[co]' -delete; fi && +python setup.py build_ext && +python setup.py build --executable '/usr/bin/env python' && +python -m compileall build && +python -O -m compileall build && +python setup.py bdist_wheel && + +if [ "$TRAVIS_OS_NAME" == 'linux' ]; then + if [ "$py" == 2.7 ]; then + pyenv global system 3.6.7 2.7.15 + pip3.6 install -U "auditwheel==3.1.0" + elif [ "$py" == 3.4 ]; then + pip install -U typing "auditwheel==2.1.1" + else + pip install -U "auditwheel==3.1.0" + fi && + + for f in dist/Cheetah3-*-cp$v-*-linux_x86_64.whl; do + if [ "$py" == 2.7 ]; then + python3.6 -m auditwheel repair -w dist/ "$f" + else + python -m auditwheel repair -w dist/ "$f" + fi && + rm -f "$f" + done + +elif [ "$TRAVIS_OS_NAME" == 'osx' ]; then + pip install -U delocate + for f in dist/Cheetah3-*-cp$v-*-macosx*.whl; do + delocate-wheel -v "$f" + done +fi && + +# TWINE_USERNAME / TWINE_PASSWORD / TWINE_REPOSITORY_URL +# must be set in Travis settings. +exec twine upload --skip-existing dist/* diff --git a/devscripts/RELEASE-CHECKLIST b/devscripts/RELEASE-CHECKLIST new file mode 100644 index 0000000..a3fa7fd --- /dev/null +++ b/devscripts/RELEASE-CHECKLIST @@ -0,0 +1,41 @@ +0. Run full test suite in all branches. Continue if all tests passed. + +1. Run devscripts/prerelease $NEW_TAG. + +1a. The script checks out the release branch ('maint' for a bug-fix + release, 'master' for minor or major release) and calls editor; update + version, the list of contributors, the list of changes and download URL + in ANNOUNCE.rst; if it is a stable release - edit docs/news.rst to set + release date. Edit Version.py and README.rst in the release branch - + fix versions. Edit section [egg_info] in setup.cfg - set if it is a + stable or development release. In SetupConfig.py edit "Development + Status" in trove classifiers; edit dev_tag or download URL: if a + non-stable version - append 'dev' and date stamp, for a stable version + remove 'dev' and date stamp). Commit. Verify. + +2. Run devscripts/prerelease-tag $NEW_TAG. This checks out the release + branch and creates the new tag at the head of the release branch. Push + the branch and the tag to start test/build. + +3. Run devscripts/release. This generates and uploads new archives to PyPI. + +4. Generate new docs using devscripts/build-all-docs. Upload docs using + devscripts/publish-docs. + +5. Run devscripts/postrelease. The script checks out master and null-merge + maint. The script restores ANNOUNCE.rst from the previous commit + (HEAD~). It calls editor; update next version, remove the list of + contributors and the list of changes, edit download URL in ANNOUNCE.rst. + Edit docs/news.rst - add new version. Edit Version.py and README.rst - + fix versions. Edit section [egg_info] in setup.cfg. In SetupConfig.py + edit "Development Status" in trove classifiers; edit dev_tag or download + URL. Commit. Verify. Fast-forward next to master. + +6. Run devscripts/push-all in the development repository to push all + branches and tags to the public repositories. + +7. Send announcement to the Cheetah mailing list. For a stable release send + announcements to python and python-announce mailing lists. + +8. Announce new release at Wikipedia + (https://en.wikipedia.org/wiki/CheetahTemplate). diff --git a/devscripts/build-all-docs b/devscripts/build-all-docs new file mode 100755 index 0000000..3f4b8bf --- /dev/null +++ b/devscripts/build-all-docs @@ -0,0 +1,14 @@ +#! /bin/sh + +cd "`dirname \"$0\"`" && +PROG_DIR="`pwd`" && + +cd .. && +devscripts/build-docs && +rsync -ahP --del --exclude=/.git --exclude=/.nojekyll \ + --exclude=/CNAME --exclude=/robots.txt \ + docs/html/ ../cheetahtemplate3.github.io/ && + +cd ../cheetahtemplate3.github.io && +sitemap_gen.py --config="$PROG_DIR"/cheetahtemplate.org-sitemapconfig.xml && +exec git status diff --git a/devscripts/build-docs b/devscripts/build-docs new file mode 100755 index 0000000..dcd94d8 --- /dev/null +++ b/devscripts/build-docs @@ -0,0 +1,4 @@ +#! /bin/sh + +cd "`dirname \"$0\"`"/../docs && +exec ./rebuild diff --git a/devscripts/cheetahtemplate.org-sitemapconfig.xml b/devscripts/cheetahtemplate.org-sitemapconfig.xml new file mode 100644 index 0000000..1adc406 --- /dev/null +++ b/devscripts/cheetahtemplate.org-sitemapconfig.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + sitemap_gen.py configuration script for cheetahtemplate.org +--> + + <site + base_url="https://cheetahtemplate.org/" + store_into="sitemap.xml" + default_encoding="utf-8" + verbose="1" + sitemap_type="web" + suppress_search_engine_notify="1" + > + + <directory + url="https://cheetahtemplate.org/" + path="." + default_file="index.html" + /> + + <!-- Exclude URLs within UNIX-style hidden files or directories --> + <filter action="drop" type="regexp" pattern="/\.[^/]*" /> + +</site> diff --git a/devscripts/git-hooks/post-checkout b/devscripts/git-hooks/post-checkout new file mode 100755 index 0000000..2c7b245 --- /dev/null +++ b/devscripts/git-hooks/post-checkout @@ -0,0 +1,18 @@ +#!/bin/sh + +# post-checkout hook: compile python files to byte code + +prev_HEAD="$1" +new_HEAD="$2" +new_branch="$3" + +if [ "$new_branch" = 1 ]; then + # if branch was changed - remove old bytecode files and outdated docs + find . -name '*.py[co]' -delete && + rm -rf docs/_build/html docs/html +fi && + +python -m compileall -q -x '\.tox/.+' . && +python -O -m compileall -q -x '\.tox/.+' . + +exit 0 diff --git a/devscripts/git-hooks/post-merge b/devscripts/git-hooks/post-merge new file mode 100755 index 0000000..633a1d0 --- /dev/null +++ b/devscripts/git-hooks/post-merge @@ -0,0 +1,8 @@ +#!/bin/sh + +# post-merge hook that compiles python files to byte code + +python -m compileall -q -x '\.tox/.+' . && +python -O -m compileall -q -x '\.tox/.+' . + +exit 0 diff --git a/devscripts/git-hooks/post-rewrite b/devscripts/git-hooks/post-rewrite new file mode 100755 index 0000000..df28442 --- /dev/null +++ b/devscripts/git-hooks/post-rewrite @@ -0,0 +1,8 @@ +#!/bin/sh + +# post-rewrite hook that compiles python files to byte code + +python -m compileall -q -x '\.tox/.+' . && +python -O -m compileall -q -x '\.tox/.+' . + +exit 0 diff --git a/devscripts/postrelease b/devscripts/postrelease new file mode 100755 index 0000000..cf1cfcb --- /dev/null +++ b/devscripts/postrelease @@ -0,0 +1,22 @@ +#! /bin/sh + +tag="`python setup.py --version`" && + +. `dirname $0`/split.sh && +split_tag $tag + +if [ $micro -eq 0 -a $state = final ] && + git branch --merged master | grep -Fqw maint; then + git checkout maint && + git merge --ff-only master && + git checkout master +else: + git checkout master && + git merge --ff-only maint || + git merge --strategy=ours -m 'Null-merge branch "maint"' maint +fi && + +git checkout $tag~ ANNOUNCE.rst && + +`git var GIT_EDITOR` ANNOUNCE.rst docs/news.rst Cheetah/Version.py README.rst setup.cfg SetupConfig.py && +exec git commit --message="Prepare for the next release" ANNOUNCE.rst docs/news.rst Cheetah/Version.py README.rst setup.cfg SetupConfig.py diff --git a/devscripts/prerelease b/devscripts/prerelease new file mode 100755 index 0000000..981e6aa --- /dev/null +++ b/devscripts/prerelease @@ -0,0 +1,20 @@ +#! /bin/sh + +if [ -z "$1" -o -n "$2" ]; then + echo "Usage: $0 new_tag" >&2 + exit 1 +else + tag="$1" +fi + +. `dirname $0`/split.sh && +split_tag $tag + +if [ $micro -eq 0 -o $state != final ]; then + git checkout master +else + git checkout maint +fi && + +`git var GIT_EDITOR` ANNOUNCE.rst docs/news.rst Cheetah/Version.py README.rst setup.cfg SetupConfig.py && +exec git commit --message="Release $tag" ANNOUNCE.rst docs/news.rst Cheetah/Version.py README.rst setup.cfg SetupConfig.py diff --git a/devscripts/prerelease-tag b/devscripts/prerelease-tag new file mode 100755 index 0000000..0c59a42 --- /dev/null +++ b/devscripts/prerelease-tag @@ -0,0 +1,19 @@ +#! /bin/sh + +if [ -z "$1" -o -n "$2" ]; then + echo "Usage: $0 new_tag" >&2 + exit 1 +else + tag="$1" +fi + +. `dirname $0`/split.sh && +split_tag $tag + +if [ $micro -eq 0 -o $state != final ]; then + git checkout master +else + git checkout maint +fi && + +exec git tag --message="Release $tag" --sign $tag diff --git a/devscripts/publish-docs b/devscripts/publish-docs new file mode 100755 index 0000000..7c6d09d --- /dev/null +++ b/devscripts/publish-docs @@ -0,0 +1,4 @@ +#! /bin/sh + +cd "`dirname \"$0\"`"/../../cheetahtemplate3.github.io && +exec git push origin master diff --git a/devscripts/push-all b/devscripts/push-all new file mode 100755 index 0000000..90d99d5 --- /dev/null +++ b/devscripts/push-all @@ -0,0 +1,4 @@ +#! /bin/sh + + git push --all origin && +exec git push --tags origin diff --git a/devscripts/release b/devscripts/release new file mode 100755 index 0000000..e771d13 --- /dev/null +++ b/devscripts/release @@ -0,0 +1,34 @@ +#! /bin/sh + +cd "`dirname \"$0\"`"/.. && +umask 022 && +chmod -R a+rX . && + +set-commit-date.py && +devscripts/build-docs && + +if [ ! -d build ]; then mkdir build; fi && +python setup.py sdist && + +for py in 2.7 3.4 3.5 3.6 3.7 3.8; do + find build -name '*.py[co]' -delete && + python$py setup.py build_ext && + python$py setup.py build --executable '/usr/bin/env python' && + python$py -m compileall build && + python$py -O -m compileall build && + python$py setup.py bdist_wheel && + cd dist && + v="`echo $py | sed 's/\.//'`" && + for f in Cheetah3-*-cp$v-*-linux_*.whl; do + if [ $py = 2.7 ]; then + python3.6 -m auditwheel repair -w . $f + else + python$py -m auditwheel repair -w . $f + fi && + rm $f + done && + cd .. +done && + +twine upload --skip-existing dist/* && +exec rm -rf build dist docs/html Cheetah3.egg-info diff --git a/devscripts/requirements/requirements.txt b/devscripts/requirements/requirements.txt new file mode 100644 index 0000000..5d2aba7 --- /dev/null +++ b/devscripts/requirements/requirements.txt @@ -0,0 +1 @@ +--install-option=-O2 diff --git a/devscripts/requirements/requirements_dev.txt b/devscripts/requirements/requirements_dev.txt new file mode 100644 index 0000000..e794101 --- /dev/null +++ b/devscripts/requirements/requirements_dev.txt @@ -0,0 +1,5 @@ +-r requirements.txt + +auditwheel +wheel==0.31.1 +twine diff --git a/devscripts/requirements/requirements_docs.txt b/devscripts/requirements/requirements_docs.txt new file mode 100644 index 0000000..e36ba63 --- /dev/null +++ b/devscripts/requirements/requirements_docs.txt @@ -0,0 +1,4 @@ +-r requirements.txt + +Sphinx < 2.0; python_version == '2.7' or python_version == '3.4' +Sphinx; python_version >= '3.5' diff --git a/devscripts/requirements/requirements_tox.txt b/devscripts/requirements/requirements_tox.txt new file mode 100644 index 0000000..8c9b6ed --- /dev/null +++ b/devscripts/requirements/requirements_tox.txt @@ -0,0 +1 @@ +tox >= 2.0, < 3.1 diff --git a/devscripts/setup b/devscripts/setup new file mode 100755 index 0000000..d40081c --- /dev/null +++ b/devscripts/setup @@ -0,0 +1,10 @@ +#! /bin/sh + +umask 022 # -rwxr-xr-x +cd "`dirname \"$0\"`"/.. && + +for py_ver in 2.7 3.4 3.5 3.6 3.7 3.8; do + python$py_ver -m pip install --install-option=-O2 --upgrade . +done && + +exec rm -rf build dist Cheetah3.egg-info MANIFEST *.egg diff --git a/devscripts/split.sh b/devscripts/split.sh new file mode 100644 index 0000000..ce5c3c5 --- /dev/null +++ b/devscripts/split.sh @@ -0,0 +1,22 @@ +split_tag() { + branch=$2 + set -- `echo $1 | sed -e 's/\./ /g' -e 's/a/ alpha /' -e 's/b/ beta /' -e 's/rc/ rc /' -e 's/\([0-9]\)c/\1 rc /'` + major=$1 + minor=$2 + micro=$3 + if [ -n "$4" ]; then + if [ "$4" = rc ]; then + state="release candidate" + else + state=$4 + fi + serial=$5 + else + state=final + serial=0 + fi + + if [ -z "$branch" ]; then + branch=$major.$minor + fi +} diff --git a/devscripts/test-cheetah.cmd b/devscripts/test-cheetah.cmd new file mode 100644 index 0000000..7473fc1 --- /dev/null +++ b/devscripts/test-cheetah.cmd @@ -0,0 +1,16 @@ +@echo off
+
+SetLocal EnableDelayedExpansion
+set SavePATH=%PATH%
+
+for %%V in (27 34 35 36 37 38) do (
+ for %%s in (32 64) do (
+ set PATH=C:\Python%%V-%%s;C:\Python%%V-%%s\Scripts;!SavePATH!
+ set TOXPYTHON=C:\Python%%V-%%s\python.exe
+ !TOXPYTHON! -m tox -e py%%V
+ if !ERRORLEVEL! EQU 0 (echo Ok) else (echo Error && goto Quit)
+ )
+)
+
+:Quit
+set PATH=%SavePATH%
diff --git a/docs/authors.rst b/docs/authors.rst index a40a62b..16132ee 100644 --- a/docs/authors.rst +++ b/docs/authors.rst @@ -31,4 +31,5 @@ Contributions have been made by: * Nicola Soranzo <nicola.soranzo at gmail.com> * Pierre-Yves <pyu at riseup.net> * Dan Vinakovsky <dvinak at gmail.com> +* Yegor Yefremov <yegorslists at googlemail.com> * Oleg Broytman <phd@phdru.name> diff --git a/docs/news.rst b/docs/news.rst index 8c452e6..178405f 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -1,6 +1,21 @@ News ==== +Development (master) +-------------------- + +3.2.5 (2020-05-16) +------------------ + +Build: + + - Install ``Cheetah3`` + ``markdown`` (used in ``Cheetah.Filters``) + using ``pip install cheetah3[filters]`` (or ``cheetah3[markdown]``). + +CI: + + - Run tests with Python 3.8 at Travis CI. + 3.2.4 (2019-10-22) ------------------ @@ -10,13 +10,9 @@ skip_covered = True [easy_install] optimize = 2 -[egg_info] -tag_build = -tag_date = 0 -tag_svn_revision = 0 - [flake8] exclude = .git,.tox,Cheetah/Templates/SkeletonPage.py,build/lib*/Cheetah/Templates/SkeletonPage.py include = buildandrun +# W503 line break before binary operator +# W605 invalid escape sequence ignore = W503,W605 - @@ -5,7 +5,7 @@ [tox] minversion = 2.0 -envlist = py27, py3{4,5,6,7,8}, py{27,37}-flake8, pypy +envlist = py27,py3{4,5,6,7,8},py{27,38}-flake8,pypy [testenv] basepython = @@ -20,7 +20,8 @@ commands = {envpython} --version {envpython} -c "import struct; print(struct.calcsize('P') * 8)" deps = - Markdown >= 2.0.1 + setuptools < 44 + Markdown >= 2.0.1, < 3.2 pygments passenv = CI TRAVIS TRAVIS_* APPVEYOR DISTUTILS_USE_SDK MSSdk INCLUDE LIB WINDIR setenv = @@ -39,6 +40,13 @@ commands = commands = {[tests]commands} +[testenv:py34-w32] +platform=win32 +whitelist_externals=tox-install.cmd +install_command=devscripts\\CI\\tox-install.cmd {opts} {packages} +commands = + {[tests]commands} + [testenv:py35] commands = {[tests]commands} @@ -62,7 +70,7 @@ commands = {[testenv]commands} flake8 . -[testenv:py37-flake8] +[testenv:py38-flake8] deps = flake8 commands = |