[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: gnu: python-pyflakes@2.2: Adjust tests for Python 3.9.
From: |
guix-commits |
Subject: |
03/03: gnu: python-pyflakes@2.2: Adjust tests for Python 3.9. |
Date: |
Sun, 12 Dec 2021 16:34:52 -0500 (EST) |
civodul pushed a commit to branch core-updates-frozen
in repository guix.
commit 867dcbe3a10bedf894b71cfabd2db22ca8dc249e
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Dec 12 22:15:56 2021 +0100
gnu: python-pyflakes@2.2: Adjust tests for Python 3.9.
* gnu/packages/patches/python-pyflakes-test-location.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/python-xyz.scm (python-pyflakes-2.2): Use it.
---
gnu/local.mk | 1 +
.../patches/python-pyflakes-test-location.patch | 42 ++++++++++++++++++++++
gnu/packages/python-xyz.scm | 4 ++-
3 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 0d39de5..faaf428 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1666,6 +1666,7 @@ dist_patch_DATA =
\
%D%/packages/patches/python-peachpy-determinism.patch \
%D%/packages/patches/python-pep8-stdlib-tokenize-compat.patch \
%D%/packages/patches/python-pyfakefs-remove-bad-test.patch \
+ %D%/packages/patches/python-pyflakes-test-location.patch \
%D%/packages/patches/python-flint-includes.patch \
%D%/packages/patches/python-libxml2-utf8.patch \
%D%/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch \
diff --git a/gnu/packages/patches/python-pyflakes-test-location.patch
b/gnu/packages/patches/python-pyflakes-test-location.patch
new file mode 100644
index 0000000..ea2c50c
--- /dev/null
+++ b/gnu/packages/patches/python-pyflakes-test-location.patch
@@ -0,0 +1,42 @@
+This patch fixes test failure related to reported source code locations.
+It is a backport of this patch:
+
+ commit 6a5f38b5ab12260fde8a0463acd433bc2d34dbcf
+ Author: Louis Sautier <sautier.louis@gmail.com>
+ Date: Sat Oct 3 02:37:53 2020 +0200
+
+ Fix tests with Python 3.9, closes #549 (#586)
+
+ Stop allowing failures on Python nightly.
+
+diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py
+index 128aa69..b728e65 100644
+--- a/pyflakes/test/test_api.py
++++ b/pyflakes/test/test_api.py
+@@ -515,6 +515,8 @@ def foo(bar=baz, bax):
+ if ERROR_HAS_LAST_LINE:
+ if PYPY and sys.version_info >= (3,):
+ column = 7
++ elif sys.version_info >= (3, 9):
++ column = 21
+ elif sys.version_info >= (3, 8):
+ column = 9
+ else:
+@@ -543,6 +545,8 @@ foo(bar=baz, bax)
+ if ERROR_HAS_LAST_LINE:
+ if PYPY and sys.version_info >= (3,):
+ column = 12
++ elif sys.version_info >= (3, 9):
++ column = 17
+ elif sys.version_info >= (3, 8):
+ column = 14
+ else:
+@@ -577,6 +581,8 @@ foo(bar=baz, bax)
+ position_end = 1
+ if PYPY:
+ column = 6
++ elif ver >= (3, 9):
++ column = 13
+ else:
+ column = 7
+ # Column has been "fixed" since 3.2.4 and 3.3.1
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 2d67154..2035714 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -9992,7 +9992,9 @@ plugin for flake8 to check PEP-8 naming conventions.")
(uri (pypi-uri "pyflakes" version))
(sha256
(base32
- "1j3zqbiwkyicvww499bblq33x0bjpzdrxajhaysr7sk7x5gdgcim"))))))
+ "1j3zqbiwkyicvww499bblq33x0bjpzdrxajhaysr7sk7x5gdgcim"))
+ (patches
+ (search-patches "python-pyflakes-test-location.patch"))))))
(define-public python-mccabe
(package