summaryrefslogtreecommitdiff
path: root/dev-python/bandit
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-01-26 13:56:06 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-01-26 13:56:06 +0000
commit7267fb40fb51ddbc9cc5c1c82b0a12807ef7b281 (patch)
treeee50984098515c85257df0802f24d6b82f9a0b92 /dev-python/bandit
parent220317eb99d11e6c68af921f2855409bc506461a (diff)
gentoo auto-resync : 26:01:2023 - 13:56:06
Diffstat (limited to 'dev-python/bandit')
-rw-r--r--dev-python/bandit/Manifest3
-rw-r--r--dev-python/bandit/bandit-1.7.4-r1.ebuild (renamed from dev-python/bandit/bandit-1.7.4.ebuild)13
-rw-r--r--dev-python/bandit/files/bandit-1.7.4-tomli.patch85
3 files changed, 98 insertions, 3 deletions
diff --git a/dev-python/bandit/Manifest b/dev-python/bandit/Manifest
index 266146436200..2342f6c7a78d 100644
--- a/dev-python/bandit/Manifest
+++ b/dev-python/bandit/Manifest
@@ -1,3 +1,4 @@
+AUX bandit-1.7.4-tomli.patch 2465 BLAKE2B ad8f0e6a5880a29d97e3d3f58d58cdf748308605a7dda4817726e8d11f9b8f1d3847cabbf608b6e49c0c85e7e29572625fdfbb681092cab0ebdca6c452c651aa SHA512 2f3a4abdd0b3f25593cea35e10a16971b8df6676e157947a7a8fce8c0f4dcc9f196c7adff3ca62ef8fd3ed7610c2d0be9c850d23c037581d3124d07ffde53f83
DIST bandit-1.7.4.tar.gz 495104 BLAKE2B 5531a602dea877745ebdecf768fa83e0e478c52d472fbfdf98fec32c73a76a73e4f6dd957be760b4757e47c5f9cc25f6cd2f6c593df1e54165e647950a9f8a54 SHA512 93e1a25fd41e9409971f4cbac2ff73971ba270936a6b2aeecb3e0a2aa2015bcefd5eaab3cc94b2d9d96e4604d1a39c5ca1150c9eadd073357a90c5265c592407
-EBUILD bandit-1.7.4.ebuild 1005 BLAKE2B 1c2b40559ebe01de3dea2ee1f60dd1cd30314ea6fc7b0aa955b31cbbf754b1dba85613a547a9d1367bb8621f233d6d1d3491385a8b320be3038a558b6bbac7b5 SHA512 adcb4b84fa6c17f1341bbf26d3690af5ad3cda82dd2733f65f94f31a6030add60b21424dc03c5a7c4f8c9a38a8634bb575a3ef8eb43fff652acf90d667aa9e7e
+EBUILD bandit-1.7.4-r1.ebuild 1131 BLAKE2B 63bdd78d59688da4847f6baedd1ff926290ac81dd6d83d6de74e7059d4bb7550bf1ec611f7f81524a4d7929e662e402f762eed43bd4fa34130971ae2dcccb529 SHA512 22d3ec188e4d7bf2c5dfaf397b8fc35727d18d441b5113b5259d12b191900247ba0221c5bdfeefb0a115d382eb4735b1cd48bd41369a5932f43dba1869638bd3
MISC metadata.xml 709 BLAKE2B 845208c1e800577f159e34675344ce540c61888393dfcfc2f7c47e77ccfd4784cb3f1990b25b78f97d62c8b5c53feaadfdc894990333a09b7938a90be68b8815 SHA512 ba2c6de072973fcd891e4e161a43d52100df89f13243765cb5b2f2ccd7ef7a5266d8fd6e8d373859b53d6743c1de5b0733d5bb4f81b4a94d95843e0593e9dc8f
diff --git a/dev-python/bandit/bandit-1.7.4.ebuild b/dev-python/bandit/bandit-1.7.4-r1.ebuild
index cc946f6f00ff..769c2883561f 100644
--- a/dev-python/bandit/bandit-1.7.4.ebuild
+++ b/dev-python/bandit/bandit-1.7.4-r1.ebuild
@@ -9,7 +9,10 @@ PYTHON_COMPAT=( python3_{9..11} )
inherit distutils-r1
DESCRIPTION="A security linter from OpenStack Security"
-HOMEPAGE="https://github.com/PyCQA/bandit"
+HOMEPAGE="
+ https://github.com/PyCQA/bandit/
+ https://pypi.org/project/bandit/
+"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="Apache-2.0"
@@ -30,8 +33,14 @@ BDEPEND="
>=dev-python/testtools-2.3.0[${PYTHON_USEDEP}]
>=dev-python/beautifulsoup4-4.8.0[${PYTHON_USEDEP}]
>=dev-python/pylint-1.9.4[${PYTHON_USEDEP}]
- dev-python/toml[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '
+ dev-python/tomli[${PYTHON_USEDEP}]
+ ' 3.{8..10})
)
"
distutils_enable_tests unittest
+
+PATCHES=(
+ "${FILESDIR}"/${P}-tomli.patch
+)
diff --git a/dev-python/bandit/files/bandit-1.7.4-tomli.patch b/dev-python/bandit/files/bandit-1.7.4-tomli.patch
new file mode 100644
index 000000000000..238cc1f6d352
--- /dev/null
+++ b/dev-python/bandit/files/bandit-1.7.4-tomli.patch
@@ -0,0 +1,85 @@
+From 5a8f1050011a6eeca96c1b8a0fe1988fda97f214 Mon Sep 17 00:00:00 2001
+From: Mathieu Kniewallner <mathieu.kniewallner@gmail.com>
+Date: Fri, 25 Mar 2022 23:27:56 +0100
+Subject: [PATCH] Replace `toml` with `tomli` (#829)
+
+* Replace `toml` with `tomli`
+
+* Only require `tomli` on Python < 3.11
+
+* Update test-requirements.txt
+
+Co-authored-by: Eric Brown <ericwb@users.noreply.github.com>
+---
+ bandit/core/config.py | 20 ++++++++++++--------
+ setup.cfg | 2 +-
+ test-requirements.txt | 2 +-
+ 3 files changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/bandit/core/config.py b/bandit/core/config.py
+index 7c259bcc..236f357c 100644
+--- a/bandit/core/config.py
++++ b/bandit/core/config.py
+@@ -3,13 +3,17 @@
+ #
+ # SPDX-License-Identifier: Apache-2.0
+ import logging
++import sys
+
+ import yaml
+
+-try:
+- import toml
+-except ImportError:
+- toml = None
++if sys.version_info >= (3, 11):
++ import tomllib
++else:
++ try:
++ import tomli as tomllib
++ except ImportError:
++ tomllib = None
+
+ from bandit.core import constants
+ from bandit.core import extension_loader
+@@ -34,14 +38,14 @@ def __init__(self, config_file=None):
+
+ if config_file:
+ try:
+- f = open(config_file)
++ f = open(config_file, "rb")
+ except OSError:
+ raise utils.ConfigError(
+ "Could not read config file.", config_file
+ )
+
+ if config_file.endswith(".toml"):
+- if toml is None:
++ if tomllib is None:
+ raise utils.ConfigError(
+ "toml parser not available, reinstall with toml extra",
+ config_file,
+@@ -49,8 +53,8 @@ def __init__(self, config_file=None):
+
+ try:
+ with f:
+- self._config = toml.load(f)["tool"]["bandit"]
+- except toml.TomlDecodeError as err:
++ self._config = tomllib.load(f)["tool"]["bandit"]
++ except tomllib.TOMLDecodeError as err:
+ LOG.error(err)
+ raise utils.ConfigError("Error parsing file.", config_file)
+ else:
+diff --git a/setup.cfg b/setup.cfg
+index 5d570eea..7449f15b 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -31,7 +31,7 @@ project_urls =
+ yaml =
+ PyYAML
+ toml =
+- toml
++ tomli>=1.1.0; python_version < "3.11"
+
+ [entry_points]
+ console_scripts =