summaryrefslogtreecommitdiff
path: root/dev-python/parso
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/parso')
-rw-r--r--dev-python/parso/Manifest6
-rw-r--r--dev-python/parso/files/parso-0.8.2-flaky-test.patch23
-rw-r--r--dev-python/parso/files/parso-0.8.2-py310-2.patch57
-rw-r--r--dev-python/parso/parso-0.7.1-r1.ebuild2
-rw-r--r--dev-python/parso/parso-0.8.2.ebuild5
5 files changed, 88 insertions, 5 deletions
diff --git a/dev-python/parso/Manifest b/dev-python/parso/Manifest
index 3dff2404ecec..0c5cff3fcf6b 100644
--- a/dev-python/parso/Manifest
+++ b/dev-python/parso/Manifest
@@ -1,6 +1,8 @@
+AUX parso-0.8.2-flaky-test.patch 947 BLAKE2B b6ece3214328f3121e4de8217395ac108678a37a97bea943e900e13cf44fdbeccf70f2b3bf8dda70df6cf06feb73a55f2bd2d75236898e4cf45c8b22f46b93fb SHA512 b7c5ac93d2f44a897b8d9eb59c470c82b2013f4e3ebf35e81254294f9961e8916a6d590d61ed1d8f3841e50c47cc7902e13d1e28826869afa9168e44e85a98e0
+AUX parso-0.8.2-py310-2.patch 2145 BLAKE2B f0b403c9b9ca5370b1c2ffd52d0a22d995bff03242526a4a649cd58392380c3e38cad4b251b20580b5c22ab859f4829d8ef6ad9c5faaaae3a02b39526d3d585a SHA512 6761d95f4ae0c9a8042abc3fcb42848f323337920306974802f008614c75c7c313aa9a666dd24cfe7e01c7d01f06cbd8e2d370fbc89cc08fdd8b87bcea0aec61
AUX parso-0.8.2-py310.patch 1128 BLAKE2B f052039f8aef2913cef406c97d55e1afdcd76e46d2a64e2e2f1fd2ac1b7571950ca816213b155602f7b974d01996876a4a7bb0b92f49161d9b29e4ec98950918 SHA512 5aaff0ca295195674006f1435863ff59eac121189c938ef44428eba929a2d76daea9fffb51feebcc75502dbdfb5df7ead18d62c4ee98cb53c35129b81c562810
DIST parso-0.7.1.tar.gz 399842 BLAKE2B 1e47c1dd6846d01aa5820d7cedc3eafcf12ea0d4a2e95fa3f54429633b1c12dc39a4abe237fa46eb629408006777bd1f512cf878025b55119568ac19729b8c19 SHA512 318969a7a941c4a0948e58643b07b6f5c446ea166b3a8e44a556f0677ec9a36d7dc8c6d37ca7bce3f8276ee3d7144e22fbaaeac90c738fb90f7e94a0cf8abf7d
DIST parso-0.8.2.tar.gz 394419 BLAKE2B f4e86ae55140adc9bbfdd34a8044e7fdfbf9d318a6385ac5feedc07127061943c2d690581af144f158846e3bf6f82124046c7e625369a4055ab92a54f9210c49 SHA512 a90810ad89301d804d215392ed77593b015f13bc7ef8512302a8893b314a9e74c15e2aaa77157c8595a134d3481e8115f306f9628835271478837ec6f19e645f
-EBUILD parso-0.7.1-r1.ebuild 866 BLAKE2B 730cdde56ea2935fd3ed22322a423d7fd4025b117ab3775b7f64517ad3735b4bf2eac7ea3de2aafbfdd41139e14b4301d13295e3d6f5313161a465bede10cd65 SHA512 725052f75029489e6eb9d9ee179287fd6b258d0f0f1baa414f76a4a9d5f322283f7a921db11d60bb64525caf76c82563ca8f61790cf5922018b4b1729065a74d
-EBUILD parso-0.8.2.ebuild 911 BLAKE2B 50944234ba8b5a49412bf541d88b342c11c933a45b4246a78e296371016e2153156a513c241f46ee2a5cc928bc7a30e28cdb26c82b4a6cd963a03029b9a5a2d1 SHA512 d37c6834563a2cc62cd6aee457fa943a6678ef416a9de66c8edaae663acf63e76a3b3fba0c35c348199a4c74b07f134a0af7dac31e52a562a7e79eb7bbcf749d
+EBUILD parso-0.7.1-r1.ebuild 872 BLAKE2B ea9cc5082628bf3fa685faea2c6f641ec480980639d9a5a7549f49d0f7afc7ded936bad02086c62b7a6f7e9ef0083c58fa2b37610f206d82647de3956787fcb3 SHA512 3f4a9d3aa0048c8da17c22880b50f9482fb5309ca10828565c6d6a9dada5190edb151d5ccc0999263e24a2afffc94a069a6b08f08e1318c7ade868315a50d6cb
+EBUILD parso-0.8.2.ebuild 922 BLAKE2B 30e7445875016d94268188ecb5f654c8daac9a473bf218190317c8cd15b1f45654ce94e3cfd5e2360b0de5c6ac0a02f6eb4cb786749f45c2d1e83c0a2a38031f SHA512 08a707da0f0e3a69f0c84cf8391f025f911c9a560a2da38d283f721e8053bc8289741837bef1c2e3408f6c6e2d5a7b4c3725608956fc9cdc6ac9595f5c19ddf5
MISC metadata.xml 402 BLAKE2B 3dbbdbbd15ec82aa4f38d92f52f4342a14b209edff3aa09b5dc1866784533e21f8c5d75146e3b9b535c01bb4dd36cd259abb2deb959382866242d99fb5d8fad3 SHA512 61cca7520333f595582f3e52602afa09d685d8072a211c4b8a2930fccbd98645c8c69ef7f687a25c05e2e2dc7ddda2fee16b7666cc2854b0b5ac6e23a95bac42
diff --git a/dev-python/parso/files/parso-0.8.2-flaky-test.patch b/dev-python/parso/files/parso-0.8.2-flaky-test.patch
new file mode 100644
index 000000000000..729ec409c829
--- /dev/null
+++ b/dev-python/parso/files/parso-0.8.2-flaky-test.patch
@@ -0,0 +1,23 @@
+From 60fed7b9f80cbb3d9cb7a9e42ad8c0f3c513801d Mon Sep 17 00:00:00 2001
+From: Saiyang Gou <gousaiyang@163.com>
+Date: Sat, 29 May 2021 18:17:24 -0700
+Subject: [PATCH] Fix flaky test_cache_last_used_update again (#189)
+
+This is a follow up for #177. On Windows, `assert node_cache_item.last_used < now` may fail as the two time values can be equal.
+---
+ test/test_cache.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/test_cache.py b/test/test_cache.py
+index f4291c2..5e633fc 100644
+--- a/test/test_cache.py
++++ b/test/test_cache.py
+@@ -137,7 +137,7 @@ def test_cache_last_used_update(diff_cache, use_file_io):
+ parse('somecode', cache=True, path=p)
+ node_cache_item = next(iter(parser_cache.values()))[p]
+ now = time.time()
+- assert node_cache_item.last_used < now
++ assert node_cache_item.last_used <= now
+
+ if use_file_io:
+ f = _FixedTimeFileIO(p, 'code', node_cache_item.last_used - 10)
diff --git a/dev-python/parso/files/parso-0.8.2-py310-2.patch b/dev-python/parso/files/parso-0.8.2-py310-2.patch
new file mode 100644
index 000000000000..7c6b1ad78286
--- /dev/null
+++ b/dev-python/parso/files/parso-0.8.2-py310-2.patch
@@ -0,0 +1,57 @@
+From dc41958947770849c8b3b4d344db434e2c8548cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Thu, 5 Aug 2021 09:09:28 +0200
+Subject: [PATCH] Update expected exception line numbers for Python 3.10.0rc1
+
+It seems that upstream has fixed line numbers in some of the expections
+in Python 3.10.0rc1, so update the tests accordingly. This means that
+test_non_async_in_async() gets the correct line again,
+and test_default_except_error_postition() no longer suffers from
+the apparent off-by-one problem.
+
+This doesn't fix tests entirely with Python 3.10 but it's a step
+forward.
+---
+ test/test_python_errors.py | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/test/test_python_errors.py b/test/test_python_errors.py
+index cda9bd2..e847ebb 100644
+--- a/test/test_python_errors.py
++++ b/test/test_python_errors.py
+@@ -57,10 +57,10 @@ def test_non_async_in_async():
+ error, = errors
+ actual = error.message
+ assert actual in wanted
+- if sys.version_info[:2] < (3, 8):
++ if sys.version_info[:2] not in ((3, 8), (3,9)):
+ assert line_nr == error.start_pos[0]
+ else:
+- assert line_nr == 0 # For whatever reason this is zero in Python 3.8+
++ assert line_nr == 0 # For whatever reason this is zero in Python 3.8/3.9
+
+
+ @pytest.mark.parametrize(
+@@ -140,13 +140,16 @@ def _get_actual_exception(code):
+
+
+ def test_default_except_error_postition():
+- # For this error the position seemed to be one line off, but that doesn't
+- # really matter.
++ # For this error the position seemed to be one line off in Python < 3.10,
++ # but that doesn't really matter.
+ code = 'try: pass\nexcept: pass\nexcept X: pass'
+ wanted, line_nr = _get_actual_exception(code)
+ error, = _get_error_list(code)
+ assert error.message in wanted
+- assert line_nr != error.start_pos[0]
++ if sys.version_info[:2] >= (3, 10):
++ assert line_nr == error.start_pos[0]
++ else:
++ assert line_nr != error.start_pos[0]
+ # I think this is the better position.
+ assert error.start_pos[0] == 2
+
+--
+2.32.0
+
diff --git a/dev-python/parso/parso-0.7.1-r1.ebuild b/dev-python/parso/parso-0.7.1-r1.ebuild
index d05ee8925e65..395f094f2437 100644
--- a/dev-python/parso/parso-0.7.1-r1.ebuild
+++ b/dev-python/parso/parso-0.7.1-r1.ebuild
@@ -13,7 +13,7 @@ SRC_URI="https://github.com/davidhalter/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.
LICENSE="MIT"
SLOT="0"
-KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~ppc ppc64 ~riscv ~sparc x86"
+KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~ppc ppc64 ~riscv ~sparc x86"
distutils_enable_sphinx docs
distutils_enable_tests pytest
diff --git a/dev-python/parso/parso-0.8.2.ebuild b/dev-python/parso/parso-0.8.2.ebuild
index 2aa420a8cb86..42be4262b424 100644
--- a/dev-python/parso/parso-0.8.2.ebuild
+++ b/dev-python/parso/parso-0.8.2.ebuild
@@ -13,13 +13,15 @@ SRC_URI="https://github.com/davidhalter/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.
LICENSE="MIT"
SLOT="0"
-KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~ppc ppc64 ~riscv ~sparc x86"
+KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~ppc ppc64 ~riscv ~sparc x86"
distutils_enable_sphinx docs
distutils_enable_tests pytest
PATCHES=(
"${FILESDIR}"/${P}-py310.patch
+ "${FILESDIR}"/${P}-py310-2.patch
+ "${FILESDIR}"/${P}-flaky-test.patch
)
python_test() {
@@ -27,7 +29,6 @@ python_test() {
[[ ${EPYTHON} == python3.10 ]] && deselect+=(
# py3.10 changed exception messages
test/test_python_errors.py::test_python_exception_matches
- test/test_python_errors.py::test_default_except_error_postition
)
epytest ${deselect[@]/#/--deselect }
}