https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/ Issue: dev-python/plumbum-1.7.0 fails tests. Discovered on: amd64 (internal ref: ci)
Created attachment 691389 [details] build.log build log and emerge --info
Possible context of error(s): __main__.py: error: unrecognized arguments: --cov-config=setup.cfg
Very strange. I have >>> Test phase: dev-python/plumbum-1.7.0 * python3_7: running distutils-r1_run_phase python_test python3.7 -m pytest -vv -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.7.10, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3.7 cachedir: .pytest_cache hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/var/tmp/portage/dev-python/plumbum-1.7.0/work/plumbum-1.7.0/.hypothesis/examples') rootdir: /var/tmp/portage/dev-python/plumbum-1.7.0/work/plumbum-1.7.0, configfile: setup.cfg plugins: helpers-namespace-2019.1.8, timeout-1.4.2, cov-2.10.1, hypothesis-6.0.0, xdist-2.2.1, forked-1.3.0, flaky-3.7.0 timeout: 300.0s timeout method: signal timeout func_only: False collecting ... collected 185 items tests/test_3_cli.py::TestProg3::test_prog PASSED [ 0%] ... ========================================================================= short test summary info ========================================================================== SKIPPED [1] tests/test_env.py:16: Something wrong here SKIPPED [1] tests/test_env.py:26: Something wrong here SKIPPED [1] tests/test_local.py:170: Something wrong here SKIPPED [1] tests/test_local.py:805: Not a TTY SKIPPED [1] tests/test_local.py:816: Not a TTY ===================================================================== 180 passed, 5 skipped in 26.50s ====================================================================== In your log file, it seems that pytest is not run at all. From distutils-r1.eclass: # @FUNCTION: distutils_enable_tests # @USAGE: [--install] <test-runner> # @DESCRIPTION: # Set up IUSE, RESTRICT, BDEPEND and python_test() for running tests # with the specified test runner. Also copies the current value # of RDEPEND to test?-BDEPEND. The test-runner argument must be one of: # # - nose: nosetests (dev-python/nose) # - pytest: dev-python/pytest # - setup.py: setup.py test (no deps included) # - unittest: for built-in Python unittest module So, DDEPEND does contain test? ( dev-python/pytest[${PYTHON_USEDEP}], so, it's impossible that you have no pytest installed during this run. I have a few pytest-* packages installed; maybe some of them are needed for testing plumbum? Could you please inform me: (1) what version of dev-python/pytest is installed? (2) what versions of dev-python/pytest-* packages are installed?
Sorry, s/DDEPEND/BDEPEND/
You are supposed to strip pytest options that rely on useless plugins. https://dev.gentoo.org/~mgorny/python-guide/pytest.html#avoiding-dependencies-on-other-pytest-plugins
It was only a wild guess that the problem can be related to plugins. On my fully updated ~amd64 pytest successfully runs all tests, see comment 3. On Agostino's system >>> Test phase: dev-python/plumbum-1.7.0 * python3_7: running distutils-r1_run_phase python_test python3.7 -m pytest -vv -ra ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...] __main__.py: error: unrecognized arguments: --cov-config=setup.cfg inifile: /var/tmp/portage/dev-python/plumbum-1.7.0/work/plumbum-1.7.0/setup.cfg rootdir: /var/tmp/portage/dev-python/plumbum-1.7.0/work/plumbum-1.7.0 pytest does not even collect items, just refuses to run. python_test is default, so, the command line is identical in both cases: python3.7 -m pytest -vv -ra The problem is to understand the difference between my system and Agostino's one.
(In reply to Andrey Grozin from comment #6) > It was only a wild guess that the problem can be related to plugins. > On my fully updated ~amd64 pytest successfully runs all tests, see comment 3. > On Agostino's system > > >>> Test phase: dev-python/plumbum-1.7.0 > * python3_7: running distutils-r1_run_phase python_test > python3.7 -m pytest -vv -ra > ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...] > __main__.py: error: unrecognized arguments: --cov-config=setup.cfg Isn't this because pytest-cov is useless here?
(In reply to Sam James from comment #7) > (In reply to Andrey Grozin from comment #6) > > python3.7 -m pytest -vv -ra > > ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...] > > __main__.py: error: unrecognized arguments: --cov-config=setup.cfg > Isn't this because pytest-cov is useless here? From where does this --cov-config=setup.cfg appear?
(In reply to Andrey Grozin from comment #8) > (In reply to Sam James from comment #7) > > (In reply to Andrey Grozin from comment #6) > > > python3.7 -m pytest -vv -ra > > > ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...] > > > __main__.py: error: unrecognized arguments: --cov-config=setup.cfg > > Isn't this because pytest-cov is useless here? > From where does this --cov-config=setup.cfg appear? It's in setup.cfg: https://github.com/tomerfiliba/plumbum/blob/master/setup.cfg#L68 I believe you need to use mgorny's link: https://dev.gentoo.org/~mgorny/python-guide/pytest.html#avoiding-dependencies-on-other-pytest-plugins so that pytest is not invoked with arguments that need plugins which are useless for Gentoo tests. (We don't want coverage/lint tests when we run tests in Gentoo because they're useless extra deps and don't tell us if something actually works.)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3be5e6a6404edcf14ba51dc90ea940c7d47f7d7 commit d3be5e6a6404edcf14ba51dc90ea940c7d47f7d7 Author: Andrey Grozin <grozin@gentoo.org> AuthorDate: 2021-03-15 09:10:47 +0000 Commit: Andrey Grozin <grozin@gentoo.org> CommitDate: 2021-03-15 09:11:32 +0000 dev-python/plumbum: rum pytest without pytest-cov Closes: https://bugs.gentoo.org/775992 Package-Manager: Portage-3.0.17, Repoman-3.0.2 Signed-off-by: Andrey Grozin <grozin@gentoo.org> dev-python/plumbum/files/plumbum-1.7.0-test.patch | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)