File python-safety.spec of Package python-safety

#
# spec file for package python-safety
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# Test requires network connection
%bcond_with     test
Name:           python-safety
Version:        1.7.0
Release:        0
License:        MIT
Summary:        Checks dependencies for known security vulnerabilities
Url:            https://github.com/pyupio/safety
Group:          Development/Languages/Python
Source:         https://files.pythonhosted.org/packages/source/s/safety/safety-%{version}.tar.gz
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
%if %{with test}
BuildRequires:  %{python_module click >= 6.0}
BuildRequires:  %{python_module dparse >= 0.2.1}
BuildRequires:  %{python_module packaging}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module requests}
%endif
Requires:       python-click >= 6.0
Requires:       python-dparse >= 0.2.1
Requires:       python-packaging
Requires:       python-pip
Requires:       python-requests
BuildArch:      noarch

%python_subpackages

%description
Safety checks your installed dependencies for known security vulnerabilities. 

%prep
%setup -q -n safety-%{version}

%build
%python_build

%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%if %{with test}
%check
%python_expand $python -m unittest discover
%endif

%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE README.md
%python3_only %{_bindir}/safety
%{python_sitelib}/*

%changelog
openSUSE Build Service is sponsored by