Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664534 - dev-python/setuptools_scm-1.15.6-r1 fails test suite if dev-python/pip is not installed
Summary: dev-python/setuptools_scm-1.15.6-r1 fails test suite if dev-python/pip is not...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2018-08-25 06:11 UTC by Maram
Modified: 2020-03-29 08:32 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maram 2018-08-25 06:11:57 UTC
The test suite of setuptools_scm has a test which utilises pip and which fails if pip is not found.

```
testing/test_regressions.py::test_pip_download FAILED

============================== FAILURES ===================================================================
____________________________________________ test_pip_download ______________________________________________

tmpdir = local('/var/tmp/portage/dev-python/setuptools_scm-1.15.6-r1/temp/pytest-of-portage/pytest-8/test_pip_download0'), monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x392db21a160>

    @pytest.mark.issue(164)
    def test_pip_download(tmpdir, monkeypatch):
        monkeypatch.chdir(tmpdir)
        subprocess.check_call([
            sys.executable, '-c',
>           'import pip;pip.main()', 'download', 'lz4==0.9.0',
        ])

../../../../work/setuptools_scm-1.15.6/testing/test_regressions.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

popenargs = (['/usr/bin/python3.6', '-c', 'import pip;pip.main()', 'download', 'lz4==0.9.0'],), kwargs = {}, retcode = 1, cmd = ['/usr/bin/python3.6', '-c', 'import pip;pip.main()', 'download', 'lz4==0.9.0']

    def check_call(*popenargs, **kwargs):
        """Run command with arguments.  Wait for command to complete.  If
        the exit code was zero then return, otherwise raise
        CalledProcessError.  The CalledProcessError object will have the
        return code in the returncode attribute.

        The arguments are the same as for the call function.  Example:

        check_call(["ls", "-l"])
        """ 
        retcode = call(*popenargs, **kwargs)
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
>           raise CalledProcessError(retcode, cmd)
E           subprocess.CalledProcessError: Command '['/usr/bin/python3.6', '-c', 'import pip;pip.main()', 'download', 'lz4==0.9.0']' returned non-zero exit status 1.

/usr/lib64/python3.6/subprocess.py:291: CalledProcessError
----------------------------------------- Captured stderr call -----------------------------------------
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pip'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
```

(In my case pip was only installed for PYTHON_TARGETS python3_4 but not python3_6).

Installing dev-python/pip for the correct PYTHON_TARGETS solves the problem.

Suggestion add "test? (dev-python/pip[${PYTHON_USEDEP}])" or similar to DEPEND.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-03-29 08:32:46 UTC
Old version removed.  Please reopen if it still happens.