#
# spec file for package python-sniffio
#
# Copyright (c) 2021 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-%{**}}
%define skip_python2 1
%define skip_python36 1
%define skip_python39 1
Name:           python-sniffio
Version:        1.2.0
Release:        4.4
Summary:        Module to sniff which async library code runs under
License:        MIT OR Apache-2.0
Group:          Development/Languages/Python
URL:            https://github.com/python-trio/sniffio
Source:         https://github.com/python-trio/sniffio/archive/v%{version}.tar.gz#/sniffio-%{version}.tar.gz
BuildRequires:  %{python_module contextvars >= 2.1 if %python-base < 3.7}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros >= 20210127.3a18043
%if 0%{?python_version_nodots} < 37
Requires:       python-contextvars >= 2.1
%endif
BuildArch:      noarch
# SECTION test requirements
BuildRequires:  %{python_module curio}
BuildRequires:  %{python_module pytest}
# /SECTION
%python_subpackages

%description
This is a package for detecting which async library code is running
under. It supports multiple async I/O packages, like Trio, and
asyncio.

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

%build
%python_build

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

%check
%pytest

%files %{python_files}
%doc README.rst
%license LICENSE LICENSE.APACHE2 LICENSE.MIT
%{python_sitelib}/*

%changelog
* Sun Jan 31 2021 Benjamin Greiner <code@bnavigator.de>
- Fix the contextvars requirement for python36
* Wed Dec  9 2020 Benjamin Greiner <code@bnavigator.de>
- Revert the python36 skip. python36-curio has been reenabled
* Fri Dec  4 2020 Benjamin Greiner <code@bnavigator.de>
- skip upcoming python36 flavor because there is no python36-curio
* Thu Nov 26 2020 Dirk Mueller <dmueller@suse.com>
- update to 1.2.0:
  * Include type hints
* Sun Jun  2 2019 Jan Engelhardt <jengelh@inai.de>
- Use noun phrase in descriptions. Trim filler wording from
  description.
* Tue May 14 2019 Tomáš Chvátal <tchvatal@suse.com>
- Really run tests
* Sat May 11 2019 Torsten Gruner <t.gruner@katodev.de>
- Initial release version 1.1.0