pip package rules for bazel that are fast (incremental fetch), support different python versions and work with all kinds of packages (i.e. packages with namespaces)
Currently this doesn't work, as requirement() is executed on all
platforms. This patch changes requirement() to return an invalid key
instead of using fail(), which will allow such usages of select().
If the user specifies a requirement that was not listed in the
requirements file, they should still get an error at build time
which identifies the missing package.
I'd like to use select() to conditionally include dependencies depending on platform, eg a py_binary with
deps = select({ "@bazel_tools//src/conditions:host_windows": [ requirement("psutil"), requirement("pywin32"), ], "//conditions:default": [], })
Currently this doesn't work, as requirement() is executed on all platforms. This patch changes requirement() to return an invalid key instead of using fail(), which will allow such usages of select(). If the user specifies a requirement that was not listed in the requirements file, they should still get an error at build time which identifies the missing package.