* [gentoo-commits] repo/gentoo:master commit in: dev-python/sybil/, dev-python/sybil/files/
@ 2021-08-19 6:34 Michał Górny
0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2021-08-19 6:34 UTC (permalink / raw
To: gentoo-commits
commit: 2f5ffe12e7767772ea99f7ef9389115e228f9a30
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 19 05:37:53 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Aug 19 06:34:14 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f5ffe12
dev-python/sybil: Port to py3.10
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/sybil/files/sybil-2.0.1-py310.patch | 94 ++++++++++++++++++++++++++
dev-python/sybil/sybil-2.0.1.ebuild | 6 +-
2 files changed, 99 insertions(+), 1 deletion(-)
diff --git a/dev-python/sybil/files/sybil-2.0.1-py310.patch b/dev-python/sybil/files/sybil-2.0.1-py310.patch
new file mode 100644
index 00000000000..15d46bae929
--- /dev/null
+++ b/dev-python/sybil/files/sybil-2.0.1-py310.patch
@@ -0,0 +1,94 @@
+From 022fe7d654bdeba6db6eb26c0f9434f0882174bf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Wed, 9 Jun 2021 10:49:33 +0200
+Subject: [PATCH 1/3] tests: adjust for slightly different whitespace under
+ python3.10
+
+'> raise' is now '> raise' (extra space).
+
+For https://bugzilla.redhat.com/show_bug.cgi?id=1908278.
+The tests now pass with python3-3.9.5-2.fc34.x86_64 and
+python3-3.10.0~b2-3.fc35.x86_64.
+---
+ tests/test_functional.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test_functional.py b/tests/test_functional.py
+index f8d41de..5a2e356 100644
+--- a/tests/test_functional.py
++++ b/tests/test_functional.py
+@@ -99,14 +99,14 @@ def pytest_sessionfinish(self, session):
+ 'sybil teardown 4\n'
+ 'session_fixture teardown')
+ out.then_find('_ fail.rst line=1 column=1 _')
+- out.then_find( "> raise Exception('the start!')")
++ out.then_find( " raise Exception('the start!')")
+ out.then_find('_ fail.rst line=8 column=1 _')
+ out.then_find('Y count was 3 instead of 2')
+ out.then_find('fail.rst:8: SybilFailure')
+ out.then_find('_ fail.rst line=10 column=1 _')
+ out.then_find('ValueError: X count was 3 instead of 4')
+ out.then_find('_ fail.rst line=14 column=1 _')
+- out.then_find("> raise Exception('boom!')")
++ out.then_find(" raise Exception('boom!')")
+ out.then_find('fail.rst:18: Exception')
+
+
+
+From 9723fc90f0b1f8f48c1109d501a31309f93add92 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Wed, 9 Jun 2021 10:50:06 +0200
+Subject: [PATCH 2/3] tests: adjust for different line numbers under python3.10
+
+I think this is related to
+https://docs.python.org/3.10/whatsnew/3.10.html#pep-626-precise-line-numbers-for-debugging-and-other-tools
+
+For https://bugzilla.redhat.com/show_bug.cgi?id=1908278.
+The tests now pass with python3-3.9.5-2.fc34.x86_64 and
+python3-3.10.0~b2-3.fc35.x86_64.
+---
+ tests/test_codeblock.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test_codeblock.py b/tests/test_codeblock.py
+index c9f8b17..c30ae3a 100644
+--- a/tests/test_codeblock.py
++++ b/tests/test_codeblock.py
+@@ -44,7 +44,7 @@ def test_future_imports():
+ )
+ # the future import line drops the firstlineno by 1
+ code = compile_codeblock(regions[0].parsed, document.path)
+- assert code.co_firstlineno == 2
++ assert code.co_firstlineno in (1, 2) # we get 1 under python3.10
+ assert evaluate_region(regions[1], namespace) is None
+ assert buffer.getvalue() == (
+ 'pathalogical worst case for line numbers\n'
+@@ -52,7 +52,7 @@ def test_future_imports():
+ )
+ # the future import line drops the firstlineno by 1
+ code = compile_codeblock(regions[1].parsed, document.path)
+- assert code.co_firstlineno == 8
++ assert code.co_firstlineno in (1, 8) # we get 1 under python3.10
+
+
+ def test_windows_line_endings(tmp_path):
+
+From 11862367a760045cc34c11cf888b04f9ca6f4e2d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Wed, 9 Jun 2021 10:51:56 +0200
+Subject: [PATCH 3/3] gitignore: ignore __pycache__ directories
+
+---
+ .gitignore | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/.gitignore b/.gitignore
+index ee824be..0afa48a 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -5,4 +5,5 @@
+ .coverage*
+ _build/
+ .*cache/
++__pycache__/
+ pytestdebug.log
diff --git a/dev-python/sybil/sybil-2.0.1.ebuild b/dev-python/sybil/sybil-2.0.1.ebuild
index 0e19bc2316f..84763f93566 100644
--- a/dev-python/sybil/sybil-2.0.1.ebuild
+++ b/dev-python/sybil/sybil-2.0.1.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{8..9} )
+PYTHON_COMPAT=( python3_{8..10} )
inherit distutils-r1
DESCRIPTION="Automated testing for the examples in your documentation"
@@ -15,3 +15,7 @@ SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ~riscv x86"
distutils_enable_tests pytest
+
+PATCHES=(
+ "${FILESDIR}"/${P}-py310.patch
+)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/sybil/, dev-python/sybil/files/
@ 2021-12-02 9:57 Michał Górny
0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2021-12-02 9:57 UTC (permalink / raw
To: gentoo-commits
commit: 4ad4303ec9ffbaffa02cece5a31790d055af4e6a
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 2 09:41:56 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec 2 09:41:56 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ad4303e
dev-python/sybil: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/sybil/Manifest | 1 -
dev-python/sybil/files/sybil-2.0.1-py310.patch | 94 --------------------------
dev-python/sybil/sybil-2.0.1.ebuild | 21 ------
3 files changed, 116 deletions(-)
diff --git a/dev-python/sybil/Manifest b/dev-python/sybil/Manifest
index d344d3574395..b9f456145acf 100644
--- a/dev-python/sybil/Manifest
+++ b/dev-python/sybil/Manifest
@@ -1,2 +1 @@
-DIST sybil-2.0.1.tar.gz 29316 BLAKE2B cf03bc1595efab535d1248b9d267dcd01547f02539977c12b8753e70d13ea0744a6ab76dc1e44fd1c46d192577aa4c1a9b5d5d52678928acfd63937358fa3e33 SHA512 4f3be7686c1acf6812623a756fa79b41e3fbe5d4c3b4c7cf5dfe39fbe56806b4ef3acd24e25968ab9119b2c65ad5c30eabe32f1a93fb62ba8d3893ef123e69f0
DIST sybil-3.0.0.tar.gz 38011 BLAKE2B 7a42d5b0f3f13ac111d9edc9f74cb4d968f49680bb33d267ee762e830b134fa8c2e1697834d6a6a7aa09c9cd1dc52552379ca43e6667ee844f54f34b8bd3ffc7 SHA512 b6f5b5ebdeeab2ecbe17b6f83f0bc7e83e68f8e784b6a0eea292020db42294f8a1d0288d208f8a5803d5866038c3226f0b7d0d177c91469c4651364078d1bb4d
diff --git a/dev-python/sybil/files/sybil-2.0.1-py310.patch b/dev-python/sybil/files/sybil-2.0.1-py310.patch
deleted file mode 100644
index 15d46bae929b..000000000000
--- a/dev-python/sybil/files/sybil-2.0.1-py310.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From 022fe7d654bdeba6db6eb26c0f9434f0882174bf Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Wed, 9 Jun 2021 10:49:33 +0200
-Subject: [PATCH 1/3] tests: adjust for slightly different whitespace under
- python3.10
-
-'> raise' is now '> raise' (extra space).
-
-For https://bugzilla.redhat.com/show_bug.cgi?id=1908278.
-The tests now pass with python3-3.9.5-2.fc34.x86_64 and
-python3-3.10.0~b2-3.fc35.x86_64.
----
- tests/test_functional.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/tests/test_functional.py b/tests/test_functional.py
-index f8d41de..5a2e356 100644
---- a/tests/test_functional.py
-+++ b/tests/test_functional.py
-@@ -99,14 +99,14 @@ def pytest_sessionfinish(self, session):
- 'sybil teardown 4\n'
- 'session_fixture teardown')
- out.then_find('_ fail.rst line=1 column=1 _')
-- out.then_find( "> raise Exception('the start!')")
-+ out.then_find( " raise Exception('the start!')")
- out.then_find('_ fail.rst line=8 column=1 _')
- out.then_find('Y count was 3 instead of 2')
- out.then_find('fail.rst:8: SybilFailure')
- out.then_find('_ fail.rst line=10 column=1 _')
- out.then_find('ValueError: X count was 3 instead of 4')
- out.then_find('_ fail.rst line=14 column=1 _')
-- out.then_find("> raise Exception('boom!')")
-+ out.then_find(" raise Exception('boom!')")
- out.then_find('fail.rst:18: Exception')
-
-
-
-From 9723fc90f0b1f8f48c1109d501a31309f93add92 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Wed, 9 Jun 2021 10:50:06 +0200
-Subject: [PATCH 2/3] tests: adjust for different line numbers under python3.10
-
-I think this is related to
-https://docs.python.org/3.10/whatsnew/3.10.html#pep-626-precise-line-numbers-for-debugging-and-other-tools
-
-For https://bugzilla.redhat.com/show_bug.cgi?id=1908278.
-The tests now pass with python3-3.9.5-2.fc34.x86_64 and
-python3-3.10.0~b2-3.fc35.x86_64.
----
- tests/test_codeblock.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/tests/test_codeblock.py b/tests/test_codeblock.py
-index c9f8b17..c30ae3a 100644
---- a/tests/test_codeblock.py
-+++ b/tests/test_codeblock.py
-@@ -44,7 +44,7 @@ def test_future_imports():
- )
- # the future import line drops the firstlineno by 1
- code = compile_codeblock(regions[0].parsed, document.path)
-- assert code.co_firstlineno == 2
-+ assert code.co_firstlineno in (1, 2) # we get 1 under python3.10
- assert evaluate_region(regions[1], namespace) is None
- assert buffer.getvalue() == (
- 'pathalogical worst case for line numbers\n'
-@@ -52,7 +52,7 @@ def test_future_imports():
- )
- # the future import line drops the firstlineno by 1
- code = compile_codeblock(regions[1].parsed, document.path)
-- assert code.co_firstlineno == 8
-+ assert code.co_firstlineno in (1, 8) # we get 1 under python3.10
-
-
- def test_windows_line_endings(tmp_path):
-
-From 11862367a760045cc34c11cf888b04f9ca6f4e2d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Wed, 9 Jun 2021 10:51:56 +0200
-Subject: [PATCH 3/3] gitignore: ignore __pycache__ directories
-
----
- .gitignore | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/.gitignore b/.gitignore
-index ee824be..0afa48a 100644
---- a/.gitignore
-+++ b/.gitignore
-@@ -5,4 +5,5 @@
- .coverage*
- _build/
- .*cache/
-+__pycache__/
- pytestdebug.log
diff --git a/dev-python/sybil/sybil-2.0.1.ebuild b/dev-python/sybil/sybil-2.0.1.ebuild
deleted file mode 100644
index 64290a699b51..000000000000
--- a/dev-python/sybil/sybil-2.0.1.ebuild
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2019-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit distutils-r1
-
-DESCRIPTION="Automated testing for the examples in your documentation"
-HOMEPAGE="https://github.com/cjw296/sybil"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="amd64 ~arm arm64 ~riscv x86"
-
-distutils_enable_tests pytest
-
-PATCHES=(
- "${FILESDIR}"/${P}-py310.patch
-)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/sybil/, dev-python/sybil/files/
@ 2024-01-29 14:53 Michał Górny
0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2024-01-29 14:53 UTC (permalink / raw
To: gentoo-commits
commit: 641ddb19001069f92660b78b8877805fe23680d7
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 29 14:43:52 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jan 29 14:53:30 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=641ddb19
dev-python/sybil: Add a fix for pytest-8
Closes: https://bugs.gentoo.org/923237
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/sybil/files/sybil-6.0.2-pytest-8.patch | 40 ++++++++++++++++++++++
.../{sybil-6.0.2.ebuild => sybil-6.0.2-r1.ebuild} | 12 ++++++-
2 files changed, 51 insertions(+), 1 deletion(-)
diff --git a/dev-python/sybil/files/sybil-6.0.2-pytest-8.patch b/dev-python/sybil/files/sybil-6.0.2-pytest-8.patch
new file mode 100644
index 000000000000..2447289c0266
--- /dev/null
+++ b/dev-python/sybil/files/sybil-6.0.2-pytest-8.patch
@@ -0,0 +1,40 @@
+From d7428b4cfe5f817037030d025028bf09fd7992ee Mon Sep 17 00:00:00 2001
+From: Adam Dangoor <adamdangoor@gmail.com>
+Date: Mon, 29 Jan 2024 11:29:16 +0000
+Subject: [PATCH] Add fixes for Pytest 8.0.0
+
+---
+ CHANGELOG.rst | 5 +++++
+ sybil/integration/pytest.py | 17 +++++++++++++----
+ 2 files changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/sybil/integration/pytest.py b/sybil/integration/pytest.py
+index 8ce6c72..cad311d 100644
+--- a/sybil/integration/pytest.py
++++ b/sybil/integration/pytest.py
+@@ -53,12 +53,21 @@ def __init__(self, parent, sybil, example: Example) -> None:
+ def request_fixtures(self, names):
+ # pytest fixtures dance:
+ fm = self.session._fixturemanager
+- closure = fm.getfixtureclosure(names, self)
+- initialnames, names_closure, arg2fixturedefs = closure
+- fixtureinfo = FuncFixtureInfo(names, initialnames, names_closure, arg2fixturedefs)
++ if PYTEST_VERSION >= (8, 0, 0):
++ closure = fm.getfixtureclosure(initialnames=names, parentnode=self, ignore_args=set())
++ names_closure, arg2fixturedefs = closure
++ fixtureinfo = FuncFixtureInfo(argnames=names, initialnames=names, names_closure=names_closure, name2fixturedefs=arg2fixturedefs)
++ else:
++ closure = fm.getfixtureclosure(names, self)
++ initialnames, names_closure, arg2fixturedefs = closure
++ fixtureinfo = FuncFixtureInfo(names, initialnames, names_closure, arg2fixturedefs)
+ self._fixtureinfo = fixtureinfo
+ self.funcargs = {}
+- self._request = fixtures.FixtureRequest(self, _ispytest=True)
++ if PYTEST_VERSION >= (8, 0, 0):
++ self._request = fixtures.TopRequest(pyfuncitem=self, _ispytest=True)
++ self.fixturenames = names_closure
++ else:
++ self._request = fixtures.FixtureRequest(self, _ispytest=True)
+
+ def reportinfo(self) -> Tuple[Union["os.PathLike[str]", str], Optional[int], str]:
+ info = '%s line=%i column=%i' % (
diff --git a/dev-python/sybil/sybil-6.0.2.ebuild b/dev-python/sybil/sybil-6.0.2-r1.ebuild
similarity index 77%
rename from dev-python/sybil/sybil-6.0.2.ebuild
rename to dev-python/sybil/sybil-6.0.2-r1.ebuild
index 27065ab0f6bb..0a280c114202 100644
--- a/dev-python/sybil/sybil-6.0.2.ebuild
+++ b/dev-python/sybil/sybil-6.0.2-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2019-2023 Gentoo Authors
+# Copyright 2019-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -32,3 +32,13 @@ BDEPEND="
"
distutils_enable_tests pytest
+
+PATCHES=(
+ # https://github.com/simplistix/sybil/pull/108
+ "${FILESDIR}/${P}-pytest-8.patch"
+)
+
+python_test() {
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ epytest
+}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-29 14:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-29 14:53 [gentoo-commits] repo/gentoo:master commit in: dev-python/sybil/, dev-python/sybil/files/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2021-12-02 9:57 Michał Górny
2021-08-19 6:34 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox