I want to handle download and installation of transitive dependencies for my custom python package, and need your suggestions on how to handle it.
Details:
I have designed a package, let’s call it ‘helloWorld’.
My helloWorld package has direct dependency on 2 packages namely Package A and Package B.
Now, package A has dependency on Numpy==w and Pandas==x, and package B has dependency on Pandas==y (y>x) and matplotlib==z. Both package A and B, along with dependent packages are hosted on my artifact library, URL of which I am passing with –index-url when downloading/installing requirements for helloWorld.
I have created *.whl file of helloWorld and uploaded it on same Artifact library, from where my collegues can download and use this (helloWorld) package.
Requirement/Need: When my collegues are downloading .whl file of helloWorld and installing it, they want all direct and transitive dependencies to be auto-installed along with main package. Or at least they should get a list of all (direct and transitive) dependencies in a requirements file packed in the .whl file so that they could download dependencies as well.
Challenge: The .whl file only contains code and details of setup.py file for my helloWorld package, and doesn’t include any detail about direct or transitive epencies.
How to handle this.
I used pip-tools to generate detailed requirements.txt file from requirements.in file when I was developing helloWorld package. And used pip wheel . to create the .whl file for the helloWorld package.
Amit Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.