1

Let's say we create a private python package, that depends on another private python hosted in a private enterprise PyPi repository (artifactory).

The setup.cfg looks as follows,

[options]
python_requires = >= 3.6, <3.9.0a0
setup_requires =
    setuptools >= 46.4.0
    wheel
install_requires = [
    keyring
    private-pkg1 >= 0.1.0
    private-pkg2 >= 0.1.0
    simple-parsing ]

$HOME/.pip/pip.confg is configured download the packages from internal PyPi hosted in Artifactory.

[global]
index-url = https://artifactory.mycorp.com/artifactory/api/pypi/PyPI/simple/

But this doesn't work when python setup.py egg_info is executed

  • Can setup.cfg depend on wheel packages stored private PyPi?
  • What is the correct way to specify additional repository URLs for downloading dependencies?
Nambi
  • 2,688
  • 8
  • 28
  • 37

1 Answers1

0

I think the reason python setup.py doesn't work because setuptools does not look for the pip configuration.

There is another related answer using pip: https://stackoverflow.com/a/69846951/10411740.

My working solution is as follows:

In setup.cfg:

install_requires =
    mycorp.private_module==1.0.0

and execute pip install . --index-url=<URL of Pypi repository> in the For example:

pip install . --index-url=https://__token__:<your_personal_token>@gitlab.com/api/v4/projects/<project_id>/packages/pypi/simple

For GitLab pypi package registry: https://stackoverflow.com/a/72019535/10411740

hcchang84
  • 3
  • 5