2018-05-24 20:56:47 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-radon
|
|
|
|
#
|
2019-01-29 09:51:29 +00:00
|
|
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
2018-05-24 20:56:47 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-12-04 13:58:29 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
2018-05-24 20:56:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
|
|
Name: python-radon
|
2019-02-14 08:35:01 +00:00
|
|
|
Version: 3.0.1
|
2018-05-24 20:56:47 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Code Metrics in Python
|
2018-12-04 13:58:29 +00:00
|
|
|
License: MIT
|
2018-05-24 20:56:47 +00:00
|
|
|
Group: Development/Languages/Python
|
2019-02-14 08:35:01 +00:00
|
|
|
URL: https://github.com/rubik/radon
|
2018-05-24 20:56:47 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/r/radon/radon-%{version}.tar.gz
|
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2019-02-14 08:35:01 +00:00
|
|
|
Requires: python-colorama >= 0.4
|
|
|
|
Requires: python-flake8-polyfill
|
|
|
|
Requires: python-mando >= 0.6
|
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
|
|
|
BuildArch: noarch
|
2018-05-24 20:56:47 +00:00
|
|
|
# SECTION test requirements
|
2019-02-14 08:35:01 +00:00
|
|
|
BuildRequires: %{python_module colorama >= 0.4}
|
2018-05-24 20:56:47 +00:00
|
|
|
BuildRequires: %{python_module flake8-polyfill}
|
|
|
|
BuildRequires: %{python_module mando >= 0.6}
|
|
|
|
BuildRequires: %{python_module pytest >= 2.7}
|
|
|
|
BuildRequires: %{python_module pytest-mock}
|
|
|
|
# /SECTION
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
Radon is a Python tool that computes various metrics from the source code.
|
|
|
|
Radon can compute:
|
|
|
|
|
|
|
|
* McCabe's complexity**, i.e. cyclomatic complexity
|
|
|
|
* raw metrics (these include SLOC, comment lines, blank lines, &c.)
|
|
|
|
* Halstead metrics (all of them)
|
|
|
|
* Maintainability Index (the one used in Visual Studio)
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n radon-%{version}
|
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
2019-02-14 08:35:01 +00:00
|
|
|
rm -r */lib/radon/tests
|
2018-05-24 20:56:47 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/radon
|
|
|
|
|
|
|
|
%check
|
2019-02-14 08:35:01 +00:00
|
|
|
%python_exec -m pytest --strict
|
2018-05-24 20:56:47 +00:00
|
|
|
|
|
|
|
%post
|
|
|
|
%python_install_alternative radon
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative radon
|
|
|
|
|
|
|
|
%files %{python_files}
|
|
|
|
%doc CHANGELOG README.rst
|
|
|
|
%license LICENSE
|
|
|
|
%python_alternative %{_bindir}/radon
|
|
|
|
%{python_sitelib}/*
|
|
|
|
|
|
|
|
%changelog
|