python-mocket/python-mocket.spec
Sebastian Wagner a496061060 - update to version 3.9.39:
- Use MocketSocket as context manager (#141)
  * Adding support for using a `socket` as a context manager as requested by #139.
  * Closing real socket.
  * Bump version.
- update to version 3.9.38:
 - Update __init__.py
- update to version 3.9.37:
 - Fix for external decorators (#138)
- update to version 3.9.36:
 - New mocket method for checking if all entries have been served (#137)
 * Mocket method for checking if all entries have been served at least once.
 - Yet another refactor (#135)
 - Refactor. (#136)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mocket?expand=0&rev=24
2021-01-15 17:01:33 +00:00

121 lines
3.6 KiB
RPMSpec

#
# spec file for package python-mocket
#
# 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-%{**}}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name: python-mocket%{psuffix}
Version: 3.9.39
Release: 0
Summary: Python socket mock framework
License: BSD-3-Clause
URL: https://github.com/mindflayer/python-mocket
Source0: https://files.pythonhosted.org/packages/source/m/mocket/mocket-%{version}.tar.gz
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-decorator
Requires: python-http-parser >= 0.9.0
Requires: python-python-magic
Requires: python-six
Requires: python-urllib3
Suggests: python-gevent
Suggests: python-pook >= 0.2.1
Suggests: python-redis
Suggests: python-requests
Suggests: python-xxhash
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module PySocks}
BuildRequires: %{python_module cryptography}
BuildRequires: %{python_module decorator}
BuildRequires: %{python_module gevent}
BuildRequires: %{python_module http-parser >= 0.9.0}
BuildRequires: %{python_module mock}
%if 0%{suse_version} >= 1550
# Optional pook is only available for Python 3, but in TW we will have more than one flavor
BuildRequires: %{python_module pook}
%else
BuildRequires: python3-pook
%endif
BuildRequires: %{python_module pyOpenSSL}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module python-magic}
BuildRequires: %{python_module redis}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module six}
BuildRequires: %{python_module sure}
BuildRequires: %{python_module urllib3}
BuildRequires: %{python_module xxhash}
BuildRequires: ca-certificates-mozilla
BuildRequires: python3-aiohttp
BuildRequires: python3-async_timeout
%endif
%python_subpackages
%description
Socket Mock Framework - for all kinds of socket animals, web-clients
included, with gevent/asyncio/SSL support.
%prep
%setup -q -n mocket-%{version}
sed -i '/cov/ d' setup.cfg
sed -i '/pipenv/ d' setup.py
sed -i 's/==.*$//' requirements.txt
%build
%if !%{with test}
export LANG=en_US.UTF-8
%python_build
%endif
%install
%if !%{with test}
export LANG=en_US.UTF-8
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check
%if %{with test}
export LANG=en_US.UTF-8
export SKIP_TRUE_HTTP=1
pytest_python2_ignore="--ignore tests/tests35 --ignore tests/tests38 --ignore tests/main/test_pook.py"
pytest_python36_ignore="--ignore tests/tests38"
%if %{python3_version_nodots} < 38
pytest_python3_ignore="--ignore tests/tests38"
%endif
%pytest -k 'not RedisTestCase' ${pytest_$python_ignore}
%endif
%if !%{with test}
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/mocket
%{python_sitelib}/mocket-%{version}-py*.egg-info
%endif
%changelog