Blob Blame History Raw
%global pypi_name pydeps

%global desc %{expand: \
Python module dependency visualization. This package installs the pydeps
command, and normal usage will be to use it from the command line.}

%bcond_without tests
%bcond_without docs

%global forgeurl

Name:		%{pypi_name}
Version:	1.12.17
Release:	%autorelease
Summary:	Display module dependencies
License:	BSD-2-Clause
URL:		%forgeurl
Source0:	%forgesource
BuildArch:	noarch


BuildRequires:	python3-devel
%if %{with tests}
BuildRequires:	python3-pytest
BuildRequires:	python3dist(pyyaml)
BuildRequires:	graphviz
%if %{with docs}
BuildRequires:	make
BuildRequires:	python3-sphinx


%autosetup -p1 -n %{pypi_name}-%{version}


# Generate man pages and docs
pushd docs
make %{?_smp_mflags} man html

%pyproject_save_files %{pypi_name}

# Install man page and html docs
mkdir -p %{buildroot}/%{_mandir}/man1
cp -a docs/_build/man/*.1 %{buildroot}/%{_mandir}/man1
rm docs/_build/html/.buildinfo

%if %{with tests}
  # Exclude failing tests:
  %pytest -k "not (test_file or test_relative_imports_same_name_with_std \
  or test_pydeps_colors or test_find_package_names)"

%files -n %{pypi_name} -f %{pyproject_files}
%doc README.rst
%if %{with docs}
%doc docs/_build/html