5

The gitlab package registry can be used to publish and install python packages. Such an installation works perfect using --extra-index-url or --index-url as described in the documentation and I have also tested it successfully using a requirements.txt file as described here.

Nonetheless, it would be easier for many purposes to add them directly into the packages setup.py.

Is there any way to add these packages from gitlab's registry or other external indexes directly into the requirements within a setup.py?

Note: I know that it is possible to install directly from git repositorys from a setup.py. But I would like to use the versioned package registry instead.

Thanks in advance for your help!

Cord Kaldemeyer
  • 6,405
  • 8
  • 51
  • 81
  • Does this answer your question? [How to write setup.py to include a Git repository as a dependency](https://stackoverflow.com/questions/32688688/how-to-write-setup-py-to-include-a-git-repository-as-a-dependency) – sinoroc Jan 05 '21 at 20:11
  • No. As explained, I already know how to do that. This question deals with gitlab's package registry or other indexes. – Cord Kaldemeyer Jan 06 '21 at 08:33
  • 1
    Answer is still basically the same: you can't. You can't add this info in `setup.py`. Read this: https://discuss.python.org/t/dependency-notation-including-the-index-url/5659 – sinoroc Jan 06 '21 at 09:20
  • Thanks for your explanation! Although I am not really happy with the result ;-) – Cord Kaldemeyer Jan 06 '21 at 17:01
  • I will leave it open anyway for the case that it changes in future or someone comes arround with a creative solution. – Cord Kaldemeyer Jan 06 '21 at 17:02

0 Answers0