From b112395caeb535fb201007a0f81619c2e297d9ce710dc2a1561314b074320a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 27 Jun 2025 15:29:19 +0000 Subject: [PATCH] - Convert to libalternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Cheetah3?expand=0&rev=39 --- .gitattributes | 23 +++++ .gitignore | 1 + Cheetah3-3.2.6.post1.tar.gz | 3 + cheetah3-3.3.3.post1.tar.gz | 3 + cheetah3-3.4.0.tar.gz | 3 + python-Cheetah3.changes | 194 ++++++++++++++++++++++++++++++++++++ python-Cheetah3.spec | 104 +++++++++++++++++++ 7 files changed, 331 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Cheetah3-3.2.6.post1.tar.gz create mode 100644 cheetah3-3.3.3.post1.tar.gz create mode 100644 cheetah3-3.4.0.tar.gz create mode 100644 python-Cheetah3.changes create mode 100644 python-Cheetah3.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Cheetah3-3.2.6.post1.tar.gz b/Cheetah3-3.2.6.post1.tar.gz new file mode 100644 index 0000000..455e555 --- /dev/null +++ b/Cheetah3-3.2.6.post1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58b5d84e5fbff6cf8e117414b3ea49ef51654c02ee887d155113c5b91d761967 +size 295992 diff --git a/cheetah3-3.3.3.post1.tar.gz b/cheetah3-3.3.3.post1.tar.gz new file mode 100644 index 0000000..88ea940 --- /dev/null +++ b/cheetah3-3.3.3.post1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:328119519af18431d6690250c58895594548c6ab354d21ea795de8c4323cd1ef +size 315641 diff --git a/cheetah3-3.4.0.tar.gz b/cheetah3-3.4.0.tar.gz new file mode 100644 index 0000000..81b1559 --- /dev/null +++ b/cheetah3-3.4.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f1fb60c0df8acec48561ba561d023b55498bd04e7b3763d4ca14adaf3d62405 +size 318357 diff --git a/python-Cheetah3.changes b/python-Cheetah3.changes new file mode 100644 index 0000000..0f8c79f --- /dev/null +++ b/python-Cheetah3.changes @@ -0,0 +1,194 @@ +------------------------------------------------------------------- +Fri Jun 27 15:08:21 UTC 2025 - Markéta Machová + +- Convert to libalternatives + +------------------------------------------------------------------- +Mon Apr 14 05:48:43 UTC 2025 - Steve Kowalik + +- Support both lowercased and unnormalized metadata directory names. + +------------------------------------------------------------------- +Tue Mar 25 00:39:18 UTC 2025 - Steve Kowalik + +- Lowercase metadata directory name. + +------------------------------------------------------------------- +Tue Dec 10 16:53:01 UTC 2024 - Markéta Machová + +- Update to 3.4.0 + * Fixed ImportHooks: it must raise ModuleNotFoundError instead of ImportError. + * Use cache_from_source in ImportManager to find out .pyc/.pyo byte-code files. + * Add compatibility with Python 3.13 (multiple fixes) + +------------------------------------------------------------------- +Tue Aug 27 07:25:57 UTC 2024 - Frantisek Simorda + +- update to 3.3.3.post1: + * GHActions: Build and publish wheels on Linux/aarch64. + +- version 3.3.3: + * Protect import cgi in preparation to Python 3.13. + * Run tests with Python 3.12. + * GHActions: Ensure pip only if needed + +- version 3.3.2: + * Fixed printing to stdout in CheetahWrapper. + * CI(GHActions): Install all Python and PyPy versions from conda-forge. + +- version 3.3.1: + * Fixed ImportHooks under PyPy3. + * Run tests with PyPy3. + * Use conda to install older Pythons + +- version 3.3.0.post1: + * Run tests with Python 3.11 + * Fix DeprecationWarning: unittest.findTestCases() is deprecated. Use unittest.TestLoader.loadTestsFromModule() instead + * Publish wheels at Github Releases. + +- version 3.3.0: + * PyPI has wrongfully classified project Cheetah3 as “critical”. This puts a burden to use 2FA to manage the project at PyPI. To avoid the burden the project is renamed to CT3 at PyPI. There will be no updates for Cheetah3. Sorry for the inconvenience! + * Use relative imports everywhere. + * Run pure-python NameMapper tests in a separate process. + * Fixed a bug in tests with pure-python NameMapper. + * Add Python 3.10 to tox.ini. + * Migrated to GitHub Actions. + +- version 3.2.7b1: + * Load from JSON file to searchlist (similar to loading from pickle). + * Fix filetype for Python 2 in Template. + * Build wheels for aarch64 at Travis; publish them at PyPI. + * tox.ini: Limit VIRTUALENV_PIP version for Python 3.4. + + +------------------------------------------------------------------- +Tue Jan 11 07:29:00 UTC 2022 - Steve Kowalik + +- Update to 3.2.6.post1: + * Skip test_import_bootlocale() on Python 3.10 + +------------------------------------------------------------------- +Thu Jan 21 08:25:38 UTC 2021 - John Vandenberg + +- Add Suggests for python-Markdown and python-Pygments +- Use python_alternative to fix multi Python 3 builds +- Tidy spec +- Disable tests failing on Python 3.6 +- update to 3.2.6 + * Fix use of uninitialized variable in _namemapper.c + +------------------------------------------------------------------- +Wed Jul 8 14:29:00 UTC 2020 - Ondřej Súkup + +- update to 3.2.5 + * build fixes + +------------------------------------------------------------------- +Tue Apr 21 17:05:55 UTC 2020 - Matej Cepl + +- Cleanup of the SPEC file, remove warnings. + +------------------------------------------------------------------- +Fri Feb 14 11:31:46 UTC 2020 - trenn@suse.de + +- python-Markdown is a BuildRequire for python-Cheetah3 + python2-Markdown package is not built anymore since last + submitrequest: + - disable python2 build: Markdown is python 3 only now + Therefore python-Cheetah3 can also only build python3-Cheetah3 + due to: nothing provides python2-Markdown + unresolvable build service errors otherwise + +------------------------------------------------------------------- +Mon Oct 7 13:22:56 UTC 2019 - Tomáš Chvátal + +- Update to 3.2.4: + * Import from collections for Python 2, from collections.abc for Python 3. + * Fixed infinite recursion in ImportManager on importing module _bootlocale inside open(). + +------------------------------------------------------------------- +Thu May 23 08:00:15 UTC 2019 - pgajdos@suse.com + +- version update to 3.2.3 + - Fixed infinite recursion in ``ImportManager`` on importing + a builtin module. + - The site https://cheetahtemplate.org/ is now served with HTTPS. + - Updated docs regarding fixed tests. + +------------------------------------------------------------------- +Tue May 21 09:17:11 UTC 2019 - Tomáš Chvátal + +- Do not provide Cheetah3 namespace on python2, if someone wants + Cheetah3 binary they need the python3 variant anyway + +------------------------------------------------------------------- +Fri May 3 11:57:28 UTC 2019 - Martin Pluskal + +- Update to version 3.2.2: + * Replaced outdated and insecure mktemp with mkstemp. + * Fixed bugs in TemplateCmdLineIface.py: read binary pickles from + stdin and files. + * Use cgi.escape() for Python 2, html.escape() for Python 3. + * Created tests for TemplateCmdLineIface. +- Update test dependencies + +------------------------------------------------------------------- +Thu Mar 21 15:35:51 UTC 2019 - Tomáš Chvátal + +- Enable py2 as it supports python2 +- Update to 3.2.1: + * Changed LoadTemplate.loadTemplate{Module,Class}: the loaded module’s __name__ set to just the file name. + * Use imp for Python 2, importlib for Python 3. + * Fix a bug in LoadTemplate.loadTemplate{Module,Class}: raise ImportError if the template was not found. + +------------------------------------------------------------------- +Tue Mar 5 12:14:57 UTC 2019 - Tomáš Chvátal + +- Update to 3.2.0: + * Dropped support for Python 3.3. + * Implement LoadTemplate.loadTemplate{Module,Class} to load templates from .py[co], .py or .tmpl. + * CheetahDirOwner caches compiled template in the template directory. + * CheetahDirOwner now silently ignores errors on compiled templates writing. To get tracebacks set CheetahDirOwner.debuglevel = 1. + * CheetahDirOwner and DirOwner byte-compile compiled templates to .pyc/.pyo. Errors on writing are silently ignored. + * Implement Compiler.__unicode__ under Python 2 and Compiler.__bytes__ under Python 3. + * Fix a bug in Compiler.__str__: under Python 2 the method now always returns str; it encodes unicode to str using encoding from the compiled source. Under Python 3 the method decodes bytes to str. +- Execute tests + +------------------------------------------------------------------- +Mon Dec 10 12:39:18 UTC 2018 - Tomáš Chvátal + +- Fix fdupes call + +------------------------------------------------------------------- +Fri Apr 6 08:34:28 UTC 2018 - mpluskal@suse.com + +- Update to version 3.1.0: + * Fix Cheetah to work with PyPy. + * Code cleanup: fix code style to satisfy flake8 linter. + * Rename www directory to docs. + +------------------------------------------------------------------- +Fri Dec 29 13:05:35 UTC 2017 - mpluskal@suse.com + +- Conflict with python-cheetah + +------------------------------------------------------------------- +Thu Dec 28 23:14:20 UTC 2017 - jengelh@inai.de + +- Remove some filler wording from descriptions. + The summary can do without repeating the software name. +- Avoid running fdupes over partition boundaries. + +------------------------------------------------------------------- +Sun Dec 24 15:45:04 UTC 2017 - mpluskal@suse.com + +- Cleanup spec file + * Run spec-cleaner + * Remove text that does not belong to describtions + * Install license +- Build only python3 version + +------------------------------------------------------------------- +Thu Dec 7 22:00:04 UTC 2017 - boris@steki.net + +- initial packaging diff --git a/python-Cheetah3.spec b/python-Cheetah3.spec new file mode 100644 index 0000000..64e37e4 --- /dev/null +++ b/python-Cheetah3.spec @@ -0,0 +1,104 @@ +# +# spec file for package python-Cheetah3 +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define modname cheetah3 +%bcond_without libalternatives +Name: python-Cheetah3 +Version: 3.4.0 +Release: 0 +Summary: Template engine and code generation tool +License: MIT +Group: Development/Languages/Python +URL: https://cheetahtemplate.org/ +Source: https://github.com/CheetahTemplate3/cheetah3/archive/refs/tags/%{version}.tar.gz#/%{modname}-%{version}.tar.gz +BuildRequires: %{python_module devel} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: alts +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: alts +Recommends: python-Markdown +Suggests: python-Pygments +Conflicts: python-Cheetah +Provides: python-Cheetah = %{version} +Provides: python-cheetah = %{version} +Obsoletes: python-Cheetah < %{version} +# SECTION test requirements +BuildRequires: %{python_module Markdown} +BuildRequires: %{python_module Pygments} +# /SECTION +%python_subpackages + +%description +Cheetah is an 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 flexible and can +also be used to generate C++ game code, Java, SQL, form emails and even +Python code. + +It is a fork of the original CheetahTemplate library. + +%prep +%setup -q -n %{modname}-%{version} +%autopatch -p1 +find . -name \*.py -print0 |xargs -0 -t -l sed -i -e '1{\@^#!%{_bindir}/env python@d}' + +# Disable some tests which fail on Python 3.6 +# * GetVar +# * GetVar_MacEOL +# * GetVar_Win32EOL +# TODO: The following disables ~100 tests, and should be optimised +sed -Ei 's/(test6)/_\1/' Cheetah/Tests/SyntaxAndOutput.py + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/cheetah +%python_clone -a %{buildroot}%{_bindir}/cheetah-analyze +%python_clone -a %{buildroot}%{_bindir}/cheetah-compile +%python_group_libalternatives cheetah cheetah-analyze cheetah-compile +%{python_expand rm -r %{buildroot}%{$python_sitearch}/Cheetah/Tests +%fdupes %{buildroot}%{$python_sitearch} +} + +%pre +%python_libalternatives_reset_alternative cheetah + +%check +mkdir ~/bin +export PATH=~/bin:$PATH +%{python_expand export PYTHONPATH=$PWD +cp %{buildroot}/%{_bindir}/cheetah-%{$python_bin_suffix} ~/bin/cheetah +export PYTHONDONTWRITEBYTECODE=1 +$python Cheetah/Tests/Test.py +} + +%files %{python_files} +%license LICENSE +%doc ANNOUNCE.rst README.rst BUGS +%python_alternative %{_bindir}/cheetah +%python_alternative %{_bindir}/cheetah-analyze +%python_alternative %{_bindir}/cheetah-compile +%{python_sitearch}/Cheetah +%{python_sitearch}/[Cc][Tt]3-%{version}.dist-info + +%changelog