Blob Blame History Raw
# the tests requires internet access, with pip install being run
# so they are disabled for now, since koji block outgoing connexion
%global with_tests 0

Name: bandit
Version: 1.4.0
Release: 5%{?dist}
Summary: A framework for performing security analysis of Python source code
License: ASL 2.0
URL: https://wiki.openstack.org/wiki/Security/Projects/Bandit
Source0: https://files.pythonhosted.org/packages/source/b/%{name}/%{name}-%{version}.tar.gz
BuildArch: noarch
Requires: python3-PyYAML
Requires: python3-stevedore
Requires: python3-appdirs
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%if 0%{?with_tests}
BuildRequires: python3-pip
%endif
BuildRequires: python3-pbr

Patch0: bandit-1.4.0-2-setup.cfg.patch
Patch1: bandit-1.4.0-3-formatter-yaml.patch
Patch2: bandit-1.4.0-4-formatter-custom.patch
Patch3: bandit-1.4.0-5-pbr.patch

%description
Bandit provides a framework for performing security analysis of Python source
code, utilizing the ast module from the Python standard library.

The ast module is used to convert source code into a parsed tree of Python
syntax nodes. Bandit allows users to define custom tests that are performed
against those nodes. At the completion of testing, a report is generated
that lists security issues identified within the target source code.
%prep
%autosetup -p1

%build
%{__python3} setup.py build

%install
%{__python3} setup.py install --skip-build --root %{buildroot}

%check
%if 0%{?with_tests}
tox -epy27
%endif

%files
%doc AUTHORS ChangeLog README.rst
%doc doc
%doc examples
%license LICENSE
%{_bindir}/bandit
%{_bindir}/bandit-baseline
%{_bindir}/bandit-config-generator
%{python3_sitelib}/%{name}
%{python3_sitelib}/%{name}-%{version}-py%{python3_version}.egg-info

%changelog
* Mon Dec 04 2017 Marek Cermak <macermak@redhat.com> - 1.4.0-5
- fix pbr version issue
- version dependency of pbr lowered to pbr>=1.8

* Mon Nov 27 2017 Marek Cermak <macermak@redhat.com> - 1.4.0-4
- new formatter (custom)

* Mon Nov 27 2017 Marek Cermak <macermak@redhat.com> - 1.4.0-3
- new formatter (yaml)

* Mon Nov 27 2017 Marek Cermak <macermak@redhat.com> - 1.4.0-2
- reformat setup.cfg

* Tue Sep 19 2017 Marek Cermak <macermak@redhat.com> - 1.4.0-1
- new version 1.4.0

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 1.0.1-3
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Apr 21 2016 Michael Scherer <misc@zarb.org> - 1.0.1-1
- update to 1.0.1
- port to python3
- drop the /etc configuration directory, as upstream did remove config file

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Aug 20 2015 Michael Scherer <misc@zarb.org> 0.13.2-1
- new version 0.13.2
- add requires on python-stevedore, fix #1254589

* Sat Jul 11 2015 Michael Scherer <misc@zarb.org> 0.12.0-1
- new version 0.12.0

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Jun 10 2015 Michael Scherer <misc@zarb.org> 0.11.0-1
- new version 0.11.0

* Fri May 01 2015 Michael Scherer <misc@zarb.org> 0.10.1-1
- Initial package