There’s exactly two standard ways of specifying dependencies, none of which dependabot supports.
-
PEP 517’s prepare_metadata_for_build_wheel().
The legacy way to specify Python dependencies is requirements.txt. The standard way is having a PEP 517 build system configured. That build system can optionally define a function called prepare_metadata_for_build_wheel. If that function exists, the dependencies can be obtained (from the metadata) without building a wheel, otherwise build_wheel() needs to be called.
Code to just do the above would look like:
import build
deps = build.ProjectBuilder("path/to/project").get_dependencies("sdist")
# or
deps = build.ProjectBuilder("path/to/project").get_dependencies("wheel") - {"wheel"}
-
PEP 631 a new standardized way to specify dependencies in a Python project (now merged into PEP 621).
It’s supported by flit and a bunch of other new build backends. So if you want to continue your (incomplete) way of just parsing files and not calling into Python, this needs to be supported.
There’s exactly two standard ways of specifying dependencies, none of which dependabot supports.
PEP 517’s
prepare_metadata_for_build_wheel().The legacy way to specify Python dependencies is
requirements.txt. The standard way is having a PEP 517 build system configured. That build system can optionally define a function calledprepare_metadata_for_build_wheel. If that function exists, the dependencies can be obtained (from the metadata) without building a wheel, otherwisebuild_wheel()needs to be called.Code to just do the above would look like:
PEP 631 a new standardized way to specify dependencies in a Python project (now merged into PEP 621).
It’s supported by
flitand a bunch of other new build backends. So if you want to continue your (incomplete) way of just parsing files and not calling into Python, this needs to be supported.