[Proposal] new constraint: dev-master until ~2.0.1

42 views
Skip to first unread message

Schmunk

unread,
Oct 22, 2014, 3:12:00 PM10/22/14
to compos...@googlegroups.com
Hi,

I have an idea based on a current use-case I'd like to throw in here.

We're working with Yii 2, which was recently released as a stable version in 2.0.0.
We encountered a few minor bugs, so we had to switch to dev-master since they're fixed there.

What I'd like to do now is telling composer, that I want to use dev-master for my project until the next stable release, which will contain these changes, like mentioned in the topc:

    "yiisoft/yii2": "dev-master until ~2.0.1"

The advantage would be that I do not really have to remember to change this setting manually, when having updates in the future.

Any opinions on this?


Best regards,
schmunk

Marco Pivetta

unread,
Oct 22, 2014, 3:15:35 PM10/22/14
to compos...@googlegroups.com
Hi Schmunk,

Why not just using the correct branch-alias for the releases? If your `master` is 2.0.0.x-DEV, then targetting 2.0.0.* will require it and will disallow 2.0.1 installation.

--
--
You received this message because you are subscribed to the "composer-dev" group.
To post to this group, send email to compos...@googlegroups.com
To unsubscribe from this group, send email to
composer-dev...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/composer-dev?hl=en

---
You received this message because you are subscribed to the Google Groups "composer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to composer-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Schmunk

unread,
Oct 22, 2014, 4:08:53 PM10/22/14
to compos...@googlegroups.com
Hi Marco,

On Wednesday, October 22, 2014 9:15:35 PM UTC+2, Marco Pivetta wrote:
Why not just using the correct branch-alias for the releases? If your `master` is 2.0.0.x-DEV, then targetting 2.0.0.* will require it and will disallow 2.0.1 installation.

But I do not want to disallow the installation of 2.0.1, I just would like to stay as short as possible on dev-master - just until 2.0.1 and then continue with stable releases as given in the constraint.

I tried to use:

        "yiisoft/yii2": "dev-master as 2.0.0.x-dev,~2.0.1",

and similar combinations, like

        "yiisoft/yii2": "dev-master as 2.0.0.9999,~2.0.1",
        "yiisoft/yii2": "dev-master as 2.0.0.x-dev,>=2.0.1,<3.0.0",
        "symfony/console": "dev-master as 2.2.11.9999,2.*",
        "symfony/console": "dev-master as 2.2.x-dev,2.*@stable",
        "symfony/console": "dev-master as 2.2.11.9999,2.*@stable",

but they don't work.
May this is just a current limitation, looks like composer does not allow inline aliases and multiple constraints.

Matthias Pigulla

unread,
Oct 23, 2014, 3:39:30 AM10/23/14
to compos...@googlegroups.com
Does

"dev-master as 2.0.0.9999|~2.0.1"

or even

"dev-master|~2.0.1"

work and produce the desire results?

Don't forget that the comma denotes a logical *and* requirement.

-mp.

Jordi Boggiano

unread,
Oct 23, 2014, 5:05:19 AM10/23/14
to compos...@googlegroups.com
On 23/10/2014 08:39, Matthias Pigulla wrote:
> Does
>
> "dev-master as 2.0.0.9999|~2.0.1"
>
> or even
>
> "dev-master|~2.0.1"
>
> work and produce the desire results?

Please don't require dev-master at all. You can require `~2.0@dev` which
is really what you mean here: a 2.x version (i.e. no BC breaking 3.0)
but a dev one because you need the pre-release stuff.

You could also require `~2.0@dev as 2.0.1` to give a hint of which
release you're expecting perhaps.

Cheers

--
Jordi Boggiano
@seldaek - http://nelm.io/jordi

Matthias Pigulla

unread,
Oct 23, 2014, 6:29:17 AM10/23/14
to compos...@googlegroups.com
>
>Please don't require dev-master at all.

Just curious: Because you can hurt yourself when breaking changes are made
upstream, or any other particular reason?

>You can require `~2.0@dev` which
>is really what you mean here: a 2.x version (i.e. no BC breaking 3.0)
>but a dev one because you need the pre-release stuff.

So `~2.0@dev | ~2.0, >= 2.0.1` should work because the @stable versions
(once available) will be preferred over the @dev one?

>You could also require `~2.0@dev as 2.0.1` to give a hint of which
>release you're expecting perhaps.

But would that automagically stick with @stable versions once the 2.0.1
comes out?

Thanks!
-mp-

Schmunk

unread,
Oct 23, 2014, 7:27:14 AM10/23/14
to compos...@googlegroups.com
The suggested solutions do not work for me.
Composer installs 2.0.0 or throws an error, if trying other combinations.

> You can require `~2.0@dev` which
> is really what you mean here: a 2.x version (i.e. no BC breaking 3.0)
> but a dev one because you need the pre-release stuff.

As mentioned, I would like to stay on dev-master only until 2.0.1 is available. I do not want dev versions from there on.
Reply all
Reply to author
Forward
0 new messages