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__.py
setup.py
Now, I created a package wich depends on other custom packages. Its structure is:
myOwnPackage/
dependencies/
packageA
packageB
myOwnPackage/
__init__.py
setup.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 offcial 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/
packageC
packageA/
__init__.py
setup.py
requirements.txt
packageB
myOwnPackage/
__init__.py
setup.py
requirements.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 ?