From 7267fb40fb51ddbc9cc5c1c82b0a12807ef7b281 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 26 Jan 2023 13:56:06 +0000 Subject: gentoo auto-resync : 26:01:2023 - 13:56:06 --- dev-python/bandit/Manifest | 3 +- dev-python/bandit/bandit-1.7.4-r1.ebuild | 46 +++++++++++++ dev-python/bandit/bandit-1.7.4.ebuild | 37 ----------- dev-python/bandit/files/bandit-1.7.4-tomli.patch | 85 ++++++++++++++++++++++++ 4 files changed, 133 insertions(+), 38 deletions(-) create mode 100644 dev-python/bandit/bandit-1.7.4-r1.ebuild delete mode 100644 dev-python/bandit/bandit-1.7.4.ebuild create mode 100644 dev-python/bandit/files/bandit-1.7.4-tomli.patch (limited to 'dev-python/bandit') 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-r1.ebuild b/dev-python/bandit/bandit-1.7.4-r1.ebuild new file mode 100644 index 000000000000..769c2883561f --- /dev/null +++ b/dev-python/bandit/bandit-1.7.4-r1.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{9..11} ) + +inherit distutils-r1 + +DESCRIPTION="A security linter from OpenStack Security" +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" +SLOT="0" +KEYWORDS="amd64 ~arm arm64 ~riscv x86" + +RDEPEND=" + >=dev-python/pbr-2.0.0[${PYTHON_USEDEP}] + >=dev-python/GitPython-1.0.1[${PYTHON_USEDEP}] + >=dev-python/pyyaml-5.3.1[${PYTHON_USEDEP}] + >=dev-python/stevedore-1.20.0[${PYTHON_USEDEP}] +" +BDEPEND=" + >=dev-python/pbr-2.0.0[${PYTHON_USEDEP}] + test? ( + >=dev-python/fixtures-3.0.0[${PYTHON_USEDEP}] + >=dev-python/testscenarios-0.5.0[${PYTHON_USEDEP}] + >=dev-python/testtools-2.3.0[${PYTHON_USEDEP}] + >=dev-python/beautifulsoup4-4.8.0[${PYTHON_USEDEP}] + >=dev-python/pylint-1.9.4[${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/bandit-1.7.4.ebuild b/dev-python/bandit/bandit-1.7.4.ebuild deleted file mode 100644 index cc946f6f00ff..000000000000 --- a/dev-python/bandit/bandit-1.7.4.ebuild +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{9..11} ) - -inherit distutils-r1 - -DESCRIPTION="A security linter from OpenStack Security" -HOMEPAGE="https://github.com/PyCQA/bandit" -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="amd64 ~arm arm64 ~riscv x86" - -RDEPEND=" - >=dev-python/pbr-2.0.0[${PYTHON_USEDEP}] - >=dev-python/GitPython-1.0.1[${PYTHON_USEDEP}] - >=dev-python/pyyaml-5.3.1[${PYTHON_USEDEP}] - >=dev-python/stevedore-1.20.0[${PYTHON_USEDEP}] -" -BDEPEND=" - >=dev-python/pbr-2.0.0[${PYTHON_USEDEP}] - test? ( - >=dev-python/fixtures-3.0.0[${PYTHON_USEDEP}] - >=dev-python/testscenarios-0.5.0[${PYTHON_USEDEP}] - >=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}] - ) -" - -distutils_enable_tests unittest 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 +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 +--- + 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 = -- cgit v1.2.3