I read the Packing Projects Documentation, searched this question here in stackoverflow but found nothing similar, and my low experience using third-party library tells me it's not possible. The closest I got was pip install from git repo branch
Let's suppose I have two python libraries in PyPI, each one with it's own repository and I can install them using the pip
:
pip install mylib-foo
pip install mylib-bar
currently I can import them using
import mylibfoo
import mylibbar
Question 1: Is there a way to import them using the code below, without merging the repositories and create only one PyPI project?
import mylib.foo
import mylib.bar
Merging the repositories I mean just like numpy
does: We can import numpy.linalg
and numpy.random
, but they both are in the same repository/project.
Question 2: Now let's suppose that we have only one PyPI project, in only one repository (just like numpy
does). Is there a way to install only a part of the mylib
library?
pip install mylib-foo # Install only mylib.foo
pip install mylib-bar # Install only mylib.bar
pip install mylib # Install both
So, if someone did only pip install mylib-foo
and tries to import mylib.bar
, he receives an error.