Closed Aust1994 closed 10 years ago
Hey have you the "minimum-stability" : "dev" on your composer.json ? http://hoa-project.net/En/Literature/Learn/Install.html#Depuis_Composer_et_Packagist
Unless you are only requiring Hoa packages, setting min-stab
to dev
is wrong.
Let me explain : when you set this flag with the dev
value, composer will allow itself to download unstable version for each packages listed in your composer.json
. You will likely don't want to get unstable version for all your dependencies.
A better way of doing this is to require every dependency of the package your are requesting and marking them as dev
:
{
"require": {
"hoa/console": "*@dev",
"hoa/core": "*@dev",
"hoa/string": "*@dev",
"hoa/stream": "*@dev"
}
}
Here, the package i rally require is hoa/console
but to allow composer to download unstable dependencies of hoa/console
I have to also require them here. This is because of how composer works : the root package (your project) is the only one allowed to loosen the minimum-stability
.
I agree that this can be boring, repeating packages dependencies in your composer.json
could be a pain because you have to stick with the package (here it is hoa/console
) dependecies : if they change, you also have to change your composer.json
to update your deps. But, it's the most secure way of doing things if Hoa's packages are not the only ones your require. Say you also require Symfony components, you will not want to get unstable version of those too.
Composer does not handle rolling-release and this is a pity as Hoa, but not only (we also have problems with @atoum), works with rolling-release principles.
Hope this helps ;)
@jubianchi: :+1:.
Can we close this issue?
@jubianchi :+1:
A tiny update for those getting here. I never loosen min-stab
flag in my composer.json
files, I always use the tips I gave in my previous comment.
It turns out that sometimes, require
s are messy so I now use a tiny convention to make things clear. Let me show you:
{
"require": {
"hoa/console": "*@dev",
"hoa/core": "*@dev",
"hoa/string": "*@dev",
"hoa/stream": "*@dev"
}
}
I use indentation to make things clear: here, hoa/console
requires some dev
deps. so I indent them under hoa/console
. I find this more clean. Also, with this, we don't have to question ourselves on "Why this deps is here?! I never use it in my code!"
@Hywan I think we can close this issue.
Thanks!