14
0
forked from pool/python-bandit
Files
python-bandit/python-bandit.spec

152 lines
4.6 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package python-bandit
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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/
#
%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
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%bcond_without builddocs
%{?sle15_python_module_pythons}
Name: python-bandit
Version: 1.8.6
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: %{python_module pbr >= 2.0}
Accepting request 1222690 from home:glaubitz:branches:devel:languages:python - Update to 1.7.10 * Bump docker/build-push-action from 5.4.0 to 6.0.0 * Suggested small refactors in assignments * Performance improvement in blacklist function * Add test for usage of FTP_TLS * New check: B113: TrojanSource - Bidirectional control characters * Bump docker/build-push-action from 6.0.0 to 6.1.0 * feat(plugins): add support for httpx in B113 * Nit: remove unused variable * Add recent releases to version choice in bug report * Bump docker/build-push-action from 6.1.0 to 6.2.0 * Bump docker/build-push-action from 6.2.0 to 6.3.0 * Bump docker/setup-buildx-action from 3.3.0 to 3.4.0 * Bump docker/setup-buildx-action from 3.4.0 to 3.5.0 * Bump docker/login-action from 3.2.0 to 3.3.0 * Bump docker/build-push-action from 6.3.0 to 6.5.0 * Bump docker/setup-buildx-action from 3.5.0 to 3.6.1 * Bump docker/build-push-action from 6.5.0 to 6.6.1 * Bump sigstore/cosign-installer from 3.5.0 to 3.6.0 * Bump docker/build-push-action from 6.6.1 to 6.7.0 * Use consistent file naming of docs * Pytorch Load / Save Plugin - from version 1.7.9 * Bump docker/build-push-action from 5.1.0 to 5.2.0 * [pre-commit.ci] pre-commit autoupdate * New logo for Bandit based on raccoon * Start testing on Python 3.13 * Bump docker/build-push-action from 5.2.0 to 5.3.0 * Bump docker/setup-buildx-action from 3.1.0 to 3.2.0 * Bump docker/login-action from 3.0.0 to 3.1.0 OBS-URL: https://build.opensuse.org/request/show/1222690 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bandit?expand=0&rev=31
2024-11-12 01:12:53 +00:00
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
Accepting request 1222690 from home:glaubitz:branches:devel:languages:python - Update to 1.7.10 * Bump docker/build-push-action from 5.4.0 to 6.0.0 * Suggested small refactors in assignments * Performance improvement in blacklist function * Add test for usage of FTP_TLS * New check: B113: TrojanSource - Bidirectional control characters * Bump docker/build-push-action from 6.0.0 to 6.1.0 * feat(plugins): add support for httpx in B113 * Nit: remove unused variable * Add recent releases to version choice in bug report * Bump docker/build-push-action from 6.1.0 to 6.2.0 * Bump docker/build-push-action from 6.2.0 to 6.3.0 * Bump docker/setup-buildx-action from 3.3.0 to 3.4.0 * Bump docker/setup-buildx-action from 3.4.0 to 3.5.0 * Bump docker/login-action from 3.2.0 to 3.3.0 * Bump docker/build-push-action from 6.3.0 to 6.5.0 * Bump docker/setup-buildx-action from 3.5.0 to 3.6.1 * Bump docker/build-push-action from 6.5.0 to 6.6.1 * Bump sigstore/cosign-installer from 3.5.0 to 3.6.0 * Bump docker/build-push-action from 6.6.1 to 6.7.0 * Use consistent file naming of docs * Pytorch Load / Save Plugin - from version 1.7.9 * Bump docker/build-push-action from 5.1.0 to 5.2.0 * [pre-commit.ci] pre-commit autoupdate * New logo for Bandit based on raccoon * Start testing on Python 3.13 * Bump docker/build-push-action from 5.2.0 to 5.3.0 * Bump docker/setup-buildx-action from 3.1.0 to 3.2.0 * Bump docker/login-action from 3.0.0 to 3.1.0 OBS-URL: https://build.opensuse.org/request/show/1222690 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bandit?expand=0&rev=31
2024-11-12 01:12:53 +00:00
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-GitPython >= 1.0.1
Requires: python-PyYAML >= 5.3.1
Requires: python-jschema-to-python >= 1.2.3
Requires: python-rich
Requires: python-sarif-om
Requires: python-stestr >= 1.0.0
Requires: python-stevedore >= 1.20.0
Requires: (python-tomli >= 1.2.3 if python-base < 3.11)
BuildArch: noarch
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
%if %{python_version_nodots} < 311
Requires: python-tomli
%endif
%if %{with test}
BuildRequires: %{python_module GitPython >= 1.0.1}
- Update to 1.7.0: * Remove blacklist call to input() (#662) @ericwb * Remove universal support on the wheel (#655) @ericwb * Give some tips on how to resolve B101 in the doc (#616) @xuhdev * Don't show progress information on --quiet (#641) @fniessink * Add skip configuration to assert_used (#633) @wilbertom * Drop Python2 build, test, and install (#615) @ericwb * [FIX] blacklist: fix typo in import_ftplib (#601) @Yenthe666 * Resolve 'NoneType' object has no attribute 'id'Traceback in django_mark_safe (#598) @ehooo * Fix typo for activating venv (#590) @bavedarnow * Bump pyyaml (#588) @dosisod * Fix colorama not being disabled after being used (#586) @adambenali * Cleanup some typos in recent contributor guide (#585) @ericwb * [DOC] Support python3 venv creation (#583) @look4regev * Add sha1 to the list of insecure hashes (#561) @ericwb * Fix docs for B610,B611,B703 (#555) @amacfie * Add a section explaining "nosec" (#554) @exhuma * Add official support of Python 3.8 (#547) @ericwb * Ignore common directories by default (#544) @ericwb * Add shelve to the pickle blacklists (#542) @auscompgeek * Remove obsolete "sudo" keyword. (#538) @jugmac00 * Update test requirements to latest versions (#535) @ericwb * Fix readme file on Extending Bandit on list things (#534) @Aurel10 * fix the documentation file README.rst (#533) @Aurel10 * Cleanup comments after #510 (#532) @florczakraf * Use SPDX license identifier instead of bulky headers (#530) @ericwb * fix B603 docstring (#524) @graingert * Add type checking to name node of hashlib_new (#516) @teeann * --exit-zero option (#510) @maciejstromich * Fix 3.8 errors (#509) @tylerwince * Add several ini options for .bandit file (#508) @vuolter * get_url returns different urls calling twice (bug #506) (#507) @ehooo * Replace setattr (#493) @tylerwince - Refresh remove-non-test-deps.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bandit?expand=0&rev=16
2021-03-09 06:57:46 +00:00
BuildRequires: %{python_module PyYAML >= 5.3.1}
BuildRequires: %{python_module bandit == %{version}}
- Update to 1.7.0: * Remove blacklist call to input() (#662) @ericwb * Remove universal support on the wheel (#655) @ericwb * Give some tips on how to resolve B101 in the doc (#616) @xuhdev * Don't show progress information on --quiet (#641) @fniessink * Add skip configuration to assert_used (#633) @wilbertom * Drop Python2 build, test, and install (#615) @ericwb * [FIX] blacklist: fix typo in import_ftplib (#601) @Yenthe666 * Resolve 'NoneType' object has no attribute 'id'Traceback in django_mark_safe (#598) @ehooo * Fix typo for activating venv (#590) @bavedarnow * Bump pyyaml (#588) @dosisod * Fix colorama not being disabled after being used (#586) @adambenali * Cleanup some typos in recent contributor guide (#585) @ericwb * [DOC] Support python3 venv creation (#583) @look4regev * Add sha1 to the list of insecure hashes (#561) @ericwb * Fix docs for B610,B611,B703 (#555) @amacfie * Add a section explaining "nosec" (#554) @exhuma * Add official support of Python 3.8 (#547) @ericwb * Ignore common directories by default (#544) @ericwb * Add shelve to the pickle blacklists (#542) @auscompgeek * Remove obsolete "sudo" keyword. (#538) @jugmac00 * Update test requirements to latest versions (#535) @ericwb * Fix readme file on Extending Bandit on list things (#534) @Aurel10 * fix the documentation file README.rst (#533) @Aurel10 * Cleanup comments after #510 (#532) @florczakraf * Use SPDX license identifier instead of bulky headers (#530) @ericwb * fix B603 docstring (#524) @graingert * Add type checking to name node of hashlib_new (#516) @teeann * --exit-zero option (#510) @maciejstromich * Fix 3.8 errors (#509) @tylerwince * Add several ini options for .bandit file (#508) @vuolter * get_url returns different urls calling twice (bug #506) (#507) @ehooo * Replace setattr (#493) @tylerwince - Refresh remove-non-test-deps.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bandit?expand=0&rev=16
2021-03-09 06:57:46 +00:00
BuildRequires: %{python_module beautifulsoup4 >= 4.8.0}
BuildRequires: %{python_module fixtures >= 3.0.0}
BuildRequires: %{python_module jschema-to-python >= 1.2.3}
BuildRequires: %{python_module python-subunit >= 0.0.18}
BuildRequires: %{python_module sarif-om}
- Update to 1.7.0: * Remove blacklist call to input() (#662) @ericwb * Remove universal support on the wheel (#655) @ericwb * Give some tips on how to resolve B101 in the doc (#616) @xuhdev * Don't show progress information on --quiet (#641) @fniessink * Add skip configuration to assert_used (#633) @wilbertom * Drop Python2 build, test, and install (#615) @ericwb * [FIX] blacklist: fix typo in import_ftplib (#601) @Yenthe666 * Resolve 'NoneType' object has no attribute 'id'Traceback in django_mark_safe (#598) @ehooo * Fix typo for activating venv (#590) @bavedarnow * Bump pyyaml (#588) @dosisod * Fix colorama not being disabled after being used (#586) @adambenali * Cleanup some typos in recent contributor guide (#585) @ericwb * [DOC] Support python3 venv creation (#583) @look4regev * Add sha1 to the list of insecure hashes (#561) @ericwb * Fix docs for B610,B611,B703 (#555) @amacfie * Add a section explaining "nosec" (#554) @exhuma * Add official support of Python 3.8 (#547) @ericwb * Ignore common directories by default (#544) @ericwb * Add shelve to the pickle blacklists (#542) @auscompgeek * Remove obsolete "sudo" keyword. (#538) @jugmac00 * Update test requirements to latest versions (#535) @ericwb * Fix readme file on Extending Bandit on list things (#534) @Aurel10 * fix the documentation file README.rst (#533) @Aurel10 * Cleanup comments after #510 (#532) @florczakraf * Use SPDX license identifier instead of bulky headers (#530) @ericwb * fix B603 docstring (#524) @graingert * Add type checking to name node of hashlib_new (#516) @teeann * --exit-zero option (#510) @maciejstromich * Fix 3.8 errors (#509) @tylerwince * Add several ini options for .bandit file (#508) @vuolter * get_url returns different urls calling twice (bug #506) (#507) @ehooo * Replace setattr (#493) @tylerwince - Refresh remove-non-test-deps.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bandit?expand=0&rev=16
2021-03-09 06:57:46 +00:00
BuildRequires: %{python_module stestr >= 2.5.0}
BuildRequires: %{python_module stevedore >= 1.20.0}
BuildRequires: %{python_module testrepository >= 0.0.18}
- Update to 1.7.0: * Remove blacklist call to input() (#662) @ericwb * Remove universal support on the wheel (#655) @ericwb * Give some tips on how to resolve B101 in the doc (#616) @xuhdev * Don't show progress information on --quiet (#641) @fniessink * Add skip configuration to assert_used (#633) @wilbertom * Drop Python2 build, test, and install (#615) @ericwb * [FIX] blacklist: fix typo in import_ftplib (#601) @Yenthe666 * Resolve 'NoneType' object has no attribute 'id'Traceback in django_mark_safe (#598) @ehooo * Fix typo for activating venv (#590) @bavedarnow * Bump pyyaml (#588) @dosisod * Fix colorama not being disabled after being used (#586) @adambenali * Cleanup some typos in recent contributor guide (#585) @ericwb * [DOC] Support python3 venv creation (#583) @look4regev * Add sha1 to the list of insecure hashes (#561) @ericwb * Fix docs for B610,B611,B703 (#555) @amacfie * Add a section explaining "nosec" (#554) @exhuma * Add official support of Python 3.8 (#547) @ericwb * Ignore common directories by default (#544) @ericwb * Add shelve to the pickle blacklists (#542) @auscompgeek * Remove obsolete "sudo" keyword. (#538) @jugmac00 * Update test requirements to latest versions (#535) @ericwb * Fix readme file on Extending Bandit on list things (#534) @Aurel10 * fix the documentation file README.rst (#533) @Aurel10 * Cleanup comments after #510 (#532) @florczakraf * Use SPDX license identifier instead of bulky headers (#530) @ericwb * fix B603 docstring (#524) @graingert * Add type checking to name node of hashlib_new (#516) @teeann * --exit-zero option (#510) @maciejstromich * Fix 3.8 errors (#509) @tylerwince * Add several ini options for .bandit file (#508) @vuolter * get_url returns different urls calling twice (bug #506) (#507) @ehooo * Replace setattr (#493) @tylerwince - Refresh remove-non-test-deps.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bandit?expand=0&rev=16
2021-03-09 06:57:46 +00:00
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
%autosetup -p1 -n bandit-%{version}
sed -i '/^#!/d' bandit/__main__.py
%if !%{with test}
%build
Accepting request 1222690 from home:glaubitz:branches:devel:languages:python - Update to 1.7.10 * Bump docker/build-push-action from 5.4.0 to 6.0.0 * Suggested small refactors in assignments * Performance improvement in blacklist function * Add test for usage of FTP_TLS * New check: B113: TrojanSource - Bidirectional control characters * Bump docker/build-push-action from 6.0.0 to 6.1.0 * feat(plugins): add support for httpx in B113 * Nit: remove unused variable * Add recent releases to version choice in bug report * Bump docker/build-push-action from 6.1.0 to 6.2.0 * Bump docker/build-push-action from 6.2.0 to 6.3.0 * Bump docker/setup-buildx-action from 3.3.0 to 3.4.0 * Bump docker/setup-buildx-action from 3.4.0 to 3.5.0 * Bump docker/login-action from 3.2.0 to 3.3.0 * Bump docker/build-push-action from 6.3.0 to 6.5.0 * Bump docker/setup-buildx-action from 3.5.0 to 3.6.1 * Bump docker/build-push-action from 6.5.0 to 6.6.1 * Bump sigstore/cosign-installer from 3.5.0 to 3.6.0 * Bump docker/build-push-action from 6.6.1 to 6.7.0 * Use consistent file naming of docs * Pytorch Load / Save Plugin - from version 1.7.9 * Bump docker/build-push-action from 5.1.0 to 5.2.0 * [pre-commit.ci] pre-commit autoupdate * New logo for Bandit based on raccoon * Start testing on Python 3.13 * Bump docker/build-push-action from 5.2.0 to 5.3.0 * Bump docker/setup-buildx-action from 3.1.0 to 3.2.0 * Bump docker/login-action from 3.0.0 to 3.1.0 OBS-URL: https://build.opensuse.org/request/show/1222690 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bandit?expand=0&rev=31
2024-11-12 01:12:53 +00:00
%pyproject_wheel
%endif
%if !%{with test}
%install
Accepting request 1222690 from home:glaubitz:branches:devel:languages:python - Update to 1.7.10 * Bump docker/build-push-action from 5.4.0 to 6.0.0 * Suggested small refactors in assignments * Performance improvement in blacklist function * Add test for usage of FTP_TLS * New check: B113: TrojanSource - Bidirectional control characters * Bump docker/build-push-action from 6.0.0 to 6.1.0 * feat(plugins): add support for httpx in B113 * Nit: remove unused variable * Add recent releases to version choice in bug report * Bump docker/build-push-action from 6.1.0 to 6.2.0 * Bump docker/build-push-action from 6.2.0 to 6.3.0 * Bump docker/setup-buildx-action from 3.3.0 to 3.4.0 * Bump docker/setup-buildx-action from 3.4.0 to 3.5.0 * Bump docker/login-action from 3.2.0 to 3.3.0 * Bump docker/build-push-action from 6.3.0 to 6.5.0 * Bump docker/setup-buildx-action from 3.5.0 to 3.6.1 * Bump docker/build-push-action from 6.5.0 to 6.6.1 * Bump sigstore/cosign-installer from 3.5.0 to 3.6.0 * Bump docker/build-push-action from 6.6.1 to 6.7.0 * Use consistent file naming of docs * Pytorch Load / Save Plugin - from version 1.7.9 * Bump docker/build-push-action from 5.1.0 to 5.2.0 * [pre-commit.ci] pre-commit autoupdate * New logo for Bandit based on raccoon * Start testing on Python 3.13 * Bump docker/build-push-action from 5.2.0 to 5.3.0 * Bump docker/setup-buildx-action from 3.1.0 to 3.2.0 * Bump docker/login-action from 3.0.0 to 3.1.0 OBS-URL: https://build.opensuse.org/request/show/1222690 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bandit?expand=0&rev=31
2024-11-12 01:12:53 +00:00
%pyproject_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
%python_group_libalternatives bandit bandit-config-generator bandit-baseline
# libalternatives binaries break the tests
%if %{with libalternatives}
sed -i 's/import sys/import sys; sys.argv[0] = "bandit"/' %{buildroot}%{_bindir}/bandit-3*
%endif
%endif
%if %{with test}
%check
%pyunittest discover -v
%endif
%if !%{with test}
%endif
%if !%{with test}
%post
%python_install_alternative bandit bandit.1 bandit-config-generator bandit-baseline
%postun
%python_uninstall_alternative bandit
%pre
%python_libalternatives_reset_alternative bandit
%endif
%if !%{with test}
%files %{python_files}
%license LICENSE
%doc AUTHORS ChangeLog README.rst
Accepting request 1288495 from home:glaubitz:branches:devel:languages:python - Update to 1.8.5 * Fix the rendering of the CI/CD doc (#1274) * Fix for publish to PyPI failure (#1273) - from version 1.8.4 * Add more random functions to B311 check (#1235) * Metadata: rename classifier to classifiers (#1237) * Bump sigstore/cosign-installer from 3.8.0 to 3.8.1 (#1239) * Bump docker/build-push-action from 6.13.0 to 6.14.0 (#1238) * Bump docker/build-push-action from 6.14.0 to 6.15.0 (#1240) * Bump docker/setup-buildx-action from 3.9.0 to 3.10.0 (#1241) * Bump docker/login-action from 3.3.0 to 3.4.0 (#1245) * Bump bandit version in bug template (#1247) * Fix traceback from trojansource plugin (#1248) * Ensure the man page is built (#1257) * Update documentation to cover `--severity-level` and `--confidence-level` (#1254) * Use license property in lieu of classifier (#1259) * Fix up some of the warnings when building docs (#1258) * Add a doc describing various integrations (#1253) * Use ubuntu latest for readthedocs build (#1260) * Bump docker/build-push-action from 6.15.0 to 6.16.0 (#1261) * Bump sigstore/cosign-installer from 3.8.1 to 3.8.2 (#1262) * Remove etc from list of temp paths (#1263) * Bump docker/build-push-action from 6.16.0 to 6.17.0 (#1265) * [pre-commit.ci] pre-commit autoupdate (#1266) * Bump docker/build-push-action from 6.17.0 to 6.18.0 (#1268) * Add github-actions documentation (#1172) - Add bandit manpage to %files section OBS-URL: https://build.opensuse.org/request/show/1288495 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bandit?expand=0&rev=40
2025-06-25 11:30:10 +00:00
%{_mandir}/man1/bandit.1%{?ext_man}
%python_alternative %{_bindir}/bandit
%python_alternative %{_bindir}/bandit-config-generator
%python_alternative %{_bindir}/bandit-baseline
%{python_sitelib}/bandit
%{python_sitelib}/bandit-%{version}*-info
%endif
%changelog