Hey everyone,
I would like to install my-package
and only my-package
from the package registry of a specific GitLab project, but install its dependencies from an alternative index, which is a PyPI mirror (we’ll use https://some-pypi-mirror.org/pypi/simple
here).
The closest I’ve been able to come up with is:
python3 -m pip install -v --no-cache-dir \
"my-package @ git+https://__token__:<GITLAB_TOKEN>@gitlab.com/some-group/my-package" \
--index-url https://some-pypi-mirror.org/pypi/simple
This command works. However, I do not want to install from source (i.e. the project URL) but rather the built wheel available in the package registry. In addition, I would like to be able to optionally specify a package version, which this approach obviously doesn’t support either:
python3 -m pip install -v --no-cache-dir \
"my-package==0.8 @ git+https://__token__:<GITLAB_TOKEN>@gitlab.com/some-group/my-package" \
--index-url https://some-pypi-mirror.org/pypi/simple
ERROR: Invalid requirement 'my-package==0.8 git+https://[...]'
To summarize, is there a way:
- to install
my-package
(and only that) via the built wheel available in a GitLab package registry, - which supports optionally defining a version specifier (e.g.
my-package==0.8
), - and to then resolve the dependencies of
my-package
via the PyPI mirror?
Any help is greatly appreciated. Thank you very much in advance!
Best regards,
Ryan