summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2021-10-01 14:00:29 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2021-10-01 15:25:04 +0300
commitbd3e8d1d498aafe2ed2c66b0828d41eaa08f7608 (patch)
tree94d42f6b0f9f9d6e1759859cffdd2aaeaedab5e7 /dev-util/vint
parentwww-apps/airdcpp-webui: add 2.11.2 (diff)
downloadgentoo-bd3e8d1d498aafe2ed2c66b0828d41eaa08f7608.tar.gz
gentoo-bd3e8d1d498aafe2ed2c66b0828d41eaa08f7608.tar.bz2
gentoo-bd3e8d1d498aafe2ed2c66b0828d41eaa08f7608.zip
dev-util/vint: enable py3.9, enable py3.10, fix tests
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'dev-util/vint')
-rw-r--r--dev-util/vint/files/vint-0.3.21-fix-py3.8.patch29
-rw-r--r--dev-util/vint/vint-0.3.21.ebuild18
2 files changed, 35 insertions, 12 deletions
diff --git a/dev-util/vint/files/vint-0.3.21-fix-py3.8.patch b/dev-util/vint/files/vint-0.3.21-fix-py3.8.patch
new file mode 100644
index 000000000000..af97c51cf2c4
--- /dev/null
+++ b/dev-util/vint/files/vint-0.3.21-fix-py3.8.patch
@@ -0,0 +1,29 @@
+From f8bae710ba74dcc55a3b95995fe73139cf949b75 Mon Sep 17 00:00:00 2001
+From: Daniel Hahler <git@thequod.de>
+Date: Mon, 25 Nov 2019 06:41:39 +0100
+Subject: [PATCH] Fix SyntaxWarning with py38 (#334)
+
+> SyntaxWarning: "is not" with a literal. Did you mean "!="?
+--- a/vint/ast/plugin/scope_plugin/scope_linker.py
++++ b/vint/ast/plugin/scope_plugin/scope_linker.py
+@@ -406,14 +406,17 @@ def _handle_function_node(self, func_node): # type: (Dict[str, Any]) -> None
+ # We can access "a:firstline" and "a:lastline" if the function is
+ # declared with an attribute "range". See :func-range
+ attr = func_node['attr']
+- is_declared_with_range = attr['range'] is not 0
++ is_declared_with_range = attr['range'] != 0
+ if is_declared_with_range:
+ self._scope_tree_builder.handle_new_range_parameters_found()
+
+ # We can access "l:self" is declared with an attribute "dict" or
+ # the function is a member of a dict. See :help self
+- is_declared_with_dict = attr['dict'] is not 0 \
+- or NodeType(func_name_node['type']) in FunctionNameNodesDeclaringVariableSelf
++ is_declared_with_dict = (
++ attr["dict"] != 0
++ or NodeType(func_name_node["type"])
++ in FunctionNameNodesDeclaringVariableSelf
++ )
+ if is_declared_with_dict:
+ self._scope_tree_builder.handle_new_dict_parameter_found()
+
diff --git a/dev-util/vint/vint-0.3.21.ebuild b/dev-util/vint/vint-0.3.21.ebuild
index f07e7a81f734..44cd40dc8e15 100644
--- a/dev-util/vint/vint-0.3.21.ebuild
+++ b/dev-util/vint/vint-0.3.21.ebuild
@@ -1,11 +1,9 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-PYTHON_COMPAT=( python3_{7,8} )
-DISTUTILS_USE_SETUPTOOLS=rdepend
-
+PYTHON_COMPAT=( python3_{8..10} )
inherit distutils-r1
DESCRIPTION="Lint tool for Vim script language"
@@ -22,12 +20,8 @@ RDEPEND="
>=dev-python/pyyaml-3.11[${PYTHON_USEDEP}]
"
-distutils_enable_tests pytest
+PATCHES=(
+ "${FILESDIR}/${P}-fix-py3.8.patch"
+)
-python_test() {
- # Tests fail due to python 3.8 warnings in stderr that appear when
- # compiled byte code is disabled
- # https://github.com/Vimjas/vint/issues/355
- [[ "${EPYTHON}" == python3.8 ]] && return
- pytest -vv || die "Tests fail with ${EPYTHON}"
-}
+distutils_enable_tests pytest