Setuptools feature request: simplified version specification
We (me and a bunch of my Zope friends) find that we'll often want version specifications of the form: project_name >=Vdev, <V+1dev (e.g. "foo >=1dev, <2dev") We think this is so common that we'd like a short-hand way of spelling it. I'll note that I'm not even sure I got the spelling above right. The intent is to request version 1, meaning any release of version 1. I think that's what I spelled above, although I'm not sure. If I got it wrong, maybe someone will correct me. Aside from the verbosity of the spelling above, I think the difficulty in spelling it is a strike against it. Note that a naive spelling: "foo >=1, <2" is wrong because it excludes pre-releases of 1 and includes pre-releases of 2. I propose that a valid version that ends in a number and that isn't preceded by an operator be a valid version specifier and be interpreted as a range. So, assuming that I know how to spell the range, a specification of: project_name V (e.g. "foo 1") would be equivalent to: project_name >=Vdev, <V+1 (e.g. "foo >=1dev, <2dev") This would work with multi-part versions, so "foo 1.2" would be equivalent to "foo >=1.2dev <1.3dev". Note that this could be combined with other version specifiers. For example, to require any version 1 or 2 of foo or versions 3.2 final or later: foo 1, 2, >=3.2 Also note that any version will do, so: foo 1.2a1 would be equivalent to: foo >=1.2a1dev <1.2a2dev And note that versions that don't end in numbers wouldn't be valid version specifiers, so: foo 1a would not be a valid specifier. Thoughts? Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
Jim Fulton wrote:
We (me and a bunch of my Zope friends) find that we'll often want version specifications of the form:
project_name >=Vdev, <V+1dev (e.g. "foo >=1dev, <2dev")
We think this is so common that we'd like a short-hand way of spelling it.
I'll note that I'm not even sure I got the spelling above right. The intent is to request version 1, meaning any release of version 1. I think that's what I spelled above, although I'm not sure. If I got it wrong, maybe someone will correct me. Aside from the verbosity of the spelling above, I think the difficulty in spelling it is a strike against it. Note that a naive spelling: "foo >=1, <2" is wrong because it excludes pre-releases of 1 and includes pre-releases of 2.
I hope you got it right because that's exactly the syntax we're using here at Enthought. Well, except that we use a '.dev' instead of a 'dev' :-) And I agree with you that getting it right isn't trivial. It tooks us a couple of attempts and exploring a couple of usecases to figure it out.
I propose that a valid version that ends in a number and that isn't preceded by an operator be a valid version specifier and be interpreted as a range. So, assuming that I know how to spell the range, a specification of:
project_name V (e.g. "foo 1")
would be equivalent to:
project_name >=Vdev, <V+1 (e.g. "foo >=1dev, <2dev")
This would work with multi-part versions, so "foo 1.2" would be equivalent to "foo >=1.2dev <1.3dev".
Note that this could be combined with other version specifiers. For example, to require any version 1 or 2 of foo or versions 3.2 final or later:
foo 1, 2, >=3.2
Also note that any version will do, so:
foo 1.2a1
would be equivalent to:
foo >=1.2a1dev <1.2a2dev
And note that versions that don't end in numbers wouldn't be valid version specifiers, so:
foo 1a
would not be a valid specifier.
I think this all sounds great, except that I'd made the last example valid by assuming it ended with a 0. i.e. foo 1a ==> foo >=1adev, <1a1dev This would be somewhat inline with the current pattern of expanding with zeros to say version 1 is equivalent to 1.0.0.0....0. -- Dave
On Jul 6, 2007, at 2:17 PM, Dave Peterson wrote: ...
I think this all sounds great, except that I'd made the last example valid by assuming it ended with a 0. i.e.
foo 1a ==> foo >=1adev, <1a1dev
This would be somewhat inline with the current pattern of expanding with zeros to say version 1 is equivalent to 1.0.0.0....0.
Ah, good point, however, we'd still be treating versions ending in numbers differently from versions ending in letters, so it doesn't really simplify anything. After all, we wouldn't treat "1" as "1.0" and thus ">=1.0, <1.1". IMO, this is such an edge case that I don't really think it needs to be accommodated. OTOH, it's such an edge case, I don't care what we do with it. :) Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
Am Freitag, den 06.07.2007, 14:09 -0400 schrieb Jim Fulton:
We (me and a bunch of my Zope friends) find that we'll often want version specifications of the form:
project_name >=Vdev, <V+1dev (e.g. "foo >=1dev, <2dev")
We think this is so common that we'd like a short-hand way of spelling it.
[...]
Thoughts?
I've been using eggs for a while now and being able to specify a release series would be very helpful to me. I'm one of his Zope friends and I'm fond of the syntax he proposes. Christian
At 02:09 PM 7/6/2007 -0400, Jim Fulton wrote:
We (me and a bunch of my Zope friends) find that we'll often want version specifications of the form:
project_name >=Vdev, <V+1dev (e.g. "foo >=1dev, <2dev")
We think this is so common that we'd like a short-hand way of spelling it.
I'll note that I'm not even sure I got the spelling above right. The intent is to request version 1, meaning any release of version 1. I think that's what I spelled above, although I'm not sure. If I got it wrong, maybe someone will correct me. Aside from the verbosity of the spelling above, I think the difficulty in spelling it is a strike against it. Note that a naive spelling: "foo >=1, <2" is wrong because it excludes pre-releases of 1 and includes pre-releases of 2.
I propose that a valid version that ends in a number and that isn't preceded by an operator be a valid version specifier and be interpreted as a range. So, assuming that I know how to spell the range, a specification of:
project_name V (e.g. "foo 1")
would be equivalent to:
project_name >=Vdev, <V+1 (e.g. "foo >=1dev, <2dev")
This would work with multi-part versions, so "foo 1.2" would be equivalent to "foo >=1.2dev <1.3dev".
Note that this could be combined with other version specifiers. For example, to require any version 1 or 2 of foo or versions 3.2 final or later:
foo 1, 2, >=3.2
Also note that any version will do, so:
foo 1.2a1
would be equivalent to:
foo >=1.2a1dev <1.2a2dev
And note that versions that don't end in numbers wouldn't be valid version specifiers, so:
foo 1a
would not be a valid specifier.
Thoughts?
I'm not sure what I think of ' ' as the operator. This change would also have to be an 0.7 feature, as any package that uses it will be dependent on having a setuptools version that understands it, at least in order to build an egg. (We could have egg_info write the expanded forms, so that the built eggs' dependencies would be comprehensible to older versions.) I'm also not sure that '1a' can't/shouldn't be a valid specifier, although I suppose it would mean being equal to either ">= 1a.dev, <1b.dev" or ">= 1a0dev, <1a1dev", both of which are a little weird. :)
Phillip J. Eby wrote:
I'm not sure what I think of ' ' as the operator. This change would also have to be an 0.7 feature, as any package that uses it will be dependent on having a setuptools version that understands it, at least in order to build an egg. (We could have egg_info write the expanded forms, so that the built eggs' dependencies would be comprehensible to older versions.)
How about foo~=1.3, meaning foo>=1.3a,<1.4a ? It reads well to me, since it's like "about equal". -- Ian Bicking : ianb@colorstudy.com : http://blog.ianbicking.org : Write code, do good : http://topp.openplans.org/careers
On Jul 6, 2007, at 2:51 PM, Ian Bicking wrote:
Phillip J. Eby wrote:
I'm not sure what I think of ' ' as the operator. This change would also have to be an 0.7 feature, as any package that uses it will be dependent on having a setuptools version that understands it, at least in order to build an egg. (We could have egg_info write the expanded forms, so that the built eggs' dependencies would be comprehensible to older versions.)
How about foo~=1.3, meaning foo>=1.3a,<1.4a ? It reads well to me, since it's like "about equal".
I think that "foo 1.3" is more readable than "~=1.3". Do we absolutely need an operator? If we absolutely need an operator, or if the majority of people here would prefer one, then I can live with one and would find it to be a big improvement to the current situation. Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
On Jul 6, 2007, at 2:38 PM, Phillip J. Eby wrote:
At 02:09 PM 7/6/2007 -0400, Jim Fulton wrote:
We (me and a bunch of my Zope friends) find that we'll often want version specifications of the form:
project_name >=Vdev, <V+1dev (e.g. "foo >=1dev, <2dev")
We think this is so common that we'd like a short-hand way of spelling it.
I'll note that I'm not even sure I got the spelling above right. The intent is to request version 1, meaning any release of version 1. I think that's what I spelled above, although I'm not sure. If I got it wrong, maybe someone will correct me. Aside from the verbosity of the spelling above, I think the difficulty in spelling it is a strike against it. Note that a naive spelling: "foo >=1, <2" is wrong because it excludes pre-releases of 1 and includes pre-releases of 2.
I propose that a valid version that ends in a number and that isn't preceded by an operator be a valid version specifier and be interpreted as a range. So, assuming that I know how to spell the range, a specification of:
project_name V (e.g. "foo 1")
would be equivalent to:
project_name >=Vdev, <V+1 (e.g. "foo >=1dev, <2dev")
This would work with multi-part versions, so "foo 1.2" would be equivalent to "foo >=1.2dev <1.3dev".
Note that this could be combined with other version specifiers. For example, to require any version 1 or 2 of foo or versions 3.2 final or later:
foo 1, 2, >=3.2
Also note that any version will do, so:
foo 1.2a1
would be equivalent to:
foo >=1.2a1dev <1.2a2dev
And note that versions that don't end in numbers wouldn't be valid version specifiers, so:
foo 1a
would not be a valid specifier.
Thoughts?
I'm not sure what I think of ' ' as the operator.
I wasn't suggesting adding '' as an operator. :)
This change would also have to be an 0.7 feature, as any package that uses it will be dependent on having a setuptools version that understands it, at least in order to build an egg.
Yup.
(We could have egg_info write the expanded forms, so that the built eggs' dependencies would be comprehensible to older versions.)
That makes sense. Hm. That's interesting. I hadn't thought through the implication of that. I guess there are all sorts of things that can be done in a setup script to make this work now without changing setuptools. In the long term, I'd like to setuptools support this syntax, however, I suppose there are lots of opportunities to support it in the short term. I'll have to see what I can think of.
I'm also not sure that '1a' can't/shouldn't be a valid specifier, although I suppose it would mean being equal to either ">= 1a.dev, <1b.dev" or ">= 1a0dev, <1a1dev", both of which are a little weird. :)
As I mentioned in my response to Dave, I'm OK with anything since I think this is an extreme edge case, however I think it's best not to guess. Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
participants (5)
-
Christian Theune
-
Dave Peterson
-
Ian Bicking
-
Jim Fulton
-
Phillip J. Eby