File python-mappyfile.spec of Package python-mappyfile

#
# spec file for package python-mappyfile
#
# 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-mappyfile
Version:        0.2.1
Release:        0
Summary:        A pure Python MapFile parser for working with MapServer
License:        MIT
Group:          Development/Languages/Python
Url:            https://github.com/geographika/mappyfile
Source:         https://files.pythonhosted.org/packages/source/m/mappyfile/mappyfile-%{version}.tar.gz
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module lark-parser}
BuildRequires:  %{python_module pyparsing}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  unzip
# The not yet singlespeced module deps
# build documentation
#BuildRequires:  %%{python_module Sphinx}
# build tests
#BuildRequires:  %%{python_module colorama}
#BuildRequires:  %%{python_module pydot}
#BuildRequires:  %%{python_module pluggy}
Requires:       python-lark-parser
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%python_subpackages

%description
A Python 2, 3 library to create, parse, and modify MapServer Mapfiles.
Pure Python - no MapServer dependencies.

mappyfile takes a Mapfile as input and parses it into an Abstract syntax
tree (AST) using plyplus which in turn is built on PLY. mappyfile can then
transform the AST into a dictionary structure, containing keys, values,
dicts, and lists familiar to Python programmers.
This structure can be edited directly. Alternatively new objects can be
added by parsing further Mapfile text and inserting into the dictionary
structure. mappyfile also includes a “pretty printer” to export this
dictionary structure back to a Mapfile.

More on https://mappyfile.readthedocs.io/en/latest/

%prep
%setup -q -n mappyfile-%{version}
rm -rf *.egg-info
sed -i "s/\r//g" LICENSE
sed -i "s/\r//g" README.rst

%build
%python_build
# Build singlehtml help
#cd doc
#make singlehtml

%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

#%%check
# Upstream need to fix certain parts to make them pertinent
# Upstream issue #9
#%%python_exec %%{_bindir}/pytest

%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE README.rst
%{python_sitelib}/mappyfile-%{version}-py%{python_version}.egg-info/
%{python_sitelib}/mappyfile/

%changelog
openSUSE Build Service is sponsored by