c867cb7
%global srcname cppy
c867cb7
c867cb7
Name:           python-%{srcname}
b7a6e0a
Version:        1.2.1
fe97cb7
Release:        %autorelease
c867cb7
Summary:        C++ headers for C extension development
c867cb7
a50db3c
License:        BSD-3-Clause
c867cb7
URL:            https://github.com/nucleic/cppy
949b3e5
Source0:        %pypi_source
949b3e5
c867cb7
BuildArch:      noarch
c867cb7
c867cb7
BuildRequires:  python3-devel
c867cb7
BuildRequires:  python3dist(pytest)
c867cb7
c867cb7
%description
c867cb7
A small C++ header library which makes it easier to write Python extension
c867cb7
modules. The primary feature is a PyObject smart pointer which automatically
c867cb7
handles reference counting and provides convenience methods for performing
c867cb7
common object operations.
c867cb7
c867cb7
c867cb7
%package -n     python3-%{srcname}
c867cb7
Summary:        %{summary}
c867cb7
c867cb7
%description -n python3-%{srcname}
c867cb7
A small C++ header library which makes it easier to write Python extension
c867cb7
modules. The primary feature is a PyObject smart pointer which automatically
c867cb7
handles reference counting and provides convenience methods for performing
c867cb7
common object operations.
c867cb7
c867cb7
c867cb7
%package -n python-%{srcname}-doc
c867cb7
Summary:        cppy documentation
c867cb7
c867cb7
BuildRequires:  python3dist(sphinx)
c867cb7
BuildRequires:  python3dist(sphinx-rtd-theme)
c867cb7
c867cb7
%description -n python-%{srcname}-doc
c867cb7
Documentation for cppy
c867cb7
c867cb7
c867cb7
%prep
c867cb7
%autosetup -n %{srcname}-%{version}
c867cb7
0e118df
%generate_buildrequires
0e118df
%pyproject_buildrequires
c867cb7
c867cb7
%build
0e118df
%pyproject_wheel
c867cb7
c867cb7
# generate html docs
0e118df
PYTHONPATH="%{pyproject_build_lib}" sphinx-build-3 docs/source html
c867cb7
# remove the sphinx-build leftovers
c867cb7
rm -rf html/.{doctrees,buildinfo}
c867cb7
c867cb7
%install
0e118df
%pyproject_install
0e118df
%pyproject_save_files %{srcname}
c867cb7
c867cb7
%check
0e118df
%{pytest} tests
c867cb7
0e118df
%files -n python3-%{srcname} -f %{pyproject_files}
c867cb7
%doc README.rst
c867cb7
c867cb7
%files -n python-%{srcname}-doc
c867cb7
%doc html
c867cb7
%license LICENSE
c867cb7
c867cb7
%changelog
fe97cb7
%autochangelog