2019-02-13 15:02:45 +00:00
#
# spec file for package python-parse_type
#
2019-02-14 08:31:52 +00:00
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
2019-02-13 15:02:45 +00:00
#
# 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.
2019-02-14 08:31:52 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
2019-02-13 15:02:45 +00:00
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name : python-parse_type
2019-08-27 23:43:06 +00:00
Version : 0.5.2
2019-02-13 15:02:45 +00:00
Release : 0
2019-02-14 08:31:52 +00:00
Summary : Extension to the parse module
2019-02-13 15:02:45 +00:00
License : BSD-3-Clause
Group : Development/Languages/Python
2019-08-27 23:43:06 +00:00
URL : https://github.com/jenisys/parse_type
2019-02-13 15:02:45 +00:00
Source : https://files.pythonhosted.org/packages/source/p/parse_type/parse_type-%{version} .tar.gz
2019-02-14 10:35:52 +00:00
Patch0 : testsuite-fix.patch
2019-02-13 15:02:45 +00:00
BuildRequires : %{python_module devel}
BuildRequires : %{python_module setuptools}
2019-08-27 23:43:06 +00:00
BuildRequires : fdupes
2019-02-14 08:31:52 +00:00
BuildRequires : python-rpm-macros
2019-02-14 10:35:52 +00:00
BuildRequires : python2-enum34
2019-08-27 23:43:06 +00:00
Requires : python-parse >= 1.12.0
2019-02-13 15:02:45 +00:00
Requires : python-six >= 1.11
2019-08-27 23:43:06 +00:00
Suggests : python-coverage
2019-02-13 15:02:45 +00:00
Suggests : python-enum34
Suggests : python-ordereddict
Suggests : python-pytest >= 3.0
Suggests : python-pytest-cov
Suggests : python-sphinx >= 1.2
2019-08-27 23:43:06 +00:00
Suggests : python-tox
2019-02-13 15:02:45 +00:00
BuildArch : noarch
2019-08-27 23:43:06 +00:00
# SECTION test requirements
BuildRequires : %{python_module parse >= 1.12.0}
BuildRequires : %{python_module pytest >= 3.0}
BuildRequires : %{python_module six >= 1.11}
# /SECTION
2019-02-13 15:02:45 +00:00
%python_subpackages
%description
parse_type extends the parse module (opposite of string.format()) with
the following features:
* build type converters for common use cases (enum/mapping, choice)
* build a type converter with a cardinality constraint (0..1, 0..*, 1..*)
from the type converter with cardinality=1.
* compose a type converter from other type converters
* an extended parser that supports the CardinalityField naming schema
and creates missing type variants (0..1, 0..*, 1..*) from the
primary type converter
%prep
%setup -q -n parse_type-%{version}
2019-08-27 23:43:06 +00:00
%patch0 -p1
2019-02-13 15:02:45 +00:00
2019-02-14 10:35:52 +00:00
# Remove bundled parse.py
rm -fv parse_type/parse.py
2019-02-13 15:02:45 +00:00
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot} %{$python_sitelib}
2019-02-14 10:35:52 +00:00
%check
2019-08-27 23:43:06 +00:00
%pytest -k 'not (test_parse_with_many0_and_unnamed_fields or test_parse_with_many_and_unnamed_fields or test_parse_with_optional_and_unnamed_fields or test_pm_overflow_issue16)'
2019-02-14 10:35:52 +00:00
2019-02-13 15:02:45 +00:00
%files %{python_files}
2019-02-14 10:35:52 +00:00
%license LICENSE
%doc README.rst
2019-02-13 15:02:45 +00:00
%{python_sitelib} /*
%changelog