14
0
forked from pool/python-moban

- Convert to libalternatives

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-moban?expand=0&rev=24
This commit is contained in:
2025-06-09 12:41:26 +00:00
committed by Git OBS Bridge
commit d2370c3164
9 changed files with 2803 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -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

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

3
moban-0.8.2.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:884fa73c7feaa0b8b5cf8c11ac4f2b557cd06d581fe0845cc4c4634b139c00ea
size 1003121

152
python-moban.changes Normal file
View File

@@ -0,0 +1,152 @@
-------------------------------------------------------------------
Mon Jun 9 12:40:57 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives
-------------------------------------------------------------------
Mon Jun 2 12:30:05 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build
-------------------------------------------------------------------
Fri May 20 06:37:52 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch stop-using-jinja-extensions.patch
* Stop using a removed Jinja2 extension.
- Add patch remove-mock.patch
* Switch to using unittest.mock.
-------------------------------------------------------------------
Thu Sep 24 08:38:23 UTC 2020 - pgajdos@suse.com
- version update to 0.8.2
#. Use any functions, any data structure of any python packages as jinja2
filters, tests, globals
#. `#399 <https://github.com/moremoban/moban/issues/399>`_: content processor
should be called only once
#. content processor shall pass on options to content processors
#. moban.plugins.jinja2.tests.files is moved to moban-ansible package
#. moban.plugins.jinja2.filters.github is moved to moban-jinja2-github package
#. `#396 <https://github.com/moremoban/moban/issues/396>`_: custom jinja2
plugins(filters, tests and globals) are not visible if a template is passed
as a string.
#. `#393 <https://github.com/moremoban/moban/issues/393>`_: Rendered content
output to stdout once
#. `#390 <https://github.com/moremoban/moban/issues/390>`_: single render action
will print to stdout by default
- modified patches
% remove_nose.patch (extended, https://github.com/moremoban/moban/pull/404)
- added sources
+ _multibuild
-------------------------------------------------------------------
Fri Sep 18 14:48:12 UTC 2020 - Matej Cepl <mcepl@suse.com>
- Add remove_nose.patch which ports test suite from nose to
pytest (gh#moremoban/moban#364). Still unfinished and work in progress.
-------------------------------------------------------------------
Fri Jun 12 07:54:57 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- Update to 0.7.8
* finally be able strip the rendered content
* -pd for command line to include custom plugin directories
* Non-textual source files should default to copy
-------------------------------------------------------------------
Mon May 25 06:50:48 UTC 2020 - Petr Gajdos <pgajdos@suse.com>
- %python3_only -> %python_alternative
-------------------------------------------------------------------
Fri May 22 07:42:56 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- Update to 0.7.5
* #365: regression was introduced by v0.6.5. If you uses mobanfile
as data configuration file, you are very likely to have this show
stopper.
* suppress stdout message from deprecated pip install. but please
do not use and migrate deprecated`requires` syntax.
-------------------------------------------------------------------
Mon Jan 20 15:16:02 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- Update to 0.7.0
* make gitfs2 and pypifs optional.
* python 2.7 support is dropped.
* show friendlier error when unknown protocol exception was raised.
* python 3.4 support is gone
* no verbose for error, -v for warning, -vv for warning+info, -vvv for warning+info+debug
* show template plugin name, i.e. 'copying' for copy instead of 'templating'
* support moban file inheritance
* support intermediate targets in moban file
* Command options have been grouped. --template_type became --template-type
-------------------------------------------------------------------
Tue Oct 1 14:25:35 UTC 2019 - Marketa Calabkova <mcalabkova@suse.com>
- Update to 0.6.3
* support pyFilesystem2
* -vv show debug trace
* Allow mobanfile to include data from arbitrary config files
* fix moban 0.4.5 test failures on openSUSE Tumbleweed
* '-e' to load extensions for template engines, i.e. jinja2
* jinja-cli parity: support command line pipe stream.
-------------------------------------------------------------------
Tue Jul 23 14:05:47 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 0.5.0:
* various fixes and tests updates
* See CHANGELOG.rst
-------------------------------------------------------------------
Thu Jan 17 10:59:53 UTC 2019 - Jan Engelhardt <jengelh@inai.de>
- Trim bias from description. Fix grammar.
-------------------------------------------------------------------
Mon Jan 14 00:12:54 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Remove base_engine.py workaround
- Removed build dependency on moban-handlebars
- Update to v0.3.8
- Allow template literals as positional arguments
- Report changes in non-zero exit code only with --exit-code
- Disables file permissions copy feature on Windows
-------------------------------------------------------------------
Wed Jan 9 15:58:32 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Fill base_engine.py instead of deleting it.
-------------------------------------------------------------------
Tue Jan 8 04:19:21 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Trim description and add %check
-------------------------------------------------------------------
Mon Jan 7 04:02:49 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Update to v0.3.7
- Simplified CLI usage
- Source tarball includes docs and tests
-------------------------------------------------------------------
Tue Jan 01 09:53:13 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Update to v0.3.6
- Improved Windows support
- Gracefully skip entries encountering write permission errors.
-------------------------------------------------------------------
Mon Dec 17 09:53:13 UTC 2018 - John Vandenberg <jayvdb@gmail.com>
- Update to v0.3.5
- Switched from PyYAML to ruamel.yaml
- Improved error reporting for YAML syntax errors.
-------------------------------------------------------------------
Tue Nov 27 11:00:01 UTC 2018 - John Vandenberg <jayvdb@gmail.com>
- Initial revision for v0.3.4

143
python-moban.spec Normal file
View File

@@ -0,0 +1,143 @@
#
# spec file for package python-moban
#
# 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/
#
# Tests have dependency loop with moban-ansible
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define test 1
%define pkg_suffix -test
%bcond_without test
%else
%define pkg_suffix %{nil}
%bcond_with test
%endif
%bcond_without libalternatives
Name: python-moban%{pkg_suffix}
Version: 0.8.2
Release: 0
Summary: Yet another jinja2 CLI for static text generation
License: MIT
URL: https://github.com/moremoban/moban
Source: https://files.pythonhosted.org/packages/source/m/moban/moban-%{version}.tar.gz
# https://github.com/moremoban/moban/pull/404
Patch0: remove_nose.patch
Patch1: stop-using-jinja-extensions.patch
Patch2: remove-mock.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: alts
BuildRequires: fdupes
BuildRequires: git-core
BuildRequires: python-rpm-macros
Requires: alts
Requires: git-core
Requires: python-Jinja2 >= 2.7.1
Requires: python-appdirs >= 1.4.3
Requires: python-crayons >= 0.1.0
Requires: python-fs >= 2.4.11
Requires: python-jinja2-fsloader >= 0.2.0
Requires: python-lml >= 0.0.9
Requires: python-ruamel.yaml >= 0.15.98
Suggests: python-ansible
Suggests: python-gitfs2
Suggests: python-pypifs
BuildArch: noarch
# SECTION test requirements
%if %{with test}
BuildRequires: %{python_module Jinja2 >= 2.7.1}
BuildRequires: %{python_module appdirs >= 1.4.3}
BuildRequires: %{python_module crayons >= 0.1.0}
BuildRequires: %{python_module fs >= 2.4.11}
BuildRequires: %{python_module jinja2-fsloader >= 0.2.0}
BuildRequires: %{python_module jinja2-time}
BuildRequires: %{python_module lml >= 0.0.9}
BuildRequires: %{python_module moban-ansible}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module ruamel.yaml >= 0.15.98}
%endif
# /SECTION
%python_subpackages
%description
moban (模板) is yet another jinja2 CLI for static text generation.
moban brings the template engine (JINJA2) for web into static text
generation. It is used in the pyexcel project to keep documentation
consistent across the documentations of individual libraries.
%prep
%autosetup -p1 -n moban-%{version}
%if !%{with test}
%build
%pyproject_wheel
%endif
%if !%{with test}
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/moban
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with test}
%check
# integration tests need network
rm -r tests/integration_tests
# test_level_9_deprecated needs pypi-mobans-pkg just for templates... too much effort
SKIP_TESTS="test_level_9_deprecated"
# test_level_9 needs pypifs, which is now optional
SKIP_TESTS="$SKIP_TESTS or test_level_9"
# test_level_10_deprecated depends on access to github.com
SKIP_TESTS="$SKIP_TESTS or test_level_10_deprecated"
# test_level_10 needs gitfs, which is optional
SKIP_TESTS="$SKIP_TESTS or test_level_10"
# test_level_11 probably depends on moban-handlebars, which is needed only in tests
SKIP_TESTS="$SKIP_TESTS or test_level_11"
# test_handle_targets_sequence fails on wrong arg count
SKIP_TESTS="$SKIP_TESTS or test_handle_targets_sequence"
# test_overrides_fs_url needs gitfs2, which is optional
SKIP_TESTS="$SKIP_TESTS or test_overrides_fs_url"
# test_level_24 needs httpfs, which is optional
SKIP_TESTS="$SKIP_TESTS or test_level_24"
# test_repo is probably online, requires git
SKIP_TESTS="$SKIP_TESTS or test_repo"
export SKIP_TESTS
%pytest -k "not ($SKIP_TESTS)"
%endif
%if !%{with test}
%endif
%if !%{with test}
%pre
%python_libalternatives_reset_alternative moban
%endif
%if !%{with test}
%files %{python_files}
%{python_sitelib}/moban
%{python_sitelib}/moban-%{version}*-info
%license LICENSE
%doc README.rst CHANGELOG.rst
%python_alternative %{_bindir}/moban
%endif
%changelog

153
remove-mock.patch Normal file
View File

@@ -0,0 +1,153 @@
Index: moban-0.8.2/tests/core/test_engine.py
===================================================================
--- moban-0.8.2.orig/tests/core/test_engine.py
+++ moban-0.8.2/tests/core/test_engine.py
@@ -2,7 +2,7 @@ import os
import pytest
import fs.path
-from mock import patch
+from unittest.mock import patch
from moban.core import ENGINES
from moban.core.definitions import TemplateTarget
Index: moban-0.8.2/tests/core/test_moban_factory.py
===================================================================
--- moban-0.8.2.orig/tests/core/test_moban_factory.py
+++ moban-0.8.2/tests/core/test_moban_factory.py
@@ -3,7 +3,7 @@ import sys
import pytest
import fs.path
-from mock import patch
+from unittest.mock import patch
from lml.plugin import PluginInfo
import moban.exceptions as exceptions
Index: moban-0.8.2/tests/deprecated/test_handle_requires.py
===================================================================
--- moban-0.8.2.orig/tests/deprecated/test_handle_requires.py
+++ moban-0.8.2/tests/deprecated/test_handle_requires.py
@@ -1,5 +1,5 @@
import pytest
-from mock import patch
+from unittest.mock import patch
from moban.deprecated import GitRequire
Index: moban-0.8.2/tests/deprecated/test_repo.py
===================================================================
--- moban-0.8.2.orig/tests/deprecated/test_repo.py
+++ moban-0.8.2/tests/deprecated/test_repo.py
@@ -2,7 +2,7 @@ import unittest
import pytest
import fs.path
-from mock import patch
+from unittest.mock import patch
from moban.deprecated import GitRequire
from moban.exceptions import NoGitCommand
Index: moban-0.8.2/tests/integration_tests/test_command_line_options.py
===================================================================
--- moban-0.8.2.orig/tests/integration_tests/test_command_line_options.py
+++ moban-0.8.2/tests/integration_tests/test_command_line_options.py
@@ -5,7 +5,7 @@ from shutil import copyfile
import fs
import pytest
-from mock import MagicMock, patch
+from unittest.mock import MagicMock, patch
from moban.core.definitions import TemplateTarget
Index: moban-0.8.2/tests/mobanfile/test_mobanfile.py
===================================================================
--- moban-0.8.2.orig/tests/mobanfile/test_mobanfile.py
+++ moban-0.8.2/tests/mobanfile/test_mobanfile.py
@@ -1,6 +1,6 @@
import pytest
import fs.path
-from mock import patch
+from unittest.mock import patch
from moban.core.definitions import TemplateTarget
Index: moban-0.8.2/tests/mobanfile/test_templates.py
===================================================================
--- moban-0.8.2.orig/tests/mobanfile/test_templates.py
+++ moban-0.8.2/tests/mobanfile/test_templates.py
@@ -2,7 +2,7 @@ import unittest
import pytest
import fs.path
-from mock import patch
+from unittest.mock import patch
from moban.core.mobanfile.templates import handle_template
Index: moban-0.8.2/tests/test_file_system.py
===================================================================
--- moban-0.8.2.orig/tests/test_file_system.py
+++ moban-0.8.2/tests/test_file_system.py
@@ -5,7 +5,7 @@ from shutil import rmtree
import fs
import pytest
-from mock import patch
+from unittest.mock import patch
from moban.externals import file_system
from moban.exceptions import FileNotFound, UnsupportedPyFS2Protocol
Index: moban-0.8.2/tests/test_main.py
===================================================================
--- moban-0.8.2.orig/tests/test_main.py
+++ moban-0.8.2/tests/test_main.py
@@ -5,7 +5,7 @@ from shutil import copyfile
import fs
import pytest
-from mock import MagicMock, patch
+from unittest.mock import MagicMock, patch
import moban.exceptions as exceptions
Index: moban-0.8.2/tests/test_regression.py
===================================================================
--- moban-0.8.2.orig/tests/test_regression.py
+++ moban-0.8.2/tests/test_regression.py
@@ -4,7 +4,7 @@ import filecmp
import unittest
import fs
-from mock import patch
+from unittest.mock import patch
from moban.main import main
from .utils import Docs
Index: moban-0.8.2/tests/test_reporter.py
===================================================================
--- moban-0.8.2.orig/tests/test_reporter.py
+++ moban-0.8.2/tests/test_reporter.py
@@ -2,7 +2,7 @@ import sys
import unittest
import pytest
-from mock import patch
+from unittest.mock import patch
from moban.externals import reporter
Index: moban-0.8.2/tests/utils.py
===================================================================
--- moban-0.8.2.orig/tests/utils.py
+++ moban-0.8.2/tests/utils.py
@@ -5,7 +5,7 @@ from textwrap import dedent
import fs
import pytest
-from mock import patch
+from unittest.mock import patch
from fs.opener.parse import parse_fs_url
from moban.main import main

2313
remove_nose.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
Index: moban-0.8.2/docs/level-12-use-template-engine-extensions/.moban.yml
===================================================================
--- moban-0.8.2.orig/docs/level-12-use-template-engine-extensions/.moban.yml
+++ moban-0.8.2/docs/level-12-use-template-engine-extensions/.moban.yml
@@ -3,7 +3,6 @@ targets:
- b.output: b.template
extensions:
jinja2:
- - jinja2.ext.with_
- filter:moban.externals.file_system.url_join
- test:moban.externals.file_system.exists
- global:description=moban.constants.PROGRAM_DESCRIPTION