I would like to find a way to install my own python package which depends on other custom python packages.
I followed this guide to create my own python packages: https://python-packaging.readthedocs.iao/en/latest/
For all packages, the minimal structure is:
myOwnPackage/myOwnPackage/__init__.pysetup.py
Now, I created a package which depends on other custom packages. Its structure is:
myOwnPackage/dependencies/packageApackageBmyOwnPackage/__init__.pysetup.py
My question is: How to easily install myOwnPackage
and its custom dependencies with pip ?
For the above example, I would like to install myOwnPackage, packageA and packageB when I call pip like that: pip install myOwnPackage
I did not find a way to include dependency names in setup.py like I can do for official python packages like numpy
, pyqt5 etc.
I find a way to solve my problem partially by using a requirements.txt with pip:
pip install -r requirements.txt myOwnPackage
and here is how I wrote the requirement file:
./dependencies/packageA
./dependencies/packageB
I works well, but not when I have recursive dependencies like that:
myOwnPackage/dependencies/packageA/dependencies/packageCpackageA/__init__.pysetup.pyrequirements.txtpackageBmyOwnPackage/__init__.pysetup.pyrequirements.txt
pip with the top-level requirements.txt will install myOwnPackage, packageA and packageB but it does not know that it has to install packageC which is a packageA dependency.
Any idea?