Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Development (http://www.linux-archive.org/gentoo-development/)
-   -   PYTHON_DEPEND - Suggested replacement for NEED_PYTHON (http://www.linux-archive.org/gentoo-development/307120-python_depend-suggested-replacement-need_python.html)

Arfrever Frehtes Taifersar Arahesis 01-10-2010 07:29 AM

PYTHON_DEPEND - Suggested replacement for NEED_PYTHON
 
I would like to suggest introduction of support for PYTHON_DEPEND variable, which
would be a better replacement for NEED_PYTHON variable. NEED_PYTHON variable
does not allow to specify that e.g. only versions of Python 2 are accepted.
(Eventually PYTHON_DEPEND variable will have to be set only in ebuilds of packages
not supporting installation for multiple versions of Python.)

Suggested syntax:
PYTHON_DEPEND="[USE_flag?] <X[:[Y][:[Z]]]> [X[:[Y][:[Z]]]]"
<required_component>, [optional_component]
X - Major version of Python ('2' or '3') or '*'.
Y - Minimal version of Python in the form of ${major_version}.${minor_version}.
Z - Maximal version of Python in the form of ${major_version}.${minor_version}.
It will be probably very rarely used.

Examples:
PYTHON_DEPEND="2"
Dependency on any version of Python 2.

PYTHON_DEPEND="2:2.5"
Dependency on Python 2.7, 2.6 or 2.5.

PYTHON_DEPEND="*:2.6"
Dependency on Python 3.2, 3.1, 3.0, 2.7 or 2.6.

PYTHON_DEPEND="2:2.7 3:3.1"
Dependency on Python 3.2, 3.1 or 2.7.

PYTHON_DEPEND="2:2.5:2.6"
Dependency on Python 2.6 or 2.5.

PYTHON_DEPEND="2::2.6"
Dependency on Python 2.6, 2.5 or 2.4.

PYTHON_DEPEND="python? 2"
Dependency on any version of Python 2 when "python" USE flag is enabled.

--
Arfrever Frehtes Taifersar Arahesis

Sebastian Pipping 01-10-2010 05:41 PM

PYTHON_DEPEND - Suggested replacement for NEED_PYTHON
 
On 01/10/10 09:29, Arfrever Frehtes Taifersar Arahesis wrote:
> I would like to suggest introduction of support for PYTHON_DEPEND variable, which
> would be a better replacement for NEED_PYTHON variable. NEED_PYTHON variable
> does not allow to specify that e.g. only versions of Python 2 are accepted.
> (Eventually PYTHON_DEPEND variable will have to be set only in ebuilds of packages
> not supporting installation for multiple versions of Python.)
>
> Suggested syntax:
> PYTHON_DEPEND="[USE_flag?] <X[:[Y][:[Z]]]> [X[:[Y][:[Z]]]]"
> <required_component>, [optional_component]
> X - Major version of Python ('2' or '3') or '*'.
> Y - Minimal version of Python in the form of ${major_version}.${minor_version}.
> Z - Maximal version of Python in the form of ${major_version}.${minor_version}.
> It will be probably very rarely used.
>
> Examples:
> PYTHON_DEPEND="2"
> Dependency on any version of Python 2.
>
> PYTHON_DEPEND="2:2.5"
> Dependency on Python 2.7, 2.6 or 2.5.
>
> PYTHON_DEPEND="*:2.6"
> Dependency on Python 3.2, 3.1, 3.0, 2.7 or 2.6.
>
> PYTHON_DEPEND="2:2.7 3:3.1"
> Dependency on Python 3.2, 3.1 or 2.7.
>
> PYTHON_DEPEND="2:2.5:2.6"
> Dependency on Python 2.6 or 2.5.
>
> PYTHON_DEPEND="2::2.6"
> Dependency on Python 2.6, 2.5 or 2.4.
>
> PYTHON_DEPEND="python? 2"
> Dependency on any version of Python 2 when "python" USE flag is enabled.
>

While I don't object improvements or changes on that front at all:

- How are SUPPORT_PYTHON_ABIS and RESTRICT_PYTHON_ABIS affected
by NEED_PYTHON now and by PYTHON_DEPEND in the future?

- The proposed approach doesn't look intuitive to me from a quick
view, sorry: Neither the examples nor the grammar. I didn't give
it that much time to be fair, though.



Sebastian

Fabian Groffen 01-10-2010 07:56 PM

PYTHON_DEPEND - Suggested replacement for NEED_PYTHON
 
On 10-01-2010 09:29:28 +0100, Arfrever Frehtes Taifersar Arahesis wrote:
> I would like to suggest introduction of support for PYTHON_DEPEND variable, which
> would be a better replacement for NEED_PYTHON variable. NEED_PYTHON variable
> does not allow to specify that e.g. only versions of Python 2 are accepted.
> (Eventually PYTHON_DEPEND variable will have to be set only in ebuilds of packages
> not supporting installation for multiple versions of Python.)

Can you explain the intended use of this variable, and why normal DEPEND
is not sufficient?


--
Fabian Groffen
Gentoo on a different level

Arfrever Frehtes Taifersar Arahesis 01-10-2010 08:50 PM

PYTHON_DEPEND - Suggested replacement for NEED_PYTHON
 
2010-01-10 19:41:55 Sebastian Pipping napisał(a):
> On 01/10/10 09:29, Arfrever Frehtes Taifersar Arahesis wrote:
> > I would like to suggest introduction of support for PYTHON_DEPEND variable, which
> > would be a better replacement for NEED_PYTHON variable. NEED_PYTHON variable
> > does not allow to specify that e.g. only versions of Python 2 are accepted.
> > (Eventually PYTHON_DEPEND variable will have to be set only in ebuilds of packages
> > not supporting installation for multiple versions of Python.)
> >
> > Suggested syntax:
> > PYTHON_DEPEND="[USE_flag?] <X[:[Y][:[Z]]]> [X[:[Y][:[Z]]]]"
> > <required_component>, [optional_component]
> > X - Major version of Python ('2' or '3') or '*'.
> > Y - Minimal version of Python in the form of ${major_version}.${minor_version}.
> > Z - Maximal version of Python in the form of ${major_version}.${minor_version}.
> > It will be probably very rarely used.
> >
> > Examples:
> > PYTHON_DEPEND="2"
> > Dependency on any version of Python 2.
> >
> > PYTHON_DEPEND="2:2.5"
> > Dependency on Python 2.7, 2.6 or 2.5.
> >
> > PYTHON_DEPEND="*:2.6"
> > Dependency on Python 3.2, 3.1, 3.0, 2.7 or 2.6.
> >
> > PYTHON_DEPEND="2:2.7 3:3.1"
> > Dependency on Python 3.2, 3.1 or 2.7.
> >
> > PYTHON_DEPEND="2:2.5:2.6"
> > Dependency on Python 2.6 or 2.5.
> >
> > PYTHON_DEPEND="2::2.6"
> > Dependency on Python 2.6, 2.5 or 2.4.
> >
> > PYTHON_DEPEND="python? 2"
> > Dependency on any version of Python 2 when "python" USE flag is enabled.
> >
>
> While I don't object improvements or changes on that front at all:
>
> - How are SUPPORT_PYTHON_ABIS and RESTRICT_PYTHON_ABIS affected
> by NEED_PYTHON now and by PYTHON_DEPEND in the future?

They aren't and won't be. PYTHON_DEPEND is designed mainly for packages
not supporting installation for multiple Python versions.

> - The proposed approach doesn't look intuitive to me from a quick
> view, sorry: Neither the examples nor the grammar. I didn't give
> it that much time to be fair, though.

IMHO it's sufficiently intuitive :) .

--
Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis 01-10-2010 11:25 PM

PYTHON_DEPEND - Suggested replacement for NEED_PYTHON
 
2010-01-10 21:56:01 Fabian Groffen napisał(a):
> On 10-01-2010 09:29:28 +0100, Arfrever Frehtes Taifersar Arahesis wrote:
> > I would like to suggest introduction of support for PYTHON_DEPEND variable, which
> > would be a better replacement for NEED_PYTHON variable. NEED_PYTHON variable
> > does not allow to specify that e.g. only versions of Python 2 are accepted.
> > (Eventually PYTHON_DEPEND variable will have to be set only in ebuilds of packages
> > not supporting installation for multiple versions of Python.)
>
> Can you explain the intended use of this variable, and why normal DEPEND
> is not sufficient?

PYTHON_DEPEND is intented to simplify specification of dependency on Python.

PYTHON_DEPEND="2:2.5" is shorter than:
DEPEND="|| ( =dev-lang/python-2.7* =dev-lang/python-2.6* =dev-lang/python-2.5* )"

--
Arfrever Frehtes Taifersar Arahesis

Sebastian Pipping 01-11-2010 02:55 AM

PYTHON_DEPEND - Suggested replacement for NEED_PYTHON
 
>>> PYTHON_DEPEND="2:2.5:2.6"
>>> Dependency on Python 2.6 or 2.5.

The colon (':') has two different semantics here.
This violates "different things should look different".

You are designing a language here. Please improve the proposal.



Sebastian

Fabian Groffen 01-11-2010 06:50 AM

PYTHON_DEPEND - Suggested replacement for NEED_PYTHON
 
On 11-01-2010 01:25:45 +0100, Arfrever Frehtes Taifersar Arahesis wrote:
> > Can you explain the intended use of this variable, and why normal DEPEND
> > is not sufficient?
>
> PYTHON_DEPEND is intented to simplify specification of dependency on Python.
>
> PYTHON_DEPEND="2:2.5" is shorter than:
> DEPEND="|| ( =dev-lang/python-2.7* =dev-lang/python-2.6* =dev-lang/python-2.5* )"

So if there is enough space to express the dependency with the current
syntax, is it worth introducing a new shorthand for it then?

Also for this example, why does 2:2.5 expand to 2.7, 2.6 and 2.5? I
would have expected 2.0 ... 2.5. Maybe the language isn't as intuitive
then as Sebastian pointed out.


--
Fabian Groffen
Gentoo on a different level

Duncan 01-11-2010 07:29 AM

PYTHON_DEPEND - Suggested replacement for NEED_PYTHON
 
Fabian Groffen posted on Mon, 11 Jan 2010 08:50:30 +0100 as excerpted:

> On 11-01-2010 01:25:45 +0100, Arfrever Frehtes Taifersar Arahesis wrote:
>> > Can you explain the intended use of this variable, and why normal
>> > DEPEND is not sufficient?
>>
>> PYTHON_DEPEND is intented to simplify specification of dependency on
>> Python.
>>
>> PYTHON_DEPEND="2:2.5" is shorter than: DEPEND="|| (
>> =dev-lang/python-2.7* =dev-lang/python-2.6* =dev-lang/python-2.5* )"
>
> So if there is enough space to express the dependency with the current
> syntax, is it worth introducing a new shorthand for it then?
>
> Also for this example, why does 2:2.5 expand to 2.7, 2.6 and 2.5? I
> would have expected 2.0 ... 2.5. Maybe the language isn't as intuitive
> then as Sebastian pointed out.

Initially intuitive, perhaps not, but reasonably easy after reading the
explanation:

The first position is major python version, the second if present,
minimal version (within that major), so it can be read as =>version, the
third if present, maximum version (within that major), so it can be read
as <=.

Thus, the above "2:2.5" means major version 2, minimal version 2.5 (no
maximum version within that major), so 2.5+.

--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman

Arfrever Frehtes Taifersar Arahesis 01-11-2010 07:47 AM

PYTHON_DEPEND - Suggested replacement for NEED_PYTHON
 
2010-01-11 04:55:02 Sebastian Pipping napisał(a):
> >>> PYTHON_DEPEND="2:2.5:2.6"
> >>> Dependency on Python 2.6 or 2.5.
>
> The colon (':') has two different semantics here.

The colon is only separator of components, so it has the same semantic.
Each component has strictly defined meaning.

--
Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis 01-11-2010 08:00 AM

PYTHON_DEPEND - Suggested replacement for NEED_PYTHON
 
2010-01-11 08:50:30 Fabian Groffen napisał(a):
> On 11-01-2010 01:25:45 +0100, Arfrever Frehtes Taifersar Arahesis wrote:
> > > Can you explain the intended use of this variable, and why normal DEPEND
> > > is not sufficient?
> >
> > PYTHON_DEPEND is intented to simplify specification of dependency on Python.
> >
> > PYTHON_DEPEND="2:2.5" is shorter than:
> > DEPEND="|| ( =dev-lang/python-2.7* =dev-lang/python-2.6* =dev-lang/python-2.5* )"
>
> So if there is enough space to express the dependency with the current
> syntax, is it worth introducing a new shorthand for it then?

Some eclasses already support some shorthands for specification of some
dependencies (e.g. need_apache2() in depend.apache.eclass).
As maintainer of some packages depending on Python, I express interest in
possibility of brief specification of dependency on Python. I won't be
enforcing using of this variable for developers, who want to directly
specify dependencies in {,R}DEPEND.

> Also for this example, why does 2:2.5 expand to 2.7, 2.6 and 2.5? I
> would have expected 2.0 ... 2.5.

The first component ('2') specifies the group of accepted versions.
The second component ('2.5') specifies the minimal accepted version inside
this group. ('2:2.5' is identical to '2:2.5:'.)

--
Arfrever Frehtes Taifersar Arahesis


All times are GMT. The time now is 07:46 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.