#
# spec file for package python-immutables
#
# 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/
#
%define skip_python36 1
%define skip_python38 1
%define skip_python39 1
%define skip_python311 1


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
%{?sle15_python_module_pythons}
Name:           python-immutables
Version:        0.19
Release:        2.1
Summary:        Immutable collections for Python
License:        Apache-2.0
URL:            https://github.com/MagicStack/immutables
Source:         https://files.pythonhosted.org/packages/source/i/immutables/immutables-%{version}.tar.gz
BuildRequires:  %{python_module devel >= 3.6}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module typing-extensions >= 3.7.4.3 if %python-base < 3.8}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
%if %python_version_nodots < 38
Requires:       python-typing-extensions >= 3.7.4.3
%endif
%python_subpackages

%description
Immutable collections for Python.

%prep
%autosetup -p1 -n immutables-%{version}

%build
export CFLAGS="%{optflags}"
%python_build

%install
%python_install
%{python_expand rm %{buildroot}%{$python_sitearch}/immutables/*.[ch]
%fdupes %{buildroot}%{$python_sitearch}
}

%check
export IMMU_SKIP_MYPY_TESTS=1
%pyunittest discover -v

%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitearch}/immutables
%{python_sitearch}/immutables-%{version}*-info

%changelog
* Fri Apr 21 2023 Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
* Thu Apr 13 2023 Matej Cepl <mcepl@suse.com>
- Make calling of %%{sle15modernpython} optional.
* Wed Oct 12 2022 Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to version 0.19
  * Support for Python 3.11
* Mon Aug 22 2022 Ben Greiner <code@bnavigator.de>
- Don't do mypy static type checking of the sources in order to
  avoid mypy in Ring1. The functionality of the binary rpm package
  is not affected by properly typed python sources.
- Remove obsolete setup.py sed fix
- Don't catchall sitearch files in %%files section
* Tue Jul 19 2022 Dirk Müller <dmueller@suse.com>
- update to 0.18:
  * Fix iteration when tree is 7 levels deep and has collissions
  * Test on python 3.10
  * consolidate mypy and pytest config into pyproject.toml
* Tue Feb 22 2022 Dirk Müller <dmueller@suse.com>
- update to 0.16:
  * Refactor typings
  * Update Python 3.10 support, drop Python 3.5
  * Fix test_none_collisions on 32-bit systems
  * Clarify the license of the included pythoncapi_compat.h header
  * Use cibuildwheel to build wheels
- drop skip_32bit_tests.patch, test_none_collisions-32-bit.patch (upstream)
* Thu Aug  5 2021 Matej Cepl <mcepl@suse.com>
- Upstream fixed problems with 32bit systems
  (gh#MagicStack/immutables#69) so we have removed
  skip_32bit_tests.patch and added new solution which actually fixes the
  issue: test_none_collisions-32-bit.patch.
* Thu Apr 22 2021 Dirk Müller <dmueller@suse.com>
- update to 0.15
  * python 3.9 support
* Mon Dec  7 2020 Matej Cepl <mcepl@suse.com>
- Add skip_32bit_tests.patch (gh#MagicStack/immutables#53) to skip tests
  which fail on 32bit architectures.
* Tue Oct 13 2020 Dirk Mueller <dmueller@suse.com>
- skip tests that fail on 32bit
* Wed Sep 16 2020 Dirk Mueller <dmueller@suse.com>
- update to 0.14:
  * python 3.8 support
  * Various improvements w.r.t. type annotations & typing
  * Fix pure-Python implementation to accept keyword argument
  * Fix the mutation API to maintain elements count correctly
  * Allow None to be used as key in pure-Python implementation.
- remove py38.patch (upstream)
* Mon Mar  9 2020 Tomáš Chvátal <tchvatal@suse.com>
- Update to 0.11:
  * Python 3.8 fixes
- Add one more py38 patch:
  * py38.patch
* Tue Sep 10 2019 Tomáš Chvátal <tchvatal@suse.com>
- Format with spec-cleaner
* Sun Apr 14 2019 John Vandenberg <jayvdb@gmail.com>
- Initial spec for v0.9