Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Fri, 02 Jul 2021 08:30:14
Message-Id: 1625214340.7ae1b4b192f9885370f9e64f55f25ce64d542a88.mgorny@gentoo
1 commit: 7ae1b4b192f9885370f9e64f55f25ce64d542a88
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jun 19 09:21:59 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 2 08:25:40 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ae1b4b1
7
8 python-utils-r1.eclass: Pass -Wdefault to epytest to avoid -Werror
9
10 Make pytest pass -Wdefault in order to override upstream default warning
11 options that commonly include -Werror. This has often caused tests to
12 start failing due to new deprecation warnings introduced
13 in dependencies, or block new implementations due to harmless
14 deprecation warnings.
15
16 A side effect of this is that we are overriding all warning options used
17 by upstream. This could e.g. cause more warnings to be reported (when
18 upstream ignores some of them). This might also break badly written
19 tests (e.g. when they rely on exceptions to catch warnings).
20
21 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
22
23 eclass/python-utils-r1.eclass | 3 +++
24 1 file changed, 3 insertions(+)
25
26 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
27 index 7488802332f..168c767a2ee 100644
28 --- a/eclass/python-utils-r1.eclass
29 +++ b/eclass/python-utils-r1.eclass
30 @@ -1264,6 +1264,9 @@ epytest() {
31 -ra
32 # print local variables in tracebacks, useful for debugging
33 -l
34 + # override filterwarnings=error, we do not really want -Werror
35 + # for end users, as it tends to fail on new warnings from deps
36 + -Wdefault
37 )
38 set -- "${EPYTHON}" -m pytest "${args[@]}" "${@}"