Conditional package install depending on other packages in environment

I wonder if using the package metadata for this is a good idea. I feel like package metadata ends up too often being incorrect or out of date, and then it is hard to fix (maintainers are not active anymore for example).

I wonder if we could improve on the constraints.txt idea taken from pip instead. What if it were possible to specify the following in a “constraints” file (on top of what is already feasible)?

  • if library is required, install instead:
    • library-contrib
    • library[gpu-enhanced]
    • library and third-party-library-plugin
  • if library is required, install it from:
    • this alternative index server
    • this git repository branch
  • and potentially more advanced fixes, typically overriding metadata of a poorly packaged dependency

The one doing the installation (the one building the final application) is the one more likely to know what should be installed. The one packaging the library only has partial knowledge, they can not possibly know in which application and in which environment their library will be integrated.

Related:

1 Like