Reputation: 1099
This is likely an issue with my understanding of how python modules are packaged but I am confused as to how pip determines what a modules dependencies are when it installs a module. It appears that different build tools have their own way of specifying dependencies for example in poetry it is:
[tool.poetry.dependencies]
requests = "^2.13.0"
Where as under setuptools it is:
[project]
dependencies = [
"docutils",
"BazSpam == 1.1",
]
So yer I'm confused as to how pip can determine what are a module's dependencies if each build system has its own unique specification within the pyproject.toml
file. I'm guess theres some standard format in the built tar.gz file but if thats the case then how does pip know what to install if its installing from source like from a GitHub repo ?
Upvotes: 1
Views: 99
Reputation: 31584
In fact, the setup.py
is the configure for pip
to determine the dependency.
setup.py
in it.setup.py
in that github repo.pyproject.toml
, the poetry will automatically generate a setup.py
to the tar.gz after you input poetry build
.So, for any high level build tool, if we use pip
to install the built out, the pip
will all use install_requires
settings in setup.py
, no matter the setup.py
generated explicitly or implicitly.
Update:
It looks the new pip version already could recognize the pyproject.toml
, so in fact the setup.py
auto generated is for low version pip compatibility use I think.
Upvotes: 1