Search code examples
pythonartifactorysetuptools

How to specify a different non-pypi package index url to setuptools.setup?


I'm trying to specify a package dependency not in pypi [but in jfrog/Artifactory] to setuptoools.setup()

Things I've tried:

  1. Using the dependency_links argument to setuptools.setup() like so:

    dependency_links=['http://USER:PASSWORD@ARTIFACTORYHOST:8082/api/pypi/pypi/simple']

but dependency_links is now deprecated since 19.0 (released 2019-01-22).

  1. Using the install_requires argument to setuptools.setup() like so:

    install_requires=[mypackage @ http://USER:PASSWORD@ARTIFACTORY HOST:8082/api/pypi/pypi/simple]

but install_requires seems to expect to download source code as a [.zip] archive.

Ideally, I'm looking for something equivalent to pip's extra-index-url setting, which is specifiable directly to setuptools.setup().


Solution

  • From abravalheri at https://github.com/pypa/setuptools/pull/3364:

    I couldn't find anything in the latest packaging standards about mixing multiple package indexes together directly on the package specification. You need to use an external tool for that, like the pip configuration file, or a package index mirror/proxy like devpi (maybe bandersnatch also can do that?).

    What is possible to do right now is to force a URL to a wheel file as covered in PEP 440/PEP 508. But as you have already noticed, it requires you to point to a specific file and don't allow for dynamic version resolution.

    So the short answer is no, unfortunately there seems to be nothing in the packaging standards regarding that.