librelist archives

« back to archive

conditional Metadata 1.2+ requiremetns

conditional Metadata 1.2+ requiremetns

From:
Daniel Holth
Date:
2012-10-18 @ 14:12
For Metadata 1.2+ style conditional requirements, it would be enough
to allow in bento.info

Requires: foo; python_version == '4'

This would go directly into PKG-INFO as a Requires-Dist: line (the ;
marker syntax is not supported in setuptools' requires.txt):

Name: somepackage
Version: 1.0
Classifiers: ...
Requires-Dist: foo; python_version == '4'

This makes more sense than trying to compile a bento-style conditional

if os(win32):
    Require: something

into an environment marker.

In my mind Bento-style conditions allow you to generate multiple
packages from a single sdist based on the build environment, while
Metadata 1.2+ style environment markers allow you to have a single
package with different requirements depending on the install
environment.

With environment markers and generating a requires.txt for
compatibility, the best strategy is to omit the conditional
requirements and only include the unconditional ones.

Re: [bento] conditional Metadata 1.2+ requiremetns

From:
David Cournapeau
Date:
2012-10-20 @ 19:58
On Thu, Oct 18, 2012 at 4:12 PM, Daniel Holth <dholth@gmail.com> wrote:
> For Metadata 1.2+ style conditional requirements, it would be enough
> to allow in bento.info
>
> Requires: foo; python_version == '4'
>
> This would go directly into PKG-INFO as a Requires-Dist: line (the ;
> marker syntax is not supported in setuptools' requires.txt):
>
> Name: somepackage
> Version: 1.0
> Classifiers: ...
> Requires-Dist: foo; python_version == '4'
>
> This makes more sense than trying to compile a bento-style conditional
>
> if os(win32):
>     Require: something
>
> into an environment marker.

I am not sure I agree. By itself, being compatible with existing
'standards' in python packaging is not a very strong argument,
features are.

You *do* need the concept of if/else in the requirements, otherwise,
how can you support something as:

if os(win32):
    Requires: foo, pywin32
else:
    Requires: foo

? This only gets more complicated once we get into provides/obsoletes.

David

Re: [bento] conditional Metadata 1.2+ requiremetns

From:
Daniel Holth
Date:
2012-10-20 @ 20:22
On Sat, Oct 20, 2012 at 3:58 PM, David Cournapeau <cournape@gmail.com> wrote:
> On Thu, Oct 18, 2012 at 4:12 PM, Daniel Holth <dholth@gmail.com> wrote:
>> For Metadata 1.2+ style conditional requirements, it would be enough
>> to allow in bento.info
>>
>> Requires: foo; python_version == '4'
>>
>> This would go directly into PKG-INFO as a Requires-Dist: line (the ;
>> marker syntax is not supported in setuptools' requires.txt):
>>
>> Name: somepackage
>> Version: 1.0
>> Classifiers: ...
>> Requires-Dist: foo; python_version == '4'
>>
>> This makes more sense than trying to compile a bento-style conditional
>>
>> if os(win32):
>>     Require: something
>>
>> into an environment marker.
>
> I am not sure I agree. By itself, being compatible with existing
> 'standards' in python packaging is not a very strong argument,
> features are.
>
> You *do* need the concept of if/else in the requirements, otherwise,
> how can you support something as:
>
> if os(win32):
>     Requires: foo, pywin32
> else:
>     Requires: foo
>
> ? This only gets more complicated once we get into provides/obsoletes.
>
> David

In Metadata 1.2+, the newer packaging peps that no one really uses
yet, this is two lines that are always written to PKG-INFO aka
METADATA:

Requires-Dist: pywin32; os == 'win32'
Requires-Dist: foo

Bento would run on the build machine and output both Requires-Dist:
lines. You would copy the package to another machine, and without
Bento, evaluate the Requires-Dist: lines.

Re: [bento] conditional Metadata 1.2+ requiremetns

From:
David Cournapeau
Date:
2012-10-22 @ 11:17
On Sat, Oct 20, 2012 at 10:22 PM, Daniel Holth <dholth@gmail.com> wrote:
> On Sat, Oct 20, 2012 at 3:58 PM, David Cournapeau <cournape@gmail.com> wrote:
>> On Thu, Oct 18, 2012 at 4:12 PM, Daniel Holth <dholth@gmail.com> wrote:
>>> For Metadata 1.2+ style conditional requirements, it would be enough
>>> to allow in bento.info
>>>
>>> Requires: foo; python_version == '4'
>>>
>>> This would go directly into PKG-INFO as a Requires-Dist: line (the ;
>>> marker syntax is not supported in setuptools' requires.txt):
>>>
>>> Name: somepackage
>>> Version: 1.0
>>> Classifiers: ...
>>> Requires-Dist: foo; python_version == '4'
>>>
>>> This makes more sense than trying to compile a bento-style conditional
>>>
>>> if os(win32):
>>>     Require: something
>>>
>>> into an environment marker.
>>
>> I am not sure I agree. By itself, being compatible with existing
>> 'standards' in python packaging is not a very strong argument,
>> features are.
>>
>> You *do* need the concept of if/else in the requirements, otherwise,
>> how can you support something as:
>>
>> if os(win32):
>>     Requires: foo, pywin32
>> else:
>>     Requires: foo
>>
>> ? This only gets more complicated once we get into provides/obsoletes.
>>
>> David
>
> In Metadata 1.2+, the newer packaging peps that no one really uses
> yet, this is two lines that are always written to PKG-INFO aka
> METADATA:
>
> Requires-Dist: pywin32; os == 'win32'
> Requires-Dist: foo
>
> Bento would run on the build machine and output both Requires-Dist:
> lines. You would copy the package to another machine, and without
> Bento, evaluate the Requires-Dist: lines.

I don't think this format is much better than what bento does, and
converting from bento to this format should be easy. IMO, there is no
strong rationale to change what bento does now for this.

David

Re: [bento] conditional Metadata 1.2+ requiremetns

From:
Daniel Holth
Date:
2012-10-22 @ 11:28
On Oct 22, 2012 7:18 AM, "David Cournapeau" <cournape@gmail.com> wrote:
>
> On Sat, Oct 20, 2012 at 10:22 PM, Daniel Holth <dholth@gmail.com> wrote:
> > On Sat, Oct 20, 2012 at 3:58 PM, David Cournapeau <cournape@gmail.com>
wrote:
> >> On Thu, Oct 18, 2012 at 4:12 PM, Daniel Holth <dholth@gmail.com> wrote:
> >>> For Metadata 1.2+ style conditional requirements, it would be enough
> >>> to allow in bento.info
> >>>
> >>> Requires: foo; python_version == '4'
> >>>
> >>> This would go directly into PKG-INFO as a Requires-Dist: line (the ;
> >>> marker syntax is not supported in setuptools' requires.txt):
> >>>
> >>> Name: somepackage
> >>> Version: 1.0
> >>> Classifiers: ...
> >>> Requires-Dist: foo; python_version == '4'
> >>>
> >>> This makes more sense than trying to compile a bento-style conditional
> >>>
> >>> if os(win32):
> >>>     Require: something
> >>>
> >>> into an environment marker.
> >>
> >> I am not sure I agree. By itself, being compatible with existing
> >> 'standards' in python packaging is not a very strong argument,
> >> features are.
> >>
> >> You *do* need the concept of if/else in the requirements, otherwise,
> >> how can you support something as:
> >>
> >> if os(win32):
> >>     Requires: foo, pywin32
> >> else:
> >>     Requires: foo
> >>
> >> ? This only gets more complicated once we get into provides/obsoletes.
> >>
> >> David
> >
> > In Metadata 1.2+, the newer packaging peps that no one really uses
> > yet, this is two lines that are always written to PKG-INFO aka
> > METADATA:
> >
> > Requires-Dist: pywin32; os == 'win32'
> > Requires-Dist: foo
> >
> > Bento would run on the build machine and output both Requires-Dist:
> > lines. You would copy the package to another machine, and without
> > Bento, evaluate the Requires-Dist: lines.
>
> I don't think this format is much better than what bento does, and
> converting from bento to this format should be easy. IMO, there is no
> strong rationale to change what bento does now for this.
>
> David

It's not better. It is just likely to be supported by pip. How do I know
which bento conditionals to defer to install time?

Re: [bento] conditional Metadata 1.2+ requiremetns

From:
David Cournapeau
Date:
2012-10-22 @ 11:33
On Mon, Oct 22, 2012 at 1:28 PM, Daniel Holth <dholth@gmail.com> wrote:
>
> On Oct 22, 2012 7:18 AM, "David Cournapeau" <cournape@gmail.com> wrote:
>>
>> On Sat, Oct 20, 2012 at 10:22 PM, Daniel Holth <dholth@gmail.com> wrote:
>> > On Sat, Oct 20, 2012 at 3:58 PM, David Cournapeau <cournape@gmail.com>
>> > wrote:
>> >> On Thu, Oct 18, 2012 at 4:12 PM, Daniel Holth <dholth@gmail.com> wrote:
>> >>> For Metadata 1.2+ style conditional requirements, it would be enough
>> >>> to allow in bento.info
>> >>>
>> >>> Requires: foo; python_version == '4'
>> >>>
>> >>> This would go directly into PKG-INFO as a Requires-Dist: line (the ;
>> >>> marker syntax is not supported in setuptools' requires.txt):
>> >>>
>> >>> Name: somepackage
>> >>> Version: 1.0
>> >>> Classifiers: ...
>> >>> Requires-Dist: foo; python_version == '4'
>> >>>
>> >>> This makes more sense than trying to compile a bento-style conditional
>> >>>
>> >>> if os(win32):
>> >>>     Require: something
>> >>>
>> >>> into an environment marker.
>> >>
>> >> I am not sure I agree. By itself, being compatible with existing
>> >> 'standards' in python packaging is not a very strong argument,
>> >> features are.
>> >>
>> >> You *do* need the concept of if/else in the requirements, otherwise,
>> >> how can you support something as:
>> >>
>> >> if os(win32):
>> >>     Requires: foo, pywin32
>> >> else:
>> >>     Requires: foo
>> >>
>> >> ? This only gets more complicated once we get into provides/obsoletes.
>> >>
>> >> David
>> >
>> > In Metadata 1.2+, the newer packaging peps that no one really uses
>> > yet, this is two lines that are always written to PKG-INFO aka
>> > METADATA:
>> >
>> > Requires-Dist: pywin32; os == 'win32'
>> > Requires-Dist: foo
>> >
>> > Bento would run on the build machine and output both Requires-Dist:
>> > lines. You would copy the package to another machine, and without
>> > Bento, evaluate the Requires-Dist: lines.
>>
>> I don't think this format is much better than what bento does, and
>> converting from bento to this format should be easy. IMO, there is no
>> strong rationale to change what bento does now for this.
>>
>> David
>
> It's not better. It is just likely to be supported by pip. How do I know
> which bento conditionals to defer to install time?

to be clear, I will support the PKG-INFO format (once the Require-Dist
format is clearly specified - I expect it to change again in the near
future). I am just reluctant to change the syntax inside the
bento.info file.

David