I'm using Gitlab to hosts two private Python packages. One, say package B, depends on the other, say A.
I would like to setup correctly package B, so I have a setup.py with
install_requires=[
'packagea @ git+https://gitlab.com/me/packagea.git',
...
]
as well as a requirement.txt containing
git+https://gitlab.com/me/[email protected]
And that works well when a user installs package B with pip install git+https://gitlab.com/me/packageb.git
, or when a user clones package B and then run pip install -r requirements.txt
.
However, I would like to setup continuous integration on package B. My gitlab-ci.yml looks like
image: python:3.7
before_script:
- pip install -r requirements.txt
pylint:
script:
- pylint **/*.py
This fails because the Gitlab-CI runner does not have any username/password to authenticate and pull package A repo. I've read that I could generate a Personal Access Token for the CI runner to authenticate, but this would mean that setup.py and requirements.txt contain the token. This seems ugly to me (I'd like the other users to still use their own username/password).
How can I achieve this?