There's more that could be done to optimize this multistage build, but this is just a concise explanation of how to avoid the dependency issue you described. Note: If you don't specify a branch, pip installs from the default branch, usually master or main. pip clones the repo, checks out the specified branch, and then installs the package. This way, you only install git in the first stage, but it won't be present in the final built image. pip install git+ This command tells pip to install the dev branch of the mypkg repo. RUN pip install -no-index -find-links /wheelhouse mypackage # copy pre-built packages from build stageĬOPY -from=build /opt/build/wheelhouse /wheelhouse RUN pip wheel -w wheelhouse python:3.9-slim as final if you're using docker, you can readily use multistage builds to avoid the dependency issue in your built image. It adds extra dependency of having git to be installed (especially when using docker)Īs an additional note on this since you mentioned docker. You could leverage that feature and just use regular authentication methods for PyPI with your token to pull the package from the private index. PyPI repositories are also a supported feature of GitLab in all tiers. Using curl as an example curl -o -header "PRIVATE-TOKEN: " "" You can use the repository file archive API to get the same tarball archive using the API, which will support proper authentication. Instead, you should use the GitLab API and authenticate that way using an API token. GitLab does not support basic auth like that. ![]() Your initial problem is that you can't authenticate with username and password using basic auth to the get archive that's shown in the UI for a private repo. I'm not looking for something like below, as it adds extra dependency of having git to be installed (especially when using docker) + My requirement is to install the module from a compressed archive. Pip install it resulted in the same error: ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /users/sign_in (Caused by ResponseError('too many 503 error responses'))
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |