python-sybil/python-sybil.spec

83 lines
2.8 KiB
RPMSpec

#
# spec file for package python-sybil
#
# 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-%{**}}
Name: python-sybil
Version: 1.0.8
Release: 0
Summary: Automated testing for the examples in your documentation
License: MIT
Group: Development/Languages/Python
Url: https://github.com/cjw296/sybil
Source: https://files.pythonhosted.org/packages/source/s/sybil/sybil-%{version}.tar.gz
BuildRequires: %{python_module Sphinx}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module nose}
BuildRequires: %{python_module pkginfo}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module python-coveralls}
BuildRequires: %{python_module setuptools-git}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module twine}
BuildRequires: %{python_module virtualenv}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Suggests: python-python-coveralls
Suggests: python-nose
Suggests: python-pytest
Suggests: python-sphinx
Suggests: python-pkginfo
Suggests: python-setuptools-git
Suggests: python-twine
Suggests: python-wheel
BuildArch: noarch
%python_subpackages
%description
python-sybil provides a way to test examples in your documentation by parsing
them from the documentation source and evaluating the parsed examples as part
of your normal test run. Integration is provided for the three main Python
test runners.
%prep
%setup -q -n sybil-%{version}
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
sed -i -e "s/'coveralls'/'python-coveralls'/" setup.py
%{python_expand virtualenv-%$python_bin_suffix --system-site-packages --no-download testvenv-%$python_bin_suffix
testvenv-%$python_bin_suffix/bin/pip install -e .[test,build]
export PYTHONPATH=$PWD/testvenv-%$python_bin_suffix/lib/python%$python_bin_suffix/site-packages/:$PWD
testvenv-%$python_bin_suffix/bin/python -m pytest && rm -Rf testvenv-%$python_bin_suffix
}
%files %{python_files}
%doc README.rst docs/changes.rst
%license docs/license.rst
%{python_sitelib}/*
%changelog