diff --git a/dev-python/pytest-benchmark/Manifest b/dev-python/pytest-benchmark/Manifest new file mode 100644 index 0000000..2c1a043 --- /dev/null +++ b/dev-python/pytest-benchmark/Manifest @@ -0,0 +1,2 @@ +DIST pytest-benchmark-3.4.1.gh.tar.gz 322758 BLAKE2B d29254f412aee0955429e7957fa31e9443b3319bec256b601c456efa7020abbd5b4d9ed43799fda62f53f70f14de3f42a93b29b7366989294f037ec2ee3215fc SHA512 54fb5e3a176578b3c8f339878c7a9d047a0785befcbba42bb68c34b4b636d9b6f6a2097b36c5eefbbcf1a91f943bdae762c7978a0dba1af53514052f513ef4c5 +DIST pytest-benchmark-4.0.0.gh.tar.gz 315989 BLAKE2B 1d0d8692b1c8e4eada2e0e369362d2938c78cfe53c9fc8b6510a7e679fc9efcd8db8ac4add6b67f21f839467557fa109f911374da003c2537f06b08ca013c0a6 SHA512 88636e44c184f5072ad081a89f08e8838a11397e6b88298d7f235b531f894792001b858fc5c810b1399d41ec55de5db9057552fb7544fb405a04c3ba5ffbe329 diff --git a/dev-python/pytest-benchmark/metadata.xml b/dev-python/pytest-benchmark/metadata.xml new file mode 100644 index 0000000..bb332d1 --- /dev/null +++ b/dev-python/pytest-benchmark/metadata.xml @@ -0,0 +1,23 @@ + + + + + lssndrbarbieri@gmail.com + Alessandro Barbieri + + + This plugin tightly integrates into pytest. To use this effectively you should know a thing or two about pytest first. Take a look at the introductory material or watch talks. + + Few notes: + + This plugin benchmarks functions and only that. If you want to measure block of code or whole programs you will need to write a wrapper function. + In a test you can only benchmark one function. If you want to benchmark many functions write more tests or use parametrization http://docs.pytest.org/en/latest/parametrize.html. + To run the benchmarks you simply use pytest to run your "tests". The plugin will automatically do the benchmarking and generate a result table. Run pytest --help for more details. + +This plugin provides a benchmark fixture. This fixture is a callable object that will benchmark any function passed to it. + + + ionelmc/pytest-benchmark + pytest-benchmark + + diff --git a/dev-python/pytest-benchmark/pytest-benchmark-3.4.1.ebuild b/dev-python/pytest-benchmark/pytest-benchmark-3.4.1.ebuild new file mode 100644 index 0000000..a37c92d --- /dev/null +++ b/dev-python/pytest-benchmark/pytest-benchmark-3.4.1.ebuild @@ -0,0 +1,71 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) +DISTUTILS_USE_PEP517=setuptools +inherit distutils-r1 + +DESCRIPTION="py.test fixture for benchmarking code" +HOMEPAGE=" + https://pypi.python.org/pypi/pytest-benchmark/ + https://github.com/ionelmc/pytest-benchmark +" +SRC_URI="https://github.com/ionelmc/${PN}/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64" + +DOCS=( {AUTHORS,CHANGELOG,README}.rst ) + +RDEPEND=" + dev-python/py-cpuinfo[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] +" +BDEPEND="test? ( + dev-python/aspectlib[${PYTHON_USEDEP}] + dev-python/elasticsearch-py[${PYTHON_USEDEP}] + dev-python/freezegun[${PYTHON_USEDEP}] + dev-python/hunter[${PYTHON_USEDEP}] + dev-python/pygal[${PYTHON_USEDEP}] + dev-python/pygaljs[${PYTHON_USEDEP}] + dev-python/pytest-xdist[${PYTHON_USEDEP}] +)" # tests include pytest-xdist integration + +EPYTEST_DESELECT=( + tests/test_cli.py::test_help + tests/test_cli.py::test_help_compare + + # test failures with pytest7, see: + # https://github.com/ionelmc/pytest-benchmark/issues/214 + tests/test_benchmark.py::test_groups + tests/test_benchmark.py::test_group_by_func + tests/test_benchmark.py::test_group_by_fullfunc + tests/test_benchmark.py::test_group_by_param_all + tests/test_benchmark.py::test_group_by_param_select + tests/test_benchmark.py::test_group_by_param_select_multiple + tests/test_benchmark.py::test_group_by_fullname + tests/test_benchmark.py::test_only_override_skip + tests/test_benchmark.py::test_fixtures_also_skipped + tests/test_benchmark.py::test_max_time_min_rounds + tests/test_benchmark.py::test_max_time + tests/test_benchmark.py::test_disable_gc + tests/test_benchmark.py::test_custom_timer + tests/test_benchmark.py::test_sort_by_mean + tests/test_benchmark.py::test_basic + tests/test_benchmark.py::test_skip + tests/test_benchmark.py::test_disable + tests/test_benchmark.py::test_mark_selection + tests/test_benchmark.py::test_only_benchmarks +) + +distutils_enable_tests pytest + +distutils_enable_sphinx docs dev-python/sphinx-py3doc-enhanced-theme + +python_test() { + local -x PYTHONPATH="${S}/tests:${BUILD_DIR}/lib:${PYTHONPATH}" + epytest -o markers=benchmark +} diff --git a/dev-python/pytest-benchmark/pytest-benchmark-4.0.0.ebuild b/dev-python/pytest-benchmark/pytest-benchmark-4.0.0.ebuild new file mode 100644 index 0000000..fb485fd --- /dev/null +++ b/dev-python/pytest-benchmark/pytest-benchmark-4.0.0.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{9..11} ) +DISTUTILS_USE_PEP517=setuptools +inherit distutils-r1 + +DESCRIPTION="py.test fixture for benchmarking code" +HOMEPAGE=" + https://pypi.python.org/pypi/pytest-benchmark/ + https://github.com/ionelmc/pytest-benchmark +" +SRC_URI="https://github.com/ionelmc/${PN}/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64" + +DOCS=( {AUTHORS,CHANGELOG,README}.rst ) + +RDEPEND=" + dev-python/py-cpuinfo[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] +" +BDEPEND="test? ( + dev-python/aspectlib[${PYTHON_USEDEP}] + dev-python/elasticsearch-py[${PYTHON_USEDEP}] + dev-python/freezegun[${PYTHON_USEDEP}] + dev-python/hunter[${PYTHON_USEDEP}] + dev-python/pygal[${PYTHON_USEDEP}] + dev-python/pygaljs[${PYTHON_USEDEP}] + dev-python/pytest-xdist[${PYTHON_USEDEP}] + dev-vcs/git + dev-vcs/mercurial +)" # tests include pytest-xdist integration + +EPYTEST_DESELECT=( + tests/test_cli.py::test_help + tests/test_cli.py::test_help_compare +) + +distutils_enable_tests pytest + +distutils_enable_sphinx docs \ + dev-python/sphinx-py3doc-enhanced-theme