diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-05-29 15:17:30 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-05-29 15:17:30 +0100 |
commit | 662f71ae67cd775d7fbb79b5091676c0e07a992b (patch) | |
tree | 74c7cb80b79b8886cd7466cf262878d1e8b9d546 /dev-python/pytest | |
parent | b2d3769042cfd3d8ceadaa52f6a5aafabb0d4114 (diff) |
gentoo auto-resync : 29:05:2023 - 15:17:30
Diffstat (limited to 'dev-python/pytest')
-rw-r--r-- | dev-python/pytest/Manifest | 4 | ||||
-rw-r--r-- | dev-python/pytest/files/pytest-7.3.1-py312.patch | 93 | ||||
-rw-r--r-- | dev-python/pytest/pytest-7.3.1-r2.ebuild (renamed from dev-python/pytest/pytest-7.3.1-r1.ebuild) | 4 |
3 files changed, 81 insertions, 20 deletions
diff --git a/dev-python/pytest/Manifest b/dev-python/pytest/Manifest index 0ca98bc7885d..5b23cacd688e 100644 --- a/dev-python/pytest/Manifest +++ b/dev-python/pytest/Manifest @@ -1,5 +1,5 @@ -AUX pytest-7.3.1-py312.patch 8961 BLAKE2B 74125c002d0450f9f1668b5bc35f5d039b03c3ec12c2dc743ea1870e3ab2f205792f66e78f51df4c23076742466aab08b08c0be5d5ef8e9a983d0519cea9463b SHA512 0d4a47afd1a9533c0a2ace9581a59cf8c4e5a41dea8f3b8e2545cc07e85423aa1ec8e0caa3dd631b8a46202f026d35144f9f2d37677dc798abcdd8c0f037e1f7 +AUX pytest-7.3.1-py312.patch 11621 BLAKE2B 20e7132c8bbd16a8b01af8bf80254148434f7846463dffc4d46b731334d5b7959de9c3c3280d06a340c55bea608a3c516a31969ea0db7ce806581022537377b0 SHA512 17c0e3e2e119b9ce895d97fef9e1729c5f1577b2d5a3f6a650b7e94fccf8783a4686e4ddc7fa80209661dc4397f3c862dc809c531c136cafce477682b37223b6 DIST pytest-7.3.1.tar.gz 1336938 BLAKE2B 8cabc475056000e393538c6c52e2ee5a9af6c57831c6aba82e3107ae44f88b63a68b37339842eebfa318bd27d4bf5e34959b72052d4646cc8682c84f131f98e7 SHA512 e6c8fcf1449f5e09e33c01ec2ade8812ceb13440324179288b8ca0eeaaffed1e581a65c8acf4c28efe61c19a067e7ceddccc45d8a1582c89259d53fee25ab253 -EBUILD pytest-7.3.1-r1.ebuild 3749 BLAKE2B ce812385159e813fded4ead081c9b9662987783360f10ab9e6cbd2310dbab5a40d468c97f90279b14febc1aaac0026a939b2c8a742250d9e8b7e0695f14fa38b SHA512 606580bccaa5876607e5a992eaf77e9a58748ee722ad3c50adc33942611dce34fe3ee972ca0bee64235ed30c83089d8bda12a815174aa0a9f3a58c898d57be21 +EBUILD pytest-7.3.1-r2.ebuild 3738 BLAKE2B d617078f175346247a50aecd84dae886bac71256c61699a47a66736f9a20b8dcaa6214663db9cd764e392efc833eb6a2580125f15646c29b7d9d265b475323da SHA512 91da08ca2220af053c940227039eafcaa8e8a25a3c85e5caf1e316234673b3e7bba6d463863397e3a5681e74b74c8d1ec7ec549757e3fd22b17a1b2a474a782e EBUILD pytest-7.3.1.ebuild 3606 BLAKE2B 50c3531036be50132efd47386ce24361bc9679faf4b4c93f599423ef215c18d019be6ff06debdc73486e5ca50b9dbbd6b907605d1cda5c373fb4ea0e998a0e52 SHA512 d8ad759e261dab281802a7fa3dfb5d507459de1c6d0f39b34dbe8a579437197bb1d3662ff04d84b2068c3329f064fba6d9cae5b592e839ddb8bb1081e3f6c91a MISC metadata.xml 391 BLAKE2B 48d31ecb4c8b171ee4e84a58399211368ddc00dfb5dbe0999f96e03d744294cd4fd5263e90600c93d1f13c7da21052faef84b6d0d56709f3559e37b3392ca31d SHA512 6e9caa57eda23995d21df6f52c52d5868e1ff56abb6c1351ffc0fe14b771639473481a2630e659caaff83f0255379aa2d012175af52a0de41221b27d3ab2f425 diff --git a/dev-python/pytest/files/pytest-7.3.1-py312.patch b/dev-python/pytest/files/pytest-7.3.1-py312.patch index 62a32e0cb7a6..b38486248309 100644 --- a/dev-python/pytest/files/pytest-7.3.1-py312.patch +++ b/dev-python/pytest/files/pytest-7.3.1-py312.patch @@ -1,16 +1,16 @@ -From b1ba5ff337300e4242fb961d8496474e4b739c9b Mon Sep 17 00:00:00 2001 +From 653606791456f7e6412712bc26428b90092336b5 Mon Sep 17 00:00:00 2001 From: Ran Benita <ran@unusedvar.com> Date: Wed, 10 May 2023 10:36:09 +0300 Subject: [PATCH] Avoid ast deprecation warnings on Python 3.12 Fix #10977. --- - src/_pytest/assertion/rewrite.py | 44 ++++++++++++++++++-------------- + src/_pytest/assertion/rewrite.py | 49 +++++++++++++++++++------------- src/_pytest/mark/expression.py | 8 +++++- - 2 files changed, 32 insertions(+), 20 deletions(-) + 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py -index 8b182347052..2f9038ee132 100644 +index 8b182347052..00bb4feb94a 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -46,8 +46,14 @@ @@ -28,16 +28,22 @@ index 8b182347052..2f9038ee132 100644 assertstate_key = StashKey["AssertionState"]() -@@ -680,7 +686,7 @@ def run(self, mod: ast.Module) -> None: +@@ -680,9 +686,12 @@ def run(self, mod: ast.Module) -> None: if ( expect_docstring and isinstance(item, ast.Expr) - and isinstance(item.value, ast.Str) + and isinstance(item.value, astStr) ): - doc = item.value.s +- doc = item.value.s ++ if sys.version_info >= (3, 8): ++ doc = item.value.value ++ else: ++ doc = item.value.s if self.is_rewrite_disabled(doc): -@@ -814,7 +820,7 @@ def pop_format_context(self, expl_expr: ast.expr) -> ast.Name: + return + expect_docstring = False +@@ -814,7 +823,7 @@ def pop_format_context(self, expl_expr: ast.expr) -> ast.Name: current = self.stack.pop() if self.stack: self.explanation_specifiers = self.stack[-1] @@ -46,7 +52,7 @@ index 8b182347052..2f9038ee132 100644 format_dict = ast.Dict(keys, list(current.values())) form = ast.BinOp(expl_expr, ast.Mod(), format_dict) name = "@py_format" + str(next(self.variable_counter)) -@@ -868,16 +874,16 @@ def visit_Assert(self, assert_: ast.Assert) -> List[ast.stmt]: +@@ -868,16 +877,16 @@ def visit_Assert(self, assert_: ast.Assert) -> List[ast.stmt]: negation = ast.UnaryOp(ast.Not(), top_condition) if self.enable_assertion_pass_hook: # Experimental pytest_assertion_pass hook @@ -66,7 +72,7 @@ index 8b182347052..2f9038ee132 100644 err_msg = ast.BinOp(assertmsg, ast.Add(), err_explanation) err_name = ast.Name("AssertionError", ast.Load()) fmt = self.helper("_format_explanation", err_msg) -@@ -893,8 +899,8 @@ def visit_Assert(self, assert_: ast.Assert) -> List[ast.stmt]: +@@ -893,8 +902,8 @@ def visit_Assert(self, assert_: ast.Assert) -> List[ast.stmt]: hook_call_pass = ast.Expr( self.helper( "_call_assertion_pass", @@ -77,7 +83,7 @@ index 8b182347052..2f9038ee132 100644 fmt_pass, ) ) -@@ -913,7 +919,7 @@ def visit_Assert(self, assert_: ast.Assert) -> List[ast.stmt]: +@@ -913,7 +922,7 @@ def visit_Assert(self, assert_: ast.Assert) -> List[ast.stmt]: variables = [ ast.Name(name, ast.Store()) for name in self.format_variables ] @@ -86,7 +92,7 @@ index 8b182347052..2f9038ee132 100644 self.statements.append(clear_format) else: # Original assertion rewriting -@@ -924,9 +930,9 @@ def visit_Assert(self, assert_: ast.Assert) -> List[ast.stmt]: +@@ -924,9 +933,9 @@ def visit_Assert(self, assert_: ast.Assert) -> List[ast.stmt]: assertmsg = self.helper("_format_assertmsg", assert_.msg) explanation = "\n>assert " + explanation else: @@ -98,7 +104,7 @@ index 8b182347052..2f9038ee132 100644 msg = self.pop_format_context(template) fmt = self.helper("_format_explanation", msg) err_name = ast.Name("AssertionError", ast.Load()) -@@ -938,7 +944,7 @@ def visit_Assert(self, assert_: ast.Assert) -> List[ast.stmt]: +@@ -938,7 +947,7 @@ def visit_Assert(self, assert_: ast.Assert) -> List[ast.stmt]: # Clear temporary variables by setting them to None. if self.variables: variables = [ast.Name(name, ast.Store()) for name in self.variables] @@ -107,7 +113,7 @@ index 8b182347052..2f9038ee132 100644 self.statements.append(clear) # Fix locations (line numbers/column offsets). for stmt in self.statements: -@@ -952,20 +958,20 @@ def visit_NamedExpr(self, name: namedExpr) -> Tuple[namedExpr, str]: +@@ -952,20 +961,20 @@ def visit_NamedExpr(self, name: namedExpr) -> Tuple[namedExpr, str]: # thinks it's acceptable. locs = ast.Call(self.builtin("locals"), [], []) target_id = name.target.id # type: ignore[attr-defined] @@ -132,7 +138,7 @@ index 8b182347052..2f9038ee132 100644 return name, self.explanation_param(expr) def visit_BoolOp(self, boolop: ast.BoolOp) -> Tuple[ast.Name, str]: -@@ -1001,7 +1007,7 @@ def visit_BoolOp(self, boolop: ast.BoolOp) -> Tuple[ast.Name, str]: +@@ -1001,7 +1010,7 @@ def visit_BoolOp(self, boolop: ast.BoolOp) -> Tuple[ast.Name, str]: self.push_format_context() res, expl = self.visit(v) body.append(ast.Assign([ast.Name(res_var, ast.Store())], res)) @@ -141,7 +147,7 @@ index 8b182347052..2f9038ee132 100644 call = ast.Call(app, [expl_format], []) self.expl_stmts.append(ast.Expr(call)) if i < levels: -@@ -1013,7 +1019,7 @@ def visit_BoolOp(self, boolop: ast.BoolOp) -> Tuple[ast.Name, str]: +@@ -1013,7 +1022,7 @@ def visit_BoolOp(self, boolop: ast.BoolOp) -> Tuple[ast.Name, str]: self.statements = body = inner self.statements = save self.expl_stmts = fail_save @@ -150,7 +156,7 @@ index 8b182347052..2f9038ee132 100644 expl = self.pop_format_context(expl_template) return ast.Name(res_var, ast.Load()), self.explanation_param(expl) -@@ -1099,9 +1105,9 @@ def visit_Compare(self, comp: ast.Compare) -> Tuple[ast.expr, str]: +@@ -1099,9 +1108,9 @@ def visit_Compare(self, comp: ast.Compare) -> Tuple[ast.expr, str]: next_expl = f"({next_expl})" results.append(next_res) sym = BINOP_MAP[op.__class__] @@ -195,3 +201,58 @@ index f82a81d44c5..9287bcee50c 100644 else: ret = expr(s) s.accept(TokenType.EOF, reject=True) +From c945dba571025623a3ace7311d682e3e9448a161 Mon Sep 17 00:00:00 2001 +From: Ran Benita <ran@unusedvar.com> +Date: Fri, 26 May 2023 20:28:21 +0300 +Subject: [PATCH] testing/python/collect: replace use of deprecated/removed + `imp` module + +--- + testing/python/collect.py | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +diff --git a/testing/python/collect.py b/testing/python/collect.py +index ac3edd395ab..52b34800965 100644 +--- a/testing/python/collect.py ++++ b/testing/python/collect.py +@@ -897,25 +897,29 @@ def pytest_pycollect_makeitem(collector, name, obj): + def test_issue2369_collect_module_fileext(self, pytester: Pytester) -> None: + """Ensure we can collect files with weird file extensions as Python + modules (#2369)""" +- # We'll implement a little finder and loader to import files containing ++ # Implement a little meta path finder to import files containing + # Python source code whose file extension is ".narf". + pytester.makeconftest( + """ +- import sys, os, imp ++ import sys ++ import os.path ++ from importlib.util import spec_from_loader ++ from importlib.machinery import SourceFileLoader + from _pytest.python import Module + +- class Loader(object): +- def load_module(self, name): +- return imp.load_source(name, name + ".narf") +- class Finder(object): +- def find_module(self, name, path=None): +- if os.path.exists(name + ".narf"): +- return Loader() +- sys.meta_path.append(Finder()) ++ class MetaPathFinder: ++ def find_spec(self, fullname, path, target=None): ++ if os.path.exists(fullname + ".narf"): ++ return spec_from_loader( ++ fullname, ++ SourceFileLoader(fullname, fullname + ".narf"), ++ ) ++ sys.meta_path.append(MetaPathFinder()) + + def pytest_collect_file(file_path, parent): + if file_path.suffix == ".narf": +- return Module.from_parent(path=file_path, parent=parent)""" ++ return Module.from_parent(path=file_path, parent=parent) ++ """ + ) + pytester.makefile( + ".narf", diff --git a/dev-python/pytest/pytest-7.3.1-r1.ebuild b/dev-python/pytest/pytest-7.3.1-r2.ebuild index a3d210483094..57889af9fc76 100644 --- a/dev-python/pytest/pytest-7.3.1-r1.ebuild +++ b/dev-python/pytest/pytest-7.3.1-r2.ebuild @@ -4,8 +4,8 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_TESTED=( python3_{10..11} pypy3 ) -PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" python3_12 ) +PYTHON_TESTED=( python3_{10..12} pypy3 ) +PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" ) inherit distutils-r1 multiprocessing pypi |