Prefer caret constraints over wildcards - #22
Conversation
Specifically in this case this library was stopping Guzzle 6.3 from being installed while Semver guarantees its compatibility. You should always use caret constraints unless there is a very good reason not to.
|
This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request. |
You should *never* specify the version explicitly. Packagist will infer it from git tags. Refer to https://getcomposer.org/doc/02-libraries.md#library-versioning
|
Unfortunately, Microsoft's open source policy requires us to register and specify a specific major and minor version of each package that we include in our projects. |
|
Well, in that case the policy needs to change because it's actively breaking interoperability in the Packagist ecosphere, and it'll be rendering your library useless. The whole point of Semver, which you are implicitly complying to by distributing via Composer and Packagist, is that minor/patch level updates are 'guaranteed' to be safe by the developer. Hence limiting to Hence the correct solution is to use the caret and the minimum compatible version, likely for this library And on a completely different note: you should avoid hard depending on Guzzle whatsoever, and use HTTPlug instead. It's an abstraction layer allowing the application developer to choose the HTTP client of their liking, including even Guzzle 5, without affecting your library. |
|
I completely agree. I am currently working with legal to see if there is any way we can loosen restrictions in this area. If we cannot, I will need to write a script to automatically submit new versions of dependent packages and update the version numbers once approved. I am hopeful that we will be able to use your solution instead. I am going to leave this PR open in the event that advice changes on being able to allow developers to use a range of dependencies. |
|
Thank you for being honest and open. Having a public thread like this with a Microsoft employee would have been unthinkable 10 years ago. I really appreciate the full turn your company has made since the days of Ballmer, and the way it is improving not only your products but also ours. |
|
Niels Keurentjes (@curry684), thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request. |
|
Resolved conflicts. |
|
Great news, we got approval to use caret constraints! This update will be released shortly. |
|
Cheers! |
Specifically in this case this library was stopping Guzzle 6.3 from being installed while Semver guarantees its compatibility. You should always use caret constraints unless there is a very good reason not to.
The other changes are simply layout.