You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
pre-commit hook virtualenv installation fails:
❯ docker build . Sending build context to Docker daemon 39.94kB
Step 1/5 : FROM python:3.8 ---> efdecc2e377a Step 2/5 : WORKDIR /code ---> Using cache
---> 8a15c6aceb6b Step 3/5 : COPY .pre-commit-config.yaml /code ---> Using cache ---> 71212226c81f
Step 4/5 : RUN pip install pre-commit #"virtualenv<20.0.6"
---> Using cache
---> 7066cf6ec7a7
Step 5/5 : RUN git init && pre-commit install-hooks
---> Running in 4a267bf3ad20
Initialized empty Git repository in /code/.git/
[INFO] Initializing environment for https://github.com/psf/black.
[INFO] Installing environment for https://github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/bin/python', '/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/bin/pip', 'install', '.')
return code: 1
expected return code: 0
stdout:
Processing /root/.cache/pre-commit/repo3n2l47dt
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'error'
stderr:
ERROR: Command errored out with exit status 1:
command: /root/.cache/pre-commit/repo3n2l47dt/py_env-python3/bin/python /root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpfyf3jze9
cwd: /tmp/pip-req-build-zap8gmaa
Complete output (40 lines):
/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/bin/python: No module named pip
Traceback (most recent call last):
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/setuptools/installer.py", line 128, in fetch_build_egg
subprocess.check_call(cmd)
File "/usr/local/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpy7yod92e', '--quiet', 'setuptools_scm']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 257, in <module>
main()
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 240, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 110, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/setuptools/build_meta.py", line 158, in prepare_metadata_for_build_wheel
self.run_setup()
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/setuptools/build_meta.py", line 143, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 18, in <module>
setup(
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/setuptools/__init__.py", line 143, in setup
_install_setup_requires(attrs)
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/setuptools/__init__.py", line 138, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/setuptools/dist.py", line 718, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 781, in resolve
dist = best[req.key] = env.best_match(
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1066, in best_match
return self.obtain(req, installer)
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1078, in obtain
return installer(requirement)
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/setuptools/dist.py", line 777, in fetch_build_egg
return fetch_build_egg(self, req)
File "/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/setuptools/installer.py", line 130, in fetch_build_egg
raise DistutilsError(str(e))
distutils.errors.DistutilsError: Command '['/root/.cache/pre-commit/repo3n2l47dt/py_env-python3/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpy7yod92e', '--quiet', 'setuptools_scm']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: /root/.cache/pre-commit/repo3n2l47dt/py_env-python3/bin/python /root/.cache/pre-commit/repo3n2l47dt/py_env-python3/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpfyf3jze9 Check the logs for full command output.
Check the log at /root/.cache/pre-commit/pre-commit.log
The command '/bin/sh -c git init && pre-commit install-hooks' returned a non-zero code: 1
To Reproduce Steps to reproduce the behavior:
Dockerfile to reproduce:
FROM python:3.8
WORKDIR /code
COPY .pre-commit-config.yaml /code
RUN pip install pre-commit
RUN git init && pre-commit install-hooks
Also happens for me. Installing black from source in a virtualenv fails for pip 19 and 20, but works for pip 18.1. But even with pip 18.1 it fails within pre-commit virtualenv. It fails regardless of virtualenv version (20.0.6, 20.0.5, 16.7.10).
Describe the bug
pre-commit hook virtualenv installation fails:
To Reproduce Steps to reproduce the behavior:
Dockerfile
to reproduce:and
.pre-commit-config.yaml
:pinning
"virtualenv<20.0.6"
fixes the issueExpected behavior
pre-commit hook virtualenv installation successful
Environment (please complete the following information):
Docker python:3.8
Does this bug also happen on master?
Yes
The text was updated successfully, but these errors were encountered: