diff options
author | DrRac27 | 2023-06-09 09:46:56 +0200 |
---|---|---|
committer | DrRac27 | 2023-06-09 09:46:56 +0200 |
commit | 2fdb50b5c242f163fd86cd20ae08836d8f964d54 (patch) | |
tree | 4691c7d7e93f28d98f8888cd6abe2ca4afc860b4 | |
parent | 547e81ad9152317b49486a2c49a0f8e86f95dadb (diff) | |
download | aur-2fdb50b5c242f163fd86cd20ae08836d8f964d54.tar.gz |
fix build by moving from py.test to pytest
-rw-r--r-- | 0001-replace-py-with-pytest.patch | 212 | ||||
-rw-r--r-- | PKGBUILD | 20 |
2 files changed, 228 insertions, 4 deletions
diff --git a/0001-replace-py-with-pytest.patch b/0001-replace-py-with-pytest.patch new file mode 100644 index 000000000000..b687617a9b62 --- /dev/null +++ b/0001-replace-py-with-pytest.patch @@ -0,0 +1,212 @@ +From a15a815d1237fe220bcc42932eeb0387da5939af Mon Sep 17 00:00:00 2001 +From: Ben Greiner <code@bnavigator.de> +Date: Sat, 21 Jan 2023 20:03:36 +0100 +Subject: [PATCH 1/5] py is deprecated + +--- + tests/test_ztranslation.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_ztranslation.py b/tests/test_ztranslation.py +index b4baf69..3a33ce0 100644 +--- a/tests/test_ztranslation.py ++++ b/tests/test_ztranslation.py +@@ -1,11 +1,11 @@ + import re + +-import py ++import pytest + + try: + from rpython.rtyper.test.test_llinterp import interpret + except ImportError: +- pytestmark = py.test.mark.skip("Needs RPython to be on the PYTHONPATH") ++ pytestmark = pytest.mark.skip("Needs RPython to be on the PYTHONPATH") + + from rply import LexerGenerator, ParserGenerator, Token + from rply.errors import ParserGeneratorWarning +-- +2.40.1 + + +From c04b00c65144bfb4556616377475a9c1986fd49c Mon Sep 17 00:00:00 2001 +From: Ben Greiner <code@bnavigator.de> +Date: Sat, 21 Jan 2023 20:04:29 +0100 +Subject: [PATCH 2/5] Update tox.ini + +--- + tox.ini | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tox.ini b/tox.ini +index 13155c8..fd45235 100644 +--- a/tox.ini ++++ b/tox.ini +@@ -6,7 +6,7 @@ deps = pytest + # just running tox with PYTHONPATH=pypy tox fails, see + # https://bitbucket.org/hpk42/tox/issue/146/setting-pythonpath-causes-tox-to-crash + setenv = PYTHONPATH={env:PYPY_LOCATION} +-commands = py.test ++commands = pytest + + [testenv:docs] + deps = sphinx +-- +2.40.1 + + +From 8caf19f547082dc340c2891d7f6368081b74d212 Mon Sep 17 00:00:00 2001 +From: Ben Greiner <code@bnavigator.de> +Date: Sat, 21 Jan 2023 20:07:57 +0100 +Subject: [PATCH 3/5] Update test_utils.py + +--- + tests/test_utils.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_utils.py b/tests/test_utils.py +index 19e674f..9c2ab79 100644 +--- a/tests/test_utils.py ++++ b/tests/test_utils.py +@@ -1,6 +1,6 @@ + from operator import itemgetter + +-import py ++import pytest + + from rply.utils import IdentityDict + +@@ -20,7 +20,7 @@ class TestIdentityDict(object): + x = [] + d[x] = "hello" + del d[x] +- with py.test.raises(KeyError): ++ with pytest.raises(KeyError): + d[x] + + def test_len(self): +-- +2.40.1 + + +From 756be0670400e1dbf4a4eb5d12ced63c7cf48ecc Mon Sep 17 00:00:00 2001 +From: Ben Greiner <code@bnavigator.de> +Date: Sat, 21 Jan 2023 20:09:12 +0100 +Subject: [PATCH 4/5] Update test_parsergenerator.py + +--- + tests/test_parsergenerator.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/tests/test_parsergenerator.py b/tests/test_parsergenerator.py +index 0316399..62e4825 100644 +--- a/tests/test_parsergenerator.py ++++ b/tests/test_parsergenerator.py +@@ -1,6 +1,6 @@ + import uuid + +-import py ++import pytest + + from rply import ParserGenerator, Token + from rply.errors import ParserGeneratorError +@@ -11,7 +11,7 @@ from .base import BaseTests + class TestParserGenerator(BaseTests): + def test_production_syntax_error(self): + pg = ParserGenerator([]) +- with py.test.raises(ParserGeneratorError): ++ with pytest.raises(ParserGeneratorError): + pg.production("main VALUE") + + def test_production_terminal_overlap(self): +@@ -21,7 +21,7 @@ class TestParserGenerator(BaseTests): + def x(p): + pass + +- with py.test.raises(ParserGeneratorError): ++ with pytest.raises(ParserGeneratorError): + pg.build() + + def test_duplicate_precedence(self): +@@ -29,7 +29,7 @@ class TestParserGenerator(BaseTests): + ("left", ["term", "term"]) + ]) + +- with py.test.raises(ParserGeneratorError): ++ with pytest.raises(ParserGeneratorError): + pg.build() + + def test_invalid_associativity(self): +@@ -37,7 +37,7 @@ class TestParserGenerator(BaseTests): + ("to-the-left", ["term"]), + ]) + +- with py.test.raises(ParserGeneratorError): ++ with pytest.raises(ParserGeneratorError): + pg.build() + + def test_nonexistent_precedence(self): +@@ -47,7 +47,7 @@ class TestParserGenerator(BaseTests): + def main(p): + pass + +- with py.test.raises(ParserGeneratorError): ++ with pytest.raises(ParserGeneratorError): + pg.build() + + def test_error_symbol(self): +-- +2.40.1 + + +From cf76ce0c47928dc9778f44a0cd2a23a6b959798c Mon Sep 17 00:00:00 2001 +From: Ben Greiner <code@bnavigator.de> +Date: Sat, 21 Jan 2023 20:10:12 +0100 +Subject: [PATCH 5/5] Update test_parser.py + +--- + tests/test_parser.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/test_parser.py b/tests/test_parser.py +index 6cdf68f..51b7647 100644 +--- a/tests/test_parser.py ++++ b/tests/test_parser.py +@@ -1,6 +1,6 @@ + import operator + +-import py ++import pytest + + from rply import ParserGenerator, ParsingError, Token + from rply.errors import ParserGeneratorWarning +@@ -157,7 +157,7 @@ class TestParser(BaseTests): + + parser = pg.build() + +- with py.test.raises(ParsingError) as exc_info: ++ with pytest.raises(ParsingError) as exc_info: + parser.parse(iter([ + Token("VALUE", "hello"), + Token("VALUE", "world", SourcePosition(5, 10, 2)), +@@ -181,7 +181,7 @@ class TestParser(BaseTests): + + token = Token("VALUE", "world") + +- with py.test.raises(ValueError) as exc_info: ++ with pytest.raises(ValueError) as exc_info: + parser.parse(iter([ + Token("VALUE", "hello"), + token +@@ -236,7 +236,7 @@ class TestParser(BaseTests): + + state = ParserState() + token = Token("VALUE", "") +- with py.test.raises(ValueError) as exc_info: ++ with pytest.raises(ValueError) as exc_info: + parser.parse(iter([token]), state=state) + + assert exc_info.value.args[0] is state +-- +2.40.1 + @@ -1,4 +1,5 @@ -# Maintainer: Felix Yan <felixonmars@archlinux.org> +# Maintainer: DrRac27 <drrac27 at riseup dot net> +# Contributor: Felix Yan <felixonmars@archlinux.org> pkgname=python-rply pkgver=0.7.8 @@ -9,8 +10,19 @@ license=('BSD') url="https://rply.readthedocs.org" makedepends=('python-setuptools' 'python-appdirs') checkdepends=('python-pytest') -source=("$pkgname-$pkgver.tar.gz::https://github.com/alex/rply/archive/v$pkgver.tar.gz") -sha512sums=('b43e6425f046561cfca616801d37d7151f015aeb2ea2365abc00f97fd6b41f1a01a17e330aed5a81537065e4b29d49cd0824b5a5cb8b2d11da2ff1f8de952fce') +source=( + "$pkgname-$pkgver.tar.gz::https://github.com/alex/rply/archive/v$pkgver.tar.gz" + '0001-replace-py-with-pytest.patch' +) +sha512sums=( + 'b43e6425f046561cfca616801d37d7151f015aeb2ea2365abc00f97fd6b41f1a01a17e330aed5a81537065e4b29d49cd0824b5a5cb8b2d11da2ff1f8de952fce' + 'f22b2e300a43f44755668a3984525639968347f3bcb0c220829590af4da7eca4877230ec27b844dab6da27655ab75fe867ce04a8b67822d5a9b3a4c3cafcd537' +) + +prepare() { + cd "$srcdir" + patch -p1 -d rply-$pkgver < '0001-replace-py-with-pytest.patch' +} build() { cd "$srcdir"/rply-$pkgver @@ -19,7 +31,7 @@ build() { check() { cd "$srcdir"/rply-$pkgver - py.test + pytest } package() { |