Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Why is it a bad idea to say that version constraints that combine "comparison" and "wildcard"?


May 25, 2021 Composer


Table of contents


Why is it a bad idea to say that version constraints that combine "comparison" and "wildcard"?

This is a common mistake, defining version >=2.* similar to >=1.1.* that of .

By thinking about what it really means, you'll soon find that it doesn't make much sense. If we >=2.* parts:

  • >=2 be 2.0.0 or more.
  • 2.* that the resource pack version should be between 2.0.0 (inclusive) and 3.0.0 (excluded).

As you can see, to satisfy both rule pack versions, you have to be able to tell if you want to include both rule pack versions, but it's impossible to tell, because when you write that, do you want to include version 3.0.0 or not? S hould it be matched? Because >=2 at the same time you've limited 2.*

For this reason, Composer will throw an error and tell you that it is invalid. The easiest way to express exactly what you mean is to use only one of the "comparison" and "wildcard" to define constraints.