Blob Blame History Raw
%global srcname  git-url-parse
%global pkgname  python-git-url-parse
%global slugname giturlparse
%global forgeurl

%global common_description %{expand:
A simple GIT URL parser similar to

%bcond_without doc
%bcond_without tests

Name:           %{pkgname}
Version:        1.2.2
Release:        %autorelease
Summary:        A simple GIT URL parser similar to
License:        MIT
URL:            %{forgeurl}
Source:         %{forgesource}
Patch:          0001_remove_pytest_coverage.patch
BuildArch:      noarch

BuildRequires: make
BuildRequires: python3-devel
BuildRequires: pyproject-rpm-macros

%if %{with doc}
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(alabaster)

%if %{with tests}
BuildRequires: python3dist(pytest)

%description %{common_description}

%package -n python-%{srcname}-doc
Summary: %summary

%description -n python-%{srcname}-doc
Documentation for python-git-url-parse

%package -n python3-%{srcname}
Summary: %summary

%description -n python3-%{srcname} %{common_description}

%forgeautosetup -p1

%pyproject_buildrequires -r

%if %{with doc}
cd doc
PYTHONPATH=.. make html
rm -rf build/html/.{doctrees,buildinfo}

%pyproject_save_files %{slugname}

%if %{with tests}
PYTHONWARNINGS=ignore %pytest -vv test

%files -n python3-%{srcname} -f %{pyproject_files}
%license LICENSE
%doc README.rst

%files -n python-%{srcname}-doc
%license LICENSE
%doc *.rst
%doc doc/build/html