#
# spec file for package python-regex
#
# Copyright (c) 2020 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/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-regex
Version:        2020.2.20
Release:        1.1
Summary:        Alternative regular expression module for Python
License:        Python-2.0
Group:          Development/Languages/Python
URL:            https://bitbucket.org/mrabarnett/mrab-regex
Source:         https://files.pythonhosted.org/packages/source/r/regex/regex-%{version}.tar.gz
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  python3-testsuite
%python_subpackages

%description
An alternate regex implementation. It differs from "re" in that

* Zero-width matches are handled like in Perl and PCRE:
  * ``.split`` will split a string at a zero-width match.
  * ``.sub`` will handle zero-width matches correctly.
* Inline flags apply to the end of the group or pattern, and they can
  be turned off.
* Nested sets and set operations are supported.
* Case-insensitive matches in Unicode use full case-folding by
  default.

%prep
%setup -q -n regex-%{version}

%build
%python_build

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

%check
export PYTHONDONTWRITEBYTECODE=1
%pytest_arch %{buildroot}%{$python_sitearch}/regex

%files %{python_files}
%doc README.rst
%doc docs/*
%{python_sitearch}/*

%changelog
* Thu Mar 19 2020 pgajdos@suse.com
- version update to 2020.2.20
  * no upstream changelog found
* Tue Sep 10 2019 Tomáš Chvátal <tchvatal@suse.com>
- Update to 2019.08.19:
  * minor fixes
* Mon Jul 22 2019 Tomáš Chvátal <tchvatal@suse.com>
- Update to 2019.06.08:
  * minor fixes
* Wed Jun  5 2019 Marketa Calabkova <mcalabkova@suse.com>
- Update to 2019.06.05
  * Updated for Python 3.8.
  * Updated to Unicode 12.1.0.
  * For fullmatch, added check for end/start of string for
    RE_OP_SUCCESS in try_match.
* Tue May 14 2019 Tomáš Chvátal <tchvatal@suse.com>
- Update to 2019.04.14:
  * no upstream changelog provided
* Mon Jul  2 2018 toddrme2178@gmail.com
- Update to 2018.06.21
  * Fixed Regex matches with `re` but not with `regex` module
  * Fixed that the reported positions of fuzzy changes were
    sometimes incorrect.
  * Updated Unicode word and grapheme boundaries for Unicode
    11.0.0, which I had overlooked...
  * Updated to Unicode 11.0.0.
  * Fixed an off-by-one bug where a lazy repeat is followed by a
    character (quick check).
  * Fixed that the Unicode normalization quick check properties
    weren't handled correctly.
  * Further changes to match re module's behaviour on zero-width
    matching for Python 3.7.
  * Added 'fuzzy_changes' attribute to match object to indicate
    positions of changes in fuzzy match.
* Sat Sep  2 2017 jengelh@inai.de
- Specify in description what makes regex worthwhile to have.
  Fix RPM group.
* Thu Aug 31 2017 toddrme2178@gmail.com
- Update to 2017.07.28
  * Too many changes to list
* Thu Aug 24 2017 jmatejek@suse.com
- singlespec auto-conversion
* Fri Jun 16 2017 ecsos@opensuse.org
- Update to 2017.06.07
  * Too many changes to list
* Sat Sep 17 2016 toddrme2178@gmail.com
- Update to 2016.08.27
  * Too many changes to list
- Complete rewrite of the .spec file.
* Wed May  9 2012 froh@suse.com
- update to current version 0.1.20120506
* Tue Oct  4 2011 jw@suse.com
- initial pull from pypi