multiple Requirement subclasses for the same dependency
Using multiple Requirement subclasses for the same dependency is unavoidable. One OS will have a distro package, and another OS only has the runtime specific package manager.
Even on an OS with a distro package, some people will want to use their distro packages for external linters (which will be pinned to node/ruby/python versions), and other people wont like distro packages and need to roll their own external linters. Developers especially will need to roll their own linters, e.g. in order to test new versions of linters, etc.
A function to reduce a set of Requirements to an ordered list is needed.
One of the most important aspects of choosing which Requirement class to use first is versions. Some Requirement classes will have limited versions available to them. A DistributionRequirement typically only has a single version available (or the commands to select an older version are more complex). An 'executable' Requirement subclass has a single unpredictable version which can be found only be trying --version
. A runtime-based package manager (e.g.pip) has many versions, but also has to understand which versions can be used with which runtime versions.
The user should also have some control over the precedence of requirement subclasses.