summaryrefslogtreecommitdiff
path: root/dev-python/re-assert
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-02-10 17:34:25 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-02-10 17:34:25 +0000
commit0bb42730e8fc9c8e571f12e3189c6c6f8d532c24 (patch)
treecba6032fbed30be2b0764494607c3ec9dda0c18a /dev-python/re-assert
parentcc901a8ce7c6bfe97e3b4f048619693d360ae348 (diff)
gentoo auto-resync : 10:02:2024 - 17:34:25
Diffstat (limited to 'dev-python/re-assert')
-rw-r--r--dev-python/re-assert/Manifest4
-rw-r--r--dev-python/re-assert/files/re-assert-1.1.0-re-fallback.patch34
-rw-r--r--dev-python/re-assert/re-assert-1.1.0-r3.ebuild (renamed from dev-python/re-assert/re-assert-1.1.0-r2.ebuild)23
3 files changed, 55 insertions, 6 deletions
diff --git a/dev-python/re-assert/Manifest b/dev-python/re-assert/Manifest
index 249e0d35f12f..230d942681fa 100644
--- a/dev-python/re-assert/Manifest
+++ b/dev-python/re-assert/Manifest
@@ -1,5 +1,5 @@
-AUX re-assert-1.1.0-re-fallback.patch 368 BLAKE2B 44bdd53f5583118459dd3f39dc501215f8be59217628ef1be70fc8708870b01154d1e3e911532ee5ba64f1e6fc0d84f5cd5631a8c2812699592861a68baaf2cc SHA512 d2c1d33db83b91712535e27b9121abbfb54a79acc216edbc3c470bf9f5cda64763d3d6c5a6db446f263186fdb68f0a62ad4b8611ff30ac47a5f36ebc3825ad06
+AUX re-assert-1.1.0-re-fallback.patch 1071 BLAKE2B 8a929f1a240e247d364c6e19fbd2b7e86344d48ad2ba2e51a39850654f3996c32e0f85f8270e6d2f0b112bced5804157fc25c3735ca52db714cf9c80a880d00d SHA512 744c74dfe8232d01fe5b80b1436cbe66ee20b065dbbc1ffc154098855a7e4e5fb9307b66f8b4f427af2b38a6a7e6c2a02295cb5e177e070b0776da841d5a04ce
DIST re-assert-1.1.0.gh.tar.gz 5010 BLAKE2B fc65f43b3525d02d877d51f0a1556b6b205dd1126fc205b775f5c0b6c34ee7c3e8d224fc3f46a80e8df4a366674be90221e891e19e12072c87ff82451ca8676c SHA512 fc14267cc68a12ff7350982f0bf54c77107809c9f0379ab3aa73fa1b7cf5ccabb130fcd35ab75bdf183e69c802a041deac707e1f0bab1c3815d4146b4e320c07
EBUILD re-assert-1.1.0-r1.ebuild 645 BLAKE2B d840683ac8d758bf53ec8394a97f516dd48d3400d41bd65223a7cbfd3a7042074aef77df80a1dcb56e70a2dfe5788e479027613c0c56c525e6312b307b96b8fe SHA512 85ffabd8911dd9afc036cde6907142682af2f7ea656a4b3187080617d04733523d35e5fdd87cea28b039cab1c0701d713cdbac943dce28d88a064c276fa26369
-EBUILD re-assert-1.1.0-r2.ebuild 809 BLAKE2B 9dc163df7654bb134f1365a76065e8904aebca538be1dc2d8ea46567fa014f1bcfd5f940819daecc68ffcd08213ee9f320ecd136f7d5bf67d5e2fbe0dab0156b SHA512 4337c4695a50aff4be44942c106e01b7ee58a1b1486c1f8860a4faa4cb9578f3c98b0aeb1fa9f3b28c5ecee659af1cb8a93e0f79f87281b3423996d811d855c0
+EBUILD re-assert-1.1.0-r3.ebuild 1491 BLAKE2B 6093be7ae32173c311bb2bc1d33981c66798c56c7d33c311c5f9590455996a356ccc1e18c491a6aa48914f7d1a86eba4c07ddfced7f17ad413b09105a61fcabd SHA512 0f873f4e8b6dcb466b2334766d0bef2f4484e36f1dbbaba814f41abc5ac3b0d319975356b465e11419060c3526748e43d8cc4cdced0216eb62de05223674f351
MISC metadata.xml 395 BLAKE2B dba34f6404c171596f781768e266b2e3ae21b2572db8695c6d17ffac5cfd91ea63ade4dac01b4961a5b691090ad6940d11cc82b629e6abc71e7b393c70e1f572 SHA512 f6c637f1fd777a2382954939e57c07aba53287f9a148ff19c6444ef249d87ac0e1d003b8ec2c2bbf396f756169dac2205bf597f16f5334a4f94e0032a08fe299
diff --git a/dev-python/re-assert/files/re-assert-1.1.0-re-fallback.patch b/dev-python/re-assert/files/re-assert-1.1.0-re-fallback.patch
index ad04e09ae5bc..b292d48d6e0f 100644
--- a/dev-python/re-assert/files/re-assert-1.1.0-re-fallback.patch
+++ b/dev-python/re-assert/files/re-assert-1.1.0-re-fallback.patch
@@ -1,16 +1,42 @@
diff --git a/re_assert.py b/re_assert.py
-index f6ea6b9..66479c3 100644
+index 840401e..8818da1 100644
--- a/re_assert.py
+++ b/re_assert.py
-@@ -3,7 +3,10 @@ from __future__ import annotations
+@@ -1,8 +1,13 @@
++import sys
++
from typing import Any
+ from typing import Optional
from typing import Pattern
-import regex
-+try:
++if sys.implementation.name == "cpython":
+ import regex
-+except ImportError:
++else:
+ import re as regex
class Matches: # TODO: Generic[AnyStr] (binary pattern support)
+@@ -12,6 +17,9 @@ class Matches: # TODO: Generic[AnyStr] (binary pattern support)
+ self._type = type(pattern)
+
+ def _fail_message(self, fail: str) -> str:
++ if sys.implementation.name != "cpython":
++ return "regex failed to match"
++
+ # binary search to find the longest substring match
+ pos, bound = 0, len(fail)
+ while pos < bound:
+diff --git a/setup.cfg b/setup.cfg
+index 46303ca..74cf999 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -20,7 +20,7 @@ classifiers =
+ [options]
+ py_modules = re_assert
+ install_requires =
+- regex
++ regex; python_implementation=="CPython"
+ python_requires = >=3.6.1
+
+ [bdist_wheel]
diff --git a/dev-python/re-assert/re-assert-1.1.0-r2.ebuild b/dev-python/re-assert/re-assert-1.1.0-r3.ebuild
index 3265b1484c5a..9bb6563659de 100644
--- a/dev-python/re-assert/re-assert-1.1.0-r2.ebuild
+++ b/dev-python/re-assert/re-assert-1.1.0-r3.ebuild
@@ -34,3 +34,26 @@ PATCHES=(
# use `re` as fallback since `regex` doesn't support PyPy
"${FILESDIR}/${P}-re-fallback.patch"
)
+
+python_test() {
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ local EPYTEST_DESELECT=()
+
+ case ${EPYTHON} in
+ pypy3)
+ EPYTEST_DESELECT+=(
+ # message/repr mismatches due to using `re` module
+ tests/re_assert_test.py::test_fail_at_beginning
+ tests/re_assert_test.py::test_fail_at_end_of_line
+ tests/re_assert_test.py::test_fail_at_end_of_line_mismatching_newline
+ tests/re_assert_test.py::test_fail_end_of_line_with_newline
+ tests/re_assert_test.py::test_fail_multiple_lines
+ tests/re_assert_test.py::test_match_with_tabs
+ tests/re_assert_test.py::test_matches_repr_with_flags
+ tests/re_assert_test.py::test_repr_with_failure
+ )
+ ;;
+ esac
+
+ epytest
+}