-
Notifications
You must be signed in to change notification settings - Fork 71
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
Configuration options to include packages from require-dev and suggests #70
Comments
This is exactly what this package is about: finding them and marking them as violation |
Duplicates #55 |
Duplicate of "False positives on some bundle and classes" - you didn't really want me to find that issue as relevant report, did you? :)
And it is exactly what is wrong, it's not a violation, it's expected. And there is no way to configure it (I don't consider |
No, I simply proactively link issues together.
Not in this package - the design is specifically around preventing optional dependencies upfront. A package such as Again: this is by design. Optional dependencies are a mess and should be slowly removed over time. We had massive issues in dozens of packages in |
The description of this package clearly says:
and
Not possible until Composer has a strategy to define package sets/unions and choosing defaults for them. Without that, you either end up with ton of useless dependencies at runtime or missing dependencies (i.e. no ORM mapping driver).
Same as above, they are very much a thing, until package manager has a strategy to handle things better. |
No, because downstream consumers won't get it, so you are making holes in the dependency graph
Suggest was proposed to be removed from composer overall, since it is basically an advertisement section in
Yes, but until then you won't have a tool that tells you anything about that. If you have a plan on how to force intersection/union of "optional" dependencies that is part of the composer SAT itself, this is a non-issue here, and the package will simply focus on preventing missing dependencies from leaking through to unaware (and affected) downstream consumers. |
Only applicable to libraries and production code.
You are talking about some uncertain distant future. I am on the other hand talking about real-world situation/problem that is found in basically any larger package.
It's not an issue here, but it's a trouble caused by rejecting the state in which PHP ecosystem currently is and will be for a while. (Even if composer adds such thing tommorow, it would take years to consider as default).
I take this, okay. /me leaves Sorry that I simply wanted to make it more flexible and configurable and thus usable by more consumers. |
This is specifically for that: why would you need such checks otherwise?
Work towards getting to an exit code
It's not about widening the user-base of the package, it is about ensuring that the invariants provided by |
@Majkl578 From a maintainer's point of view, "suggest" is a nightmare. Why? Because somebody will go and install the package, try to use that optional feature, and then file an issue saying, "feature X does not work". Maintainers will calmly point out that the feature is optional, and requires a dependency marked in the "suggest" section. The user will say they did not see it, and perhaps that dependency should be required. The maintainer will argue, "the feature is optional, that's why the dependency is optional." This gets more heated when the user points out, "well, the dependency is in And then there's problems when optional features require PHP extensions. Don't even get me started on that. And round and round it goes. In ZF, we are actively attempting to split out anything that is optional functionality, particularly if such functionality requires additional dependencies, and putting them into a separate package. We have a project in place for zend-cache to split out all adapters into their own components; we will be doing so with zend-db and its adapters, too; same goes for zend-paginator (which has a couple zend-db-specific adapters). Doing this allows each to specify any code dependencies, as well as PHP extension dependencies, so that installation will fail if any of those are unmet. (With Expressive, we already did this with regards to routers, template engines, and session backends, and we're doing it as well with upcoming authentication and authorization adapter packages.) We can then "suggest" these additional packages, and document the packages we know about, so that you, as a consumer, can discover what else you may need to install to get the combination of functionalities that achieve what you need. So, while you may argue packaging all optional dependencies is a "real-world situation/problem that is found in basically any larger package," what @Ocramius and I are arguing is the exact same thing: packaging anything "optional" in a larger package leads to confusion by end-users and difficulty in maintenance. It's better to split it out into more packages, each with a discrete set of requirements, and nothing optional. |
Note: it doesn't need to be separate repositories, but the distributed package (for which |
In a project, to make sure indirect dependency doesn't get bumped to next major, that would break my code depending on it (consider doctrine/annotations for example).
And it's not doing so correctly, given the nature of
Agreed, but it's irrelevant. We are not talking about your code, but any code. And any code usually does use
Wouldn't get changed at all by adding an opt-in configuration option. OTOH would help projects (not libraries) in finding and properly exposing their dependencies.
I never said otherwise, did I? But forced |
Taking this example specifically: composer require doctrine/orm-yaml-mapping This is the correct resolution for such a scenario. If the |
In such case, which driver will I get when I simply do |
The ones that can work with the given set of
This is a trade-off that comes with most libraries, and obviously needs discipline from a library author's perspective. Another possible alternative is to not ship any drivers at all, and instead use https://github.com/doctrine/phpcr-odm/blob/1.4.4/composer.json#L21 |
Add missing export-ignore
It seems that currently only packages used directly in
require
section are considered.There are multiple cases when packages are optional dependency and as such are only present in
suggest
(and possibly alsorequire-dev
) section. These are currently reported as missing dependency, although they are not hard dependency.The text was updated successfully, but these errors were encountered: