Blob Blame History Raw
# Created by pyp2rpm-3.3.2
%global pypi_name jaraco-classes
# waiting on jaraco-packaging and rst-linker to build docs
%bcond_with doc

Name:           python-%{pypi_name}
Version:        2.0
Release:        1%{?dist}
Summary:        Utility functions for Python class constructs

License:        MIT
URL:            https://github.com/jaraco/jaraco.classes
Source0:        %{pypi_source jaraco.classes}
BuildArch:      noarch
 
%description
Utility functions for Python class constructs.

%package -n python3-%{pypi_name}
Summary:        %{summary}
Requires:       python3-jaraco
Requires:       python3dist(six)

BuildConflicts: python3dist(pytest) = 3.7.3
BuildRequires:  python3-devel
BuildRequires:  python3dist(pytest) >= 3.5
BuildRequires:  python3dist(pytest-flake8)
BuildRequires:  python3dist(setuptools)
BuildRequires:  python3dist(setuptools-scm) >= 1.15.0

%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}
Utility functions for Python class constructs.

%if %{with docs}
%package -n python-%{pypi_name}-doc
Summary:        jaraco-classes documentation

BuildRequires:  python3dist(pytest-checkdocs)
BuildRequires:  python3dist(sphinx)
BuildRequires:  python3dist(jaraco-packaging) >= 3.2
BuildRequires:  python3dist(rst-linker) >= 1.9

%description -n python-%{pypi_name}-doc
Documentation for jaraco-classes
%endif

%prep
%autosetup -n jaraco.classes-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info

%build
%py3_build
%if %{with docs}
# generate html docs 
PYTHONPATH=${PWD} sphinx-build-3 docs html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
%endif

%install
%py3_install

%check
# disabled for right now, need a newer version of pytest-flake8
# https://src.fedoraproject.org/rpms/python-pytest-flake8/pull-request/2
# AttributeError: 'Application' object has no attribute 'make_notifier'
# LANG=C.utf-8 %%{__python3} -m pytest --ignore=build

%files -n python3-%{pypi_name}
%license LICENSE
%doc README.rst
# These excludes are provided by python3-jaraco
%exclude %{python3_sitelib}/jaraco/__init__*
%exclude %{python3_sitelib}/jaraco/__pycache__/__init__*
%{python3_sitelib}/jaraco
%{python3_sitelib}/jaraco.classes-%{version}-py?.?.egg-info

%if %{with docs}
%files -n python-%{pypi_name}-doc
%doc html
%license LICENSE
%endif

%changelog
* Tue Apr 02 2019 Dan Radez <dradez@redhat.com> - 2.0-1
- Initial package.