Pip Install from a Private Repo
How to pip install from a private repo
You can pip install in the following way:
In setup.py
, we can add these packages in the following way:
setup(
name='<package>',
install_requires=[
'<package_name>@git+ssh://git@github.com/<user>/<repo_name>@<branch>',
'<package_name>@git+https://<access_token>@github.com/<user>/<repo_name>@<branch>'
]
)
If we are doing editable installation, it looks like the following:
For GitLab CI/CD, one needs to do it in the following way:
pip install -e https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.example.com/<namespace>/<project>#egg=<package_name>
One can include a python package from git repo directly as a dependency, by listing it as "<package name>@git+<git url>".
— Ziyue Li (@curiosity_notes) November 7, 2022
For some reason, I always forget about the "<package name>@" part 😅, so this tweet serves as a reminder for myself. #python #nbdev pic.twitter.com/IX1AcGGTkO