15
0
forked from pool/python-bandit
Files
python-bandit/python-bandit.spec
Dirk Mueller 390eb17e92 Accepting request 962061 from home:pgajdos:python
- version update to 1.7.4
  1.7.4
  -----
  * Add 1.7.4 in issue template (#846)
  * core/config: Fix ConfigError missing argument if toml is missing (#845)
  * Add version 1.7.3 to dropdown (#833)
  * Fix traceback in hashlib\_insecure\_functions (#834)
  1.7.3
  -----
  * Build of artifact fails if raw directive used (#831)
  * Center the bandit logo in readme (#823)
  * Target Python >= 3.7 in pre-commit hooks (#830)
  * Inaccurate message in hashlib check (#827)
  * Improve performance of linerange (#629)
  * Use CWE link in HTML formatter (#825)
  * Use versioned links to docs (#819)
  * Fix root doc for readthedocs (#818)
  * Fix up some warnings and errors in docs (#817)
  * Test on operating systems we can support (#804)
  * Cannot seek stdin on pipe (#496)
  * Respect color environment variables if set (#813)
  * Show usage with no arguments (#814)
  * Cleanup the README
  * Fix references to the default branch name (#810)
  * Better hashlib check for Python 3.9 (#805)
  * Check for hardcoded passwords in class attributes (#766)
  *  Add new plugin to check use of pyghmi (#803)
  * Remove redundant Python 3.6 code (#802)
  * Check value of usedforsecurity for hashlib (#798)
  * Change up how CWE is formatted (#788)

OBS-URL: https://build.opensuse.org/request/show/962061
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bandit?expand=0&rev=21
2022-03-16 07:35:58 +00:00

124 lines
3.7 KiB
RPMSpec

#
# spec file for package python-bandit
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
# CLI tool, no module
%define pythons python3
%bcond_without builddocs
Name: python-bandit
Version: 1.7.4
Release: 0
Summary: Security oriented static analyser for Python code
License: Apache-2.0
URL: https://github.com/PyCQA/bandit
Source: https://files.pythonhosted.org/packages/source/b/bandit/bandit-%{version}.tar.gz
Patch0: remove-non-test-deps.patch
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-GitPython >= 1.0.1
Requires: python-PyYAML >= 5.3.1
Requires: python-six >= 1.10.0
Requires: python-stestr >= 1.0.0
Requires: python-stevedore >= 1.20.0
Requires: python-toml
Requires(post): update-alternatives
Requires(postun):update-alternatives
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module GitPython >= 1.0.1}
BuildRequires: %{python_module PyYAML >= 5.3.1}
BuildRequires: %{python_module bandit == %{version}}
BuildRequires: %{python_module beautifulsoup4 >= 4.8.0}
BuildRequires: %{python_module fixtures >= 3.0.0}
BuildRequires: %{python_module pbr >= 2.0}
BuildRequires: %{python_module python-subunit >= 0.0.18}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six >= 1.10.0}
BuildRequires: %{python_module stestr >= 2.5.0}
BuildRequires: %{python_module stevedore >= 1.20.0}
BuildRequires: %{python_module testrepository >= 0.0.18}
BuildRequires: %{python_module testscenarios >= 0.5.0}
BuildRequires: %{python_module testtools >= 2.3.0}
%endif
# doc requirements
%if %{with builddocs}
BuildRequires: %{python_module Sphinx >= 1.2.1}
BuildRequires: %{python_module reno >= 1.8.0}
%endif
%python_subpackages
%description
Bandit is a tool designed to find common security issues in Python code. To do
this Bandit processes each file, builds an AST from it, and runs appropriate
plugins against the AST nodes. Once Bandit has finished scanning all the files
it generates a report.
%prep
%setup -q -n bandit-%{version}
%patch0 -p1
sed -i '/^#!/d' bandit/__main__.py
%if !%{with test}
%build
%python_build
%endif
%if !%{with test}
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/bandit
%python_clone -a %{buildroot}%{_bindir}/bandit-config-generator
%python_clone -a %{buildroot}%{_bindir}/bandit-baseline
%endif
%if %{with test}
%check
%pyunittest discover -v
%endif
%if !%{with test}
%post
%{python_install_alternative bandit bandit-config-generator bandit-baseline }
%endif
%if !%{with test}
%postun
%python_uninstall_alternative bandit
%endif
%if !%{with test}
%files %{python_files}
%license LICENSE
%doc AUTHORS ChangeLog README.rst
%python_alternative %{_bindir}/bandit
%python_alternative %{_bindir}/bandit-config-generator
%python_alternative %{_bindir}/bandit-baseline
%{python_sitelib}/*
%endif
%changelog