File python-jinja2-cli.spec of Package python-jinja2-cli
#
# spec file for package python-jinja2-cli
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-jinja2-cli
Version: 0.7.0
Release: 0
Summary: A CLI interface to Jinja2
License: BSD-3-Clause
Group: Development/Languages/Python
Url: https://github.com/mattrobenolt/jinja2-cli
Source: https://files.pythonhosted.org/packages/source/j/jinja2-cli/jinja2-cli-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: %{python_module Jinja2}
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module toml}
BuildRequires: %{python_module xmltodict}
# Testing requirements:
BuildRequires: %{python_module flake8}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest-runner}
BuildRequires: %{python_module WebTest}
Requires: python-Jinja2
Requires: python-PyYAML
Requires: python-toml
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%python_subpackages
%description
jinja2 client interface for Jinja2 a template engine written
in pure Python.
If PyYAML is present, you can use YAML as an input data source.
If toml is present, you can use TOML as an input data source.
Here some way to use it :
jinja2 helloworld.tmpl data.json --format=json
cat data.json | jinja2 helloworld.tmpl
curl -s http://httpbin.org/ip | jinja2 helloip.tmpl
curl -s http://httpbin.org/ip | jinja2 helloip.tmpl > helloip.html
%prep
%setup -q -n jinja2-cli-%{version}
#Remove the limits for flake8<3
sed -i 's/flake8<3/flake8/g' setup.py
rm -frv ./tests
%build
%python_build
%install
%python_install
%python_expand %fdupes -s %{buildroot}%{$python_sitelib}
#Upstream error they install tests
%python_expand rm -frv %{buildroot}%{$python_sitelib}/tests
%check
%python_exec setup.py test
# Test data not in tarball they are available on github ?
#%%check
#pushd %%{buildroot}%%{python3_sitelib}/tests
#PYTHONPATH=%%{buildroot}%%{python3_sitelib} py.test
#popd
%files %python_files
%defattr(-,root,root,-)
%if 0%{?leap_version} >= 420200 || 0%{?suse_version} > 1320
%license LICENSE
%else
%doc LICENSE
%endif
%doc README.md
%python3_only %{_bindir}/*
%{python_sitelib}/jinja2cli/
%{python_sitelib}/jinja2_cli-%{version}-py%{python_version}.egg-info
%changelog