How to make a local 'setup.py' resolve dependencies from Artifactory.

How to make a local 'setup.py' resolve dependencies from Artifactory.

AuthorFullName__c
Or Naishtat
articleNumber
000004954
ft:sourceType
Salesforce
FirstPublishedDate
2021-06-29T14:57:13Z
lastModifiedDate
2021-06-29
VersionNumber
5

Setup.py is the build script for setuptools. It tells setuptools about your package details such as the name, version, and dependencies.
When we install a local .py package with a local setup.py file, it does not reach the ".pypirc" configurations. Therefore instead of using Artifactory default "Set Me Up" we need to add a 'dependency_links' parameter to the setup.py file​​ to be able to resolve dependencies from Artifactory - 

dependency_links=['http://<ARTIFACTORY IP>:8082/api/pypi/pypi/simple']

If anonymous access is not permitted to the Artifactory instance/repository please inject the credentials with the below method -

dependency_links=['http://<USER>:<PASSWORD>@<ARTIFACTORY IP>:8082/api/pypi/pypi/simple']

The example below uses the setup.py file taken from our Github python-example

User-added image