[arch-commits] Commit in python-pytest-benchmark/repos/community-staging-any (3 files)
Felix Yan
felixonmars at gemini.archlinux.org
Tue Dec 7 14:14:32 UTC 2021
Date: Tuesday, December 7, 2021 @ 14:14:32
Author: felixonmars
Revision: 1065544
archrelease: copy trunk to community-staging-any
Added:
python-pytest-benchmark/repos/community-staging-any/PKGBUILD
(from rev 1065543, python-pytest-benchmark/trunk/PKGBUILD)
python-pytest-benchmark/repos/community-staging-any/python310.patch
(from rev 1065543, python-pytest-benchmark/trunk/python310.patch)
Deleted:
python-pytest-benchmark/repos/community-staging-any/PKGBUILD
-----------------+
PKGBUILD | 87 ++++++++++++++++++++++++++++--------------------------
python310.patch | 62 ++++++++++++++++++++++++++++++++++++++
2 files changed, 108 insertions(+), 41 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2021-12-07 14:14:22 UTC (rev 1065543)
+++ PKGBUILD 2021-12-07 14:14:32 UTC (rev 1065544)
@@ -1,41 +0,0 @@
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-
-pkgname=python-pytest-benchmark
-pkgver=3.4.1
-pkgrel=2
-pkgdesc='A py.test fixture for benchmarking code'
-arch=('any')
-license=('BSD')
-url='https://github.com/ionelmc/pytest-benchmark'
-depends=('python-pytest' 'python-py-cpuinfo')
-makedepends=('python-setuptools')
-checkdepends=('python-pygal' 'python-freezegun' 'mercurial' 'python-aspectlib'
- 'python-pytest-xdist' 'python-elasticsearch' 'git')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/ionelmc/pytest-benchmark/archive/v$pkgver.tar.gz")
-sha512sums=('54fb5e3a176578b3c8f339878c7a9d047a0785befcbba42bb68c34b4b636d9b6f6a2097b36c5eefbbcf1a91f943bdae762c7978a0dba1af53514052f513ef4c5')
-
-prepare() {
- cd pytest-benchmark-$pkgver
- sed -i 's/\[glob_or_file ...]]/...]/' tests/test_cli.py
-}
-
-build() {
- cd pytest-benchmark-$pkgver
- python setup.py build
-}
-
-check() {
- # Hack entry points by installing it
-
- cd pytest-benchmark-$pkgver
- python setup.py install --root="$PWD/tmp_install" --optimize=1
- PYTHONPATH="$PWD/tmp_install/usr/lib/python3.10/site-packages:$PYTHONPATH" PATH="$PWD/tmp_install/usr/bin:$PATH" python -m pytest tests
-}
-
-package() {
- cd "$srcdir"/pytest-benchmark-$pkgver
- python setup.py install --root="$pkgdir"/ --optimize=1
- install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
-}
-
-# vim:set ts=2 sw=2 et:
Copied: python-pytest-benchmark/repos/community-staging-any/PKGBUILD (from rev 1065543, python-pytest-benchmark/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2021-12-07 14:14:32 UTC (rev 1065544)
@@ -0,0 +1,46 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgname=python-pytest-benchmark
+pkgver=3.4.1
+pkgrel=3
+pkgdesc='A py.test fixture for benchmarking code'
+arch=('any')
+license=('BSD')
+url='https://github.com/ionelmc/pytest-benchmark'
+depends=('python-pytest' 'python-py-cpuinfo')
+makedepends=('python-setuptools')
+checkdepends=('python-pygal' 'python-freezegun' 'mercurial' 'python-aspectlib'
+ 'python-pytest-xdist' 'python-elasticsearch' 'git')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/ionelmc/pytest-benchmark/archive/v$pkgver.tar.gz"
+ python310.patch)
+sha512sums=('54fb5e3a176578b3c8f339878c7a9d047a0785befcbba42bb68c34b4b636d9b6f6a2097b36c5eefbbcf1a91f943bdae762c7978a0dba1af53514052f513ef4c5'
+ '8f1c062bc502ea8ec0421509576bc1042354a5bc49f918ff7ceb8360387405f1897b1b79a1700d5ed506c326214a6222fc41353f68eeb72e37914e27ed30b1aa')
+
+prepare() {
+ cd pytest-benchmark-$pkgver
+ sed -i 's/\[glob_or_file ...]]/...]/' tests/test_cli.py
+
+ # https://github.com/ionelmc/pytest-benchmark/pull/210
+ patch -Np1 -i ../python310.patch
+}
+
+build() {
+ cd pytest-benchmark-$pkgver
+ python setup.py build
+}
+
+check() {
+ # Hack entry points by installing it
+
+ cd pytest-benchmark-$pkgver
+ python setup.py install --root="$PWD/tmp_install" --optimize=1
+ PYTHONPATH="$PWD/tmp_install/usr/lib/python3.10/site-packages:$PYTHONPATH" PATH="$PWD/tmp_install/usr/bin:$PATH" python -m pytest tests
+}
+
+package() {
+ cd "$srcdir"/pytest-benchmark-$pkgver
+ python setup.py install --root="$pkgdir"/ --optimize=1
+ install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
+
+# vim:set ts=2 sw=2 et:
Copied: python-pytest-benchmark/repos/community-staging-any/python310.patch (from rev 1065543, python-pytest-benchmark/trunk/python310.patch)
===================================================================
--- python310.patch (rev 0)
+++ python310.patch 2021-12-07 14:14:32 UTC (rev 1065544)
@@ -0,0 +1,62 @@
+From b8c7d662f7b58ce48124c69082acf48acd0539bb Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos at foutrelis.com>
+Date: Tue, 7 Dec 2021 15:55:02 +0200
+Subject: [PATCH] Fix test_cli.py::test_help* to work on Python 3.10
+
+From Python 3.10 release notes:
+
+Misleading phrase "optional arguments" was replaced with "options" in
+argparse help. Some tests might require adaptation if they rely on exact
+output match. (Contributed by Raymond Hettinger in bpo-9694.)
+---
+ tests/test_cli.py | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/tests/test_cli.py b/tests/test_cli.py
+index c71ef22..be082ad 100644
+--- a/tests/test_cli.py
++++ b/tests/test_cli.py
+@@ -9,6 +9,7 @@ pytest_plugins = 'pytester',
+
+ THIS = py.path.local(__file__)
+ STORAGE = THIS.dirpath('test_storage')
++OPTIONS = 'options' if sys.version_info >= (3, 10) else 'optional arguments'
+
+
+ @pytest.fixture
+@@ -26,7 +27,7 @@ def test_help(testdir):
+ "",
+ "pytest_benchmark's management commands.",
+ "",
+- "optional arguments:",
++ "%s:" % OPTIONS,
+ " -h [COMMAND], --help [COMMAND]",
+ " Display help and exit.",
+ " --storage URI, -s URI",
+@@ -57,7 +58,7 @@ def test_help_command(testdir):
+ 'positional arguments:',
+ ' command',
+ '',
+- 'optional arguments:',
++ '%s:' % OPTIONS,
+ ' -h, --help show this help message and exit',
+ ])
+
+@@ -70,7 +71,7 @@ def test_help_list(testdir, args):
+ "",
+ "List saved runs.",
+ "",
+- "optional arguments:",
++ "%s:" % OPTIONS,
+ " -h, --help show this help message and exit",
+ ])
+ assert result.ret == 0
+@@ -92,7 +93,7 @@ def test_help_compare(testdir, args):
+ " glob_or_file Glob or exact path for json files. If not specified",
+ " all runs are loaded.",
+ "",
+- "optional arguments:",
++ "%s:" % OPTIONS,
+ " -h, --help show this help message and exit",
+ " --sort COL Column to sort on. Can be one of: 'min', 'max',",
+ " 'mean', 'stddev', 'name', 'fullname'. Default: 'min'",
More information about the arch-commits
mailing list