From 643a5121202a0a33fb4d77fbf1c4dde26de3224c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 16 Aug 2023 03:28:34 +0100 Subject: gentoo auto-resync : 16:08:2023 - 03:28:34 --- dev-python/pytest-system-statistics/Manifest | 2 + .../pytest-system-statistics-1.0.2-loader.patch | 43 ++++++++++++++++ .../pytest-system-statistics-1.0.2-r2.ebuild | 57 ++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 dev-python/pytest-system-statistics/files/pytest-system-statistics-1.0.2-loader.patch create mode 100644 dev-python/pytest-system-statistics/pytest-system-statistics-1.0.2-r2.ebuild (limited to 'dev-python/pytest-system-statistics') diff --git a/dev-python/pytest-system-statistics/Manifest b/dev-python/pytest-system-statistics/Manifest index 9eb20476b0a2..6e273548fdea 100644 --- a/dev-python/pytest-system-statistics/Manifest +++ b/dev-python/pytest-system-statistics/Manifest @@ -1,3 +1,5 @@ +AUX pytest-system-statistics-1.0.2-loader.patch 1940 BLAKE2B 1e7e9738d928c72881b7e67715eefe898ced9d1031bc93a9fe899199143dd29d51361a24187fda9e41bc4ee892d7bfdd2ffbb290baf915ba287a546f56c9a34d SHA512 bfbd78c791123fdabd6e2c2c7a8d8ca71488c61a8767d450b8a72fc81a42ec2db9e9c079938f847fb3b5aa33a0ac4bb872c957c1c98e1b6fcd41e403aee4b5c0 DIST pytest-system-statistics-1.0.2.gh.tar.gz 55147 BLAKE2B 9b1217102a23e723090e04652fdd727818e2404bf110e4f54289251eb92f4abb59861ba6c6fc611c843960cf0595fa5cbd636071033327d4e602606e8ab63abf SHA512 1fab5038dde504ab0d5d0f4da851c9a8260849adb38a1196c6399131d77cc24a1926e68310dd0701ed001a20a7fcfb57c5202c5ebfd6de4c85aac4be49fc7347 EBUILD pytest-system-statistics-1.0.2-r1.ebuild 1295 BLAKE2B eae32641beda48982e02f0ed8dd4dd1f1341673c2ce9e56e529e09055becce15e0f5d8001dd8678fe08309c0bbf2f005e1d66e82b4ddd4c69b00fccfe7311097 SHA512 b5e64186a94d5a10e78af2c2b0ebf2e4eba616d8fc0ad0d8d2fa2669d96412f32db4d944f221ce830253902daa947c07e4f61b7cb0a54cabf11607b974ae85d9 +EBUILD pytest-system-statistics-1.0.2-r2.ebuild 1502 BLAKE2B 9376e69e79f2679bbf4e9daa19c22c5b57423b49a9fb1934797bab629a13d3dfcdc30d98614ccd6044aff7e981bdca3e990959a82d0ed9a9b663c11315ef54ab SHA512 289a8dbe549d6b72a15248e791576ff9b005a1f276bd3a799a096b659321f3a84701f814b8bafef294f007a75a1c3f50d8b86f0624a59c317f6626fa1b0738b9 MISC metadata.xml 337 BLAKE2B 00bcf31ed6a7b0b94fe3bc0f3031d64bdd682be4797a4f2878ac0d66012d8c026a7295c923f9081f9e7b1b2dc1fd7c6dc7a4e33dfcd97f80785a737815979313 SHA512 a28c702734f0907afdb667a42e8d2672ab938bb4802f4e55e69de872694176b5424cd7073a9b2caee7dbe856fa511e41447ed30e49cc64d053a14b9ad830766a diff --git a/dev-python/pytest-system-statistics/files/pytest-system-statistics-1.0.2-loader.patch b/dev-python/pytest-system-statistics/files/pytest-system-statistics-1.0.2-loader.patch new file mode 100644 index 000000000000..6d4751759617 --- /dev/null +++ b/dev-python/pytest-system-statistics/files/pytest-system-statistics-1.0.2-loader.patch @@ -0,0 +1,43 @@ +diff --git a/src/pytestsysstats/plugin.py b/src/pytestsysstats/plugin.py +index 4009858..3067f73 100644 +--- a/src/pytestsysstats/plugin.py ++++ b/src/pytestsysstats/plugin.py +@@ -231,20 +231,17 @@ def pytest_sessionstart(session: "Session") -> None: + ): + stats_processes_instance = StatsProcesses() + stats_processes_instance.add("Test Suite Run", os.getpid()) +- else: +- stats_processes_instance = None ++ session.config.pluginmanager.register(stats_processes_instance, "sysstats-processes") + +- session.config.pluginmanager.register(stats_processes_instance, "sysstats-processes") +- +- terminalreporter = session.config.pluginmanager.getplugin( +- "terminalreporter" +- ) # type: "TerminalReporter" +- sys_stats_reporter = SystemStatsReporter( +- config=session.config, +- stats_processes=stats_processes_instance, +- terminalreporter=terminalreporter, +- ) +- session.config.pluginmanager.register(sys_stats_reporter, "sysstats-reporter") ++ terminalreporter = session.config.pluginmanager.getplugin( ++ "terminalreporter" ++ ) # type: "TerminalReporter" ++ sys_stats_reporter = SystemStatsReporter( ++ config=session.config, ++ stats_processes=stats_processes_instance, ++ terminalreporter=terminalreporter, ++ ) ++ session.config.pluginmanager.register(sys_stats_reporter, "sysstats-reporter") + + + @pytest.fixture(scope="session") # type: ignore[misc] +@@ -252,5 +249,5 @@ def stats_processes(request: "SubRequest") -> StatsProcesses: + """ + Session scoped process statistics tracker. + """ +- plugin = request.config.pluginmanager.get_plugin("sysstats-processes") # type: StatsProcesses +- return plugin ++ if request.config.pluginmanager.has_plugin("sysstats-processes"): ++ return request.config.pluginmanager.get_plugin("sysstats-processes") # type: StatsProcesses diff --git a/dev-python/pytest-system-statistics/pytest-system-statistics-1.0.2-r2.ebuild b/dev-python/pytest-system-statistics/pytest-system-statistics-1.0.2-r2.ebuild new file mode 100644 index 000000000000..1b51073f1fb6 --- /dev/null +++ b/dev-python/pytest-system-statistics/pytest-system-statistics-1.0.2-r2.ebuild @@ -0,0 +1,57 @@ +# Copyright 2022-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{9..11} ) +inherit distutils-r1 + +DESCRIPTION="Pytest Plugin Which Reports System Usage Statistics" +HOMEPAGE=" + https://pypi.org/project/pytest-system-statistics/ + https://github.com/saltstack/pytest-system-statistics +" +SRC_URI="https://github.com/saltstack/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.gh.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86" + +RDEPEND=" + >=dev-python/pytest-6.0.0[${PYTHON_USEDEP}] + dev-python/attrs[${PYTHON_USEDEP}] + dev-python/psutil[${PYTHON_USEDEP}] + dev-python/typing-extensions[${PYTHON_USEDEP}] + dev-python/pytest-skip-markers[${PYTHON_USEDEP}] +" +BDEPEND=" + dev-python/wheel[${PYTHON_USEDEP}] + test? ( + dev-python/pytest-subtests[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + "${FILESDIR}/pytest-system-statistics-1.0.2-loader.patch" +) + +distutils_enable_tests pytest + +python_prepare_all() { + sed -e "s/use_scm_version=True/version='${PV}'/" -i setup.py || die + sed -e "/setuptools_scm/ d" -i setup.cfg || die + sed -e "s/tool.setuptools_scm/tool.disabled/" -i pyproject.toml || die + + printf '__version__ = "${PV}"\n' > src/pytestsysstats/version.py || die + + distutils-r1_python_prepare_all +} + +python_test() { + local EPYTEST_DESELECT=( + tests/functional/test_syststats.py::test_proc_sys_stats + tests/functional/test_syststats.py::test_proc_sys_stats_no_children + ) + epytest +} -- cgit v1.2.3