-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Optional dependencies #8184
Comments
I am having a hard time understanding what you actually want. The example is not very clear. Either a package is required, or it is not required. There is no such thing as optional. You seem to hint at some kind of conflict resolution, but it is not clear to me how optional packages could solve conflicts. |
Many packages, like Monolog (see composer.json) contains integration of packages which you could use optionally, so they are listed in |
No, that is wrong. I suggest you read up on the difference between https://getcomposer.org/doc/04-schema.md#require https://getcomposer.org/doc/04-schema.md#require-dev Packages listed in |
@Seldaek As a author of Monolog, which uses optional dependencies I hope you may understand. Monolog's current master have require-dev for |
@alcohol I've read all the docs several times. Current solution of optional dependencies is a workaround and I know it. It's why I wrote proposal of new |
Monolog is a very good example of doing it wrong really.. ElasticSearchHandler should be published as a standalone package with a requirement on both monolog and elasticsearch/elasticsearch, so the version can be enforced. That is why I don't accept any new handlers anymore with external requirements. Adding optional dependencies are not worth the trouble IMO in composer.. |
Related to #6255, #6321 and #6965 for anyone looking for this Best solution is surely no optional dependencies at all. But sometimes creating packages for every single "optional" dependency is just not well spent time. If you guys ever wish to implement it then I would suggest following, BC syntax (at least for these who update composer) "suggest": {
"aws/aws-sdk-php": {
"message": "Description why is it suggested",
"version": "^1.0.0"
}
}
Assuming you are going to ever agree, I may send a PR once I don't have too much work with my own open-source. Composer is great tool btw, I'm sorry if it sounded like I think anything other |
We have tens of packages which optionally integrate with others. To ensure these optional dependencies are installed with correct version if user require them we need to write this:
Preferred syntax is:
which would always install package as dev dependency and check correct version if user require package itself.
The text was updated successfully, but these errors were encountered: