1 |
commit: bd3e8d1d498aafe2ed2c66b0828d41eaa08f7608 |
2 |
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 1 11:00:29 2021 +0000 |
4 |
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 1 12:25:04 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd3e8d1d |
7 |
|
8 |
dev-util/vint: enable py3.9, enable py3.10, fix tests |
9 |
|
10 |
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> |
11 |
|
12 |
dev-util/vint/files/vint-0.3.21-fix-py3.8.patch | 29 +++++++++++++++++++++++++ |
13 |
dev-util/vint/vint-0.3.21.ebuild | 18 +++++---------- |
14 |
2 files changed, 35 insertions(+), 12 deletions(-) |
15 |
|
16 |
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 |
17 |
new file mode 100644 |
18 |
index 00000000000..af97c51cf2c |
19 |
--- /dev/null |
20 |
+++ b/dev-util/vint/files/vint-0.3.21-fix-py3.8.patch |
21 |
@@ -0,0 +1,29 @@ |
22 |
+From f8bae710ba74dcc55a3b95995fe73139cf949b75 Mon Sep 17 00:00:00 2001 |
23 |
+From: Daniel Hahler <git@×××××××.de> |
24 |
+Date: Mon, 25 Nov 2019 06:41:39 +0100 |
25 |
+Subject: [PATCH] Fix SyntaxWarning with py38 (#334) |
26 |
+ |
27 |
+> SyntaxWarning: "is not" with a literal. Did you mean "!="? |
28 |
+--- a/vint/ast/plugin/scope_plugin/scope_linker.py |
29 |
++++ b/vint/ast/plugin/scope_plugin/scope_linker.py |
30 |
+@@ -406,14 +406,17 @@ def _handle_function_node(self, func_node): # type: (Dict[str, Any]) -> None |
31 |
+ # We can access "a:firstline" and "a:lastline" if the function is |
32 |
+ # declared with an attribute "range". See :func-range |
33 |
+ attr = func_node['attr'] |
34 |
+- is_declared_with_range = attr['range'] is not 0 |
35 |
++ is_declared_with_range = attr['range'] != 0 |
36 |
+ if is_declared_with_range: |
37 |
+ self._scope_tree_builder.handle_new_range_parameters_found() |
38 |
+ |
39 |
+ # We can access "l:self" is declared with an attribute "dict" or |
40 |
+ # the function is a member of a dict. See :help self |
41 |
+- is_declared_with_dict = attr['dict'] is not 0 \ |
42 |
+- or NodeType(func_name_node['type']) in FunctionNameNodesDeclaringVariableSelf |
43 |
++ is_declared_with_dict = ( |
44 |
++ attr["dict"] != 0 |
45 |
++ or NodeType(func_name_node["type"]) |
46 |
++ in FunctionNameNodesDeclaringVariableSelf |
47 |
++ ) |
48 |
+ if is_declared_with_dict: |
49 |
+ self._scope_tree_builder.handle_new_dict_parameter_found() |
50 |
+ |
51 |
|
52 |
diff --git a/dev-util/vint/vint-0.3.21.ebuild b/dev-util/vint/vint-0.3.21.ebuild |
53 |
index f07e7a81f73..44cd40dc8e1 100644 |
54 |
--- a/dev-util/vint/vint-0.3.21.ebuild |
55 |
+++ b/dev-util/vint/vint-0.3.21.ebuild |
56 |
@@ -1,11 +1,9 @@ |
57 |
-# Copyright 1999-2020 Gentoo Authors |
58 |
+# Copyright 1999-2021 Gentoo Authors |
59 |
# Distributed under the terms of the GNU General Public License v2 |
60 |
|
61 |
EAPI=7 |
62 |
|
63 |
-PYTHON_COMPAT=( python3_{7,8} ) |
64 |
-DISTUTILS_USE_SETUPTOOLS=rdepend |
65 |
- |
66 |
+PYTHON_COMPAT=( python3_{8..10} ) |
67 |
inherit distutils-r1 |
68 |
|
69 |
DESCRIPTION="Lint tool for Vim script language" |
70 |
@@ -22,12 +20,8 @@ RDEPEND=" |
71 |
>=dev-python/pyyaml-3.11[${PYTHON_USEDEP}] |
72 |
" |
73 |
|
74 |
-distutils_enable_tests pytest |
75 |
+PATCHES=( |
76 |
+ "${FILESDIR}/${P}-fix-py3.8.patch" |
77 |
+) |
78 |
|
79 |
-python_test() { |
80 |
- # Tests fail due to python 3.8 warnings in stderr that appear when |
81 |
- # compiled byte code is disabled |
82 |
- # https://github.com/Vimjas/vint/issues/355 |
83 |
- [[ "${EPYTHON}" == python3.8 ]] && return |
84 |
- pytest -vv || die "Tests fail with ${EPYTHON}" |
85 |
-} |
86 |
+distutils_enable_tests pytest |