15
0
Files
python-MechanicalSoup/python-MechanicalSoup.spec

83 lines
2.6 KiB
RPMSpec

#
# spec file for package python-MechanicalSoup
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# Tests require network connection
%bcond_with test
Name: python-MechanicalSoup
Version: 0.10.0
Release: 0
Summary: A Python library for automating interaction with websites
License: MIT
Group: Development/Languages/Python
Url: https://github.com/hickford/MechanicalSoup
Source: https://files.pythonhosted.org/packages/source/M/MechanicalSoup/MechanicalSoup-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pytest-runner}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module beautifulsoup4}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests >= 2.0}
BuildRequires: %{python_module requests-mock}
BuildRequires: %{python_module six >= 1.4}
%endif
Requires: python-beautifulsoup4
Requires: python-requests >= 2.0
Requires: python-six >= 1.4
BuildArch: noarch
%python_subpackages
%description
A Python library for automating interaction with websites.
MechanicalSoup automatically stores and sends cookies,
follows redirects, and can follow links and submit forms.
It doesn't do Javascript.
The Mechanize library is incompatible with Python 3 and development
is inactive. MechanicalSoup provides a similar API to it, built on
Python giants Requests (for http sessions) and BeautifulSoup (for
document navigation).
%prep
%setup -q -n MechanicalSoup-%{version}
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with test}
%check
%python_exec setup.py test
%endif
%files %{python_files}
%defattr(-,root,root,-)
%doc README.rst
%license LICENSE
%{python_sitelib}/*
%changelog