Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_build_deps_on_distutils[packaging] failing in CI #2471

jaraco opened this issue Dec 6, 2020 · 2 comments · Fixed by #2472

test_build_deps_on_distutils[packaging] failing in CI #2471

jaraco opened this issue Dec 6, 2020 · 2 comments · Fixed by #2472


Copy link

jaraco commented Dec 6, 2020

When I run the tests locally, they pass, but in CI, the test is failing thus:

___________________ test_build_deps_on_distutils[packaging] ____________________

request = <FixtureRequest for <Function test_build_deps_on_distutils[packaging]>>
tmpdir_factory = TempdirFactory(_tmppath_factory=TempPathFactory(_given_basetemp=None, _trace=<pluggy._tracing.TagTracerSub object at 0x7f7e5e63a3d0>, _basetemp=PosixPath('/tmp/pytest-of-runner/pytest-0')))
build_dep = 'packaging'

    @pytest.mark.parametrize("build_dep", build_deps)
        sys.version_info < (3, 6), reason='run only on late versions')
    def test_build_deps_on_distutils(request, tmpdir_factory, build_dep):
        All setuptools build dependencies must build without
        if 'pyparsing' in build_dep:
            pytest.xfail(reason="Project imports setuptools unconditionally")
        build_target = tmpdir_factory.mktemp('source')
        build_dir = download_and_extract(request, build_dep, build_target)
        install_target = tmpdir_factory.mktemp('target')
>       output = install(build_dir, install_target)

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
setuptools/tests/ in install
    cmd, cwd=pkg_dir, env=env, stderr=subprocess.STDOUT)
/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/ in check_output
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

input = None, capture_output = False, timeout = None, check = True
popenargs = (['/home/runner/work/setuptools/setuptools/.tox/python/bin/python', '', 'install', '--prefix', '/tmp/pytest-of-runner/pytest-0/target1'],)
kwargs = {'cwd': '/tmp/pytest-of-runner/pytest-0/source1/packaging-20.7', 'env': {'CI': 'true', 'COVERAGE_FILE': '/home/runner/...'COV_CORE_DATAFILE': '/home/runner/work/setuptools/setuptools/.tox/.coverage.python', ...}, 'stderr': -2, 'stdout': -1}
process = <subprocess.Popen object at 0x7f7e40c25110>
stdout = b"/home/runner/work/setuptools/setuptools/.tox/python/bin/python: can't open file '': [Errno 2] No such file or directory\n"
stderr = None, retcode = 2

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
        The other arguments are the same as for the Popen constructor.
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
        with Popen(*popenargs, **kwargs) as process:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
            except:  # Including KeyboardInterrupt, communicate handled that.
                # We don't call process.wait() as .__exit__ does that for us.
            retcode = process.poll()
            if check and retcode:
                raise CalledProcessError(retcode, process.args,
>                                        output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['/home/runner/work/setuptools/setuptools/.tox/python/bin/python', '', 'install', '--prefix', '/tmp/pytest-of-runner/pytest-0/target1']' returned non-zero exit status 2.

/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/ CalledProcessError
Copy link
Member Author

jaraco commented Dec 6, 2020

This issue appears to be due to pypa/packaging#363.

Copy link
Member Author

jaraco commented Dec 6, 2020

The reason the tests pass locally is because the tests were all skipped due to

SKIPPED [9] setuptools/tests/ <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
1 participant