8ae63ab
%global pypi_name vine
8ae63ab
7a9e760
# Enable tests by default
7a9e760
%bcond_without tests
679a92c
8ae63ab
# docs depend on package sphinx_celery
8ae63ab
# https://github.com/celery/sphinx_celery
679a92c
%bcond_with docs
8ae63ab
8ae63ab
Name:           python-%{pypi_name}
b6aa9a1
Version:        5.1.0
6b90a71
Release:        %autorelease
8ae63ab
Summary:        Promises, promises, promises
8ae63ab
8ae63ab
License:        BSD
8ae63ab
URL:            http://github.com/celery/vine
8ae63ab
Source0:        https://files.pythonhosted.org/packages/source/v/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
8ae63ab
BuildArch:      noarch
8ae63ab
679a92c
%if %{with docs}
9b2687b
BuildRequires:  python3-sphinx
679a92c
%endif
679a92c
8ae63ab
8ae63ab
%description
8ae63ab
%{summary}
8ae63ab
8ae63ab
8ae63ab
%package -n     python3-%{pypi_name}
8ae63ab
Summary:        Promises, promises, promises
8ae63ab
792ec19
BuildRequires:  python3-devel
792ec19
BuildRequires:  python3-setuptools
679a92c
%if %{with tests}
792ec19
BuildRequires:  python3-pytest
792ec19
BuildRequires:  python3-pytest-cov
792ec19
BuildRequires:  python3-case
792ec19
%endif
792ec19
792ec19
8ae63ab
%description -n python3-%{pypi_name}
8ae63ab
%{summary}
8ae63ab
679a92c
%if %{with docs}
8ae63ab
%package -n python-%{pypi_name}-doc
8ae63ab
Summary:        vine documentation
8ae63ab
%description -n python-%{pypi_name}-doc
8ae63ab
Documentation for vine
8ae63ab
%endif
8ae63ab
8ae63ab
%prep
8ae63ab
%autosetup -n %{pypi_name}-%{version}
8ae63ab
# Remove bundled egg-info
8ae63ab
rm -rf %{pypi_name}.egg-info
8ae63ab
457428c
# Compatibility with pytest 8
457428c
# https://github.com/celery/vine/commit/cf9b3979173ff22a4a410c4da6cfdad878eced8c
457428c
sed -i "/def setup(self)/s/setup/setup_method/" t/unit/test_synchronization.py
457428c
8ae63ab
%build
8ae63ab
%py3_build
8ae63ab
8ae63ab
# docs depend on sphinx-celery
679a92c
%if %{with docs}
8ae63ab
# generate html docs
8ae63ab
8ae63ab
sphinx-build docs html
8ae63ab
# remove the sphinx-build leftovers
8ae63ab
rm -rf html/.{doctrees,buildinfo}
8ae63ab
%endif
8ae63ab
8ae63ab
%install
8ae63ab
%py3_install
8ae63ab
8ae63ab
679a92c
%if %{with tests}
8ae63ab
%check
b6aa9a1
%pytest -xv --cov=vine --cov-report=xml --no-cov-on-fail
8ae63ab
%endif
8ae63ab
8ae63ab
%files -n python3-%{pypi_name}
8ae63ab
%license LICENSE
8ae63ab
%doc docs/templates/readme.txt README.rst
8ae63ab
%{python3_sitelib}/%{pypi_name}
9abd75d
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
8ae63ab
679a92c
%if %{with docs}
8ae63ab
%files -n python-%{pypi_name}-doc
8ae63ab
%doc html
8ae63ab
%endif
8ae63ab
8ae63ab
%changelog
6b90a71
%autochangelog