how can I include a python wheel file stored in Jfrog pypi repository in a requirement.txt

Viewed 59

how can I include a python wheel file stored in our private Artifactory PyPI repository in a requirement.txt? Our Artifactory is self-hosted and not cloud

I have a python app packaged into a wheel file and pushed to self-hosted Jfrog server PyPI Artifactory. How can I include it in the requirement.txt file so that the wheel file can be downloaded from the Artifactory and installed it and other dependencies listed in the requirement.txt?

We want to build a docker image of the application but need the wheel file to be included in the requirement.txt

1 Answers

Artifactory for python use a pypi repo so it work just like a regular pypi private server.

Official Artifactory pypi guide

example from the doc:

--index-url http://localhost:8081/artifactory/api/pypi/pypi-local/simple
PyYAML==3.11
argparse==1.2.1
frog-bar==0.2
frog-fu==0.2a
nltk==2.0.4
wsgiref==0.1.2

Be mindfull that for every different pypi repo you will need a new requirements file

The cleaner solution is to use pipenv with Pipfile and Pipfile.lock in this case, it allow you to have multiple pypi repo in the same file.

Related