Q. In a monorep, can I let the package "A" depend on the package "B" while "A" is targeted for Python 3.10.x and "B" for Python 3.8.x, because "A" runs on a host and "B" runs inside containers (mounted by "A" when "A" creates containers) but they need to be distributed together?
Since there is no direct code-level dependencies between them, lockfiles could be split. I've done it with a overriding of interpreter constraints, but pants tries to find an interpreter for "CPython<3.11,==3.8.*,>=3.10" ...
A way to resolve this issue is to upgrade the "B" to run on Python 3.10.x, but it requires some bit of extra work to regenerate prebuilt CPython env. I am just curious about how this kind of dependencies could be specified in pants.
05/27/2022, 5:43 PM
Why would A need to depend on B in this scenario? It sounds like they don't have code-level dependencies, and run independently. When you say "distributed together" you mean, in a pex or a wheel?
This is an interesting scenario
05/28/2022, 6:16 AM
it's for wheels. yes, this is a very corner-case scenario because the packages are distributed together but one is executed on a host while the other is executed inside a container created by the one at runtime.
i'm inclining to just unify the interpreter constraints for now, because the packages executed inside containers are not installed in container but mounted from outside.
... meaning that we don't go through
constraint in the package metadata and it is my responsibility to guarantee the compatibility