I think this leaves the question of why environment markers are apparently standardized even though the platform
string is not; and also the question of what/where the specification actually is.
Presumably one could also rely on a fake dependency designed to communicate the platform information in the same way - analogous to the unsupported-python
package described in another thread.
The model here assumes that building is a legitimate component of installation, when given something unbuilt to install.
There are two possibilities:
-
There is no feasible alternative to C on Windows. In this case, the dependency on C causes B not to work on Windows; therefore, of course B should be expected to specify that it doesn’t work on Windows - because it doesn’t.
-
There is a feasible alternative. In this case, the build process for B needs to communicate to Pip what to use (C) on non-Windows, and what to use (some other D) on Windows. It’s not as if Pip can just know the Windows equivalent to C, after all. And that’s, well, exactly what a conditional dependency is. (This includes cases where the “feasible alternative” is “nothing; just give a runtime error if the user tries to do impossible-on-Windows things on Windows”. In these cases, Pip needs to know to install C when appropriate, and not try to install it otherwise.)