15
0
Files
python-parse_type/python-parse_type.spec
Dirk Mueller c0ba10db8f - update to 0.6.2:
* #21: tests/test_parse.py tests ``parse_type.parse`` (per
    default).
  * REASON: Using for older installed ``parse`` module may
    cause weird problems.
  * RELATED TO: ``parse v1.19.1`` (behavior changed compared to
    ``v1.19.0``)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parse_type?expand=0&rev=14
2023-12-10 21:39:33 +00:00

86 lines
2.5 KiB
RPMSpec

#
# spec file for package python-parse_type
#
# Copyright (c) 2023 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/
#
%bcond_without python2
Name: python-parse_type
Version: 0.6.2
Release: 0
Summary: Extension to the parse module
License: MIT
Group: Development/Languages/Python
URL: https://github.com/jenisys/parse_type
Source: https://github.com/jenisys/parse_type/archive/v%{version}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-parse >= 1.12.0
Requires: python-six >= 1.11
BuildArch: noarch
%if %{with python2}
BuildRequires: python-enum34
%endif
%ifpython2
Requires: python-enum34
%endif
# SECTION test requirements
BuildRequires: %{python_module parse >= 1.12.0}
BuildRequires: %{python_module pytest >= 3.0}
BuildRequires: %{python_module six >= 1.11}
# /SECTION
%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
%autosetup -p1 -n parse_type-%{version}
# no extra pytest options are needed
rm pytest.ini
# Remove bundled parse.py
rm parse_type/parse.py
rm tests/test_parse.py
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
%files %{python_files}
%license LICENSE
%doc README.rst
%{python_sitelib}/parse_type
%{python_sitelib}/parse_type-%{version}*-info
%changelog