Blame SPECS/python-vine.spec

c59d5a
%global pypi_name vine
c59d5a
c59d5a
# Enable tests by default
c59d5a
%bcond_without tests
c59d5a
c59d5a
# docs depend on package sphinx_celery
c59d5a
# https://github.com/celery/sphinx_celery
c59d5a
%bcond_with docs
c59d5a
c59d5a
Name:           python-%{pypi_name}
c59d5a
Version:        5.1.0
c59d5a
Release:        10%{?dist}
c59d5a
Summary:        Promises, promises, promises
c59d5a
c59d5a
# Automatically converted from old format: BSD - review is highly recommended.
c59d5a
License:        LicenseRef-Callaway-BSD
c59d5a
URL:            http://github.com/celery/vine
c59d5a
Source0:        https://files.pythonhosted.org/packages/source/v/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
c59d5a
BuildArch:      noarch
c59d5a
c59d5a
%if %{with docs}
c59d5a
BuildRequires:  python3-sphinx
c59d5a
%endif
c59d5a
c59d5a
c59d5a
%description
c59d5a
%{summary}
c59d5a
c59d5a
c59d5a
%package -n     python3-%{pypi_name}
c59d5a
Summary:        Promises, promises, promises
c59d5a
c59d5a
BuildRequires:  python3-devel
c59d5a
BuildRequires:  python3-setuptools
c59d5a
%if %{with tests}
c59d5a
BuildRequires:  python3-pytest
c59d5a
BuildRequires:  python3-pytest-cov
c59d5a
%endif
c59d5a
c59d5a
c59d5a
%description -n python3-%{pypi_name}
c59d5a
%{summary}
c59d5a
c59d5a
%if %{with docs}
c59d5a
%package -n python-%{pypi_name}-doc
c59d5a
Summary:        vine documentation
c59d5a
%description -n python-%{pypi_name}-doc
c59d5a
Documentation for vine
c59d5a
%endif
c59d5a
c59d5a
%prep
c59d5a
%autosetup -n %{pypi_name}-%{version}
c59d5a
# Remove bundled egg-info
c59d5a
rm -rf %{pypi_name}.egg-info
c59d5a
c59d5a
# Compatibility with pytest 8
c59d5a
# https://github.com/celery/vine/commit/cf9b3979173ff22a4a410c4da6cfdad878eced8c
c59d5a
sed -i "/def setup(self)/s/setup/setup_method/" t/unit/test_synchronization.py
c59d5a
c59d5a
%build
c59d5a
%py3_build
c59d5a
c59d5a
# docs depend on sphinx-celery
c59d5a
%if %{with docs}
c59d5a
# generate html docs
c59d5a
c59d5a
sphinx-build docs html
c59d5a
# remove the sphinx-build leftovers
c59d5a
rm -rf html/.{doctrees,buildinfo}
c59d5a
%endif
c59d5a
c59d5a
%install
c59d5a
%py3_install
c59d5a
c59d5a
c59d5a
%if %{with tests}
c59d5a
%check
c59d5a
%pytest -xv --cov=vine --cov-report=xml --no-cov-on-fail
c59d5a
%endif
c59d5a
c59d5a
%files -n python3-%{pypi_name}
c59d5a
%license LICENSE
c59d5a
%doc docs/templates/readme.txt README.rst
c59d5a
%{python3_sitelib}/%{pypi_name}
c59d5a
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
c59d5a
c59d5a
%if %{with docs}
c59d5a
%files -n python-%{pypi_name}-doc
c59d5a
%doc html
c59d5a
%endif
c59d5a
c59d5a
%changelog