pip install [git repo] hangs on clone step on Windows with large repositories · Issue #8876 · pypa/pip (original) (raw)

Environment

Python packages are available as git repositories, hosted in AWS CodeCommit, with authentication handled via AWS CLI integration with git credential helper.

Description

Pip version 20.2 causes VCS pip install from AWS CodeCommit to freeze during the clone step. This does not occur with all our repos, but occurs consistently for the ones with the problem.

My team has a suite of python packages that we develop for our internal use. These packages are available as git repositories, and we install them using the pip VCS integration feature.

pip install git+https://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo

This solution has worked for us, without issue, until we upgraded to pip version 20.2. I have tested that all minor versions between 19.1 and 20.1 work as expected.

On version 20.2, with specific repositories, when the install gets to the clone step it stalls there, and the process never completes. The temporary folder is initialized, and the hidden .git repo appears to be populated and in-tact, but the rest of the repo is empty and the process never completes.

Adding the verbose switch does not provide any detail as to why the process is hanging. Examination of logs on the side of the remote server suggest that the git command is being processed correctly.

Expected behavior
Using pip install git on a CodeCommit repo will complete or raise an error for all repositories.

How to Reproduce
Reproducing may be difficult, since the issue only occurs with some of our packages, but we don't know why. Our code is not public, so I can't expose it directly. However, the steps are as follows:

  1. Install python 3.7 and pip 20.2 on Windows
  2. Install AWS CLI
  3. Get an AWS API Token
  4. Configure .gitconfig credential helper to use AWS CLI for CodeCommit URL
  5. Start installing python packages with pip install git+https://; we're not sure why some work and some don't, so this last step is a little, uninformative...

Output

pip install git+https://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo

Collecting git+https://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo
  Cloning https://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo to /tmp/pip-req-build-rpozcsdw