267c7f6
%global pypi_name pydeps
267c7f6
267c7f6
%global desc %{expand: \
267c7f6
Python module dependency visualization. This package installs the pydeps
267c7f6
command, and normal usage will be to use it from the command line.}
267c7f6
f162054
%bcond_without tests
7404965
%bcond_without docs
4be7812
477e440
%global forgeurl https://github.com/thebjorn/pydeps
477e440
267c7f6
Name:		%{pypi_name}
9c59ac0
Version:	1.12.17
43165a0
Release:	%autorelease
267c7f6
Summary:	Display module dependencies
df97ae6
License:	BSD-2-Clause
477e440
%forgemeta
477e440
URL:		%forgeurl
477e440
Source0:	%forgesource
267c7f6
BuildArch:	noarch
267c7f6
267c7f6
%{?python_enable_dependency_generator}
2aa8581
267c7f6
BuildRequires:	python3-devel
df97ae6
%if %{with tests}
477e440
BuildRequires:	python3-pytest
267c7f6
BuildRequires:	python3dist(pyyaml)
477e440
BuildRequires:	graphviz
df97ae6
%endif
7404965
%if %{with docs}
7404965
BuildRequires:	make
7404965
BuildRequires:	python3-sphinx
7404965
%endif
267c7f6
4be7812
%description
4be7812
%{desc}
4be7812
267c7f6
%prep
9ce1a7e
%autosetup -p1 -n %{pypi_name}-%{version}
9ce1a7e
477e440
477e440
%generate_buildrequires
477e440
%pyproject_buildrequires
267c7f6
267c7f6
%build
477e440
%pyproject_wheel
7404965
# Generate man pages and docs
7404965
pushd docs
7404965
make %{?_smp_mflags} man html
7404965
popd
267c7f6
267c7f6
%install
477e440
%pyproject_install
477e440
%pyproject_save_files %{pypi_name}
267c7f6
7404965
# Install man page and html docs
7404965
mkdir -p %{buildroot}/%{_mandir}/man1
7404965
cp -a docs/_build/man/*.1 %{buildroot}/%{_mandir}/man1
7404965
rm docs/_build/html/.buildinfo
7404965
df97ae6
df97ae6
%check
df97ae6
%pyproject_check_import
df97ae6
%if %{with tests}
df97ae6
  # Exclude failing tests:
df97ae6
  # https://github.com/thebjorn/pydeps/issues/71
df97ae6
  %pytest -k "not (test_file or test_relative_imports_same_name_with_std \
df97ae6
  or test_pydeps_colors or test_find_package_names)"
df97ae6
%endif
267c7f6
477e440
%files -n %{pypi_name} -f %{pyproject_files}
267c7f6
%doc README.rst
267c7f6
%{_bindir}/pydeps
7404965
%if %{with docs}
7404965
%{_mandir}/man1/%{pypi_name}.1*
7404965
%doc docs/_build/html
7404965
%endif
267c7f6
267c7f6
%changelog
43165a0
%autochangelog