Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 775992 - dev-python/plumbum-1.7.0 fails tests (error: unrecognized arguments: --cov-config=setup.cfg)
Summary: dev-python/plumbum-1.7.0 fails tests (error: unrecognized arguments: --cov-co...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Andrey Grozin
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-14 12:42 UTC by Agostino Sarubbo
Modified: 2021-03-15 09:11 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,32.77 KB, text/plain)
2021-03-14 12:42 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2021-03-14 12:42:12 UTC
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)
Comment 1 Agostino Sarubbo gentoo-dev 2021-03-14 12:42:15 UTC
Created attachment 691389 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2021-03-14 12:42:16 UTC
Possible context of error(s):

__main__.py: error: unrecognized arguments: --cov-config=setup.cfg
Comment 3 Andrey Grozin gentoo-dev 2021-03-14 14:22:41 UTC
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?
Comment 4 Andrey Grozin gentoo-dev 2021-03-14 14:24:07 UTC
Sorry, s/DDEPEND/BDEPEND/
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-03-14 15:10:22 UTC
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
Comment 6 Andrey Grozin gentoo-dev 2021-03-14 17:03:15 UTC
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.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-14 22:54:19 UTC
(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?
Comment 8 Andrey Grozin gentoo-dev 2021-03-15 03:39:15 UTC
(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?
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-15 03:54:26 UTC
(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.)
Comment 10 Larry the Git Cow gentoo-dev 2021-03-15 09:11:47 UTC
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(-)