python singlespec: how to convert your package

classic Classic list List threaded Threaded
53 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

jan matejek-4
On 2.3.2017 18:16, Luigi Baldoni wrote:
>> %ifpython2 and friends don't work in %prep/%build/%install/%check,
>> because these sections are common to all the subpackages.
>> IOW, the code in %prep and friends is only run once per build, and must
>> handle all pythons at once.
>
> In other words I need to put the logic into an external script or setup.py
> itself to differentiate between py2 and py3, right?

well, the "external script" will also only run once.
you can use "%python_exec script.py" to run it once for every flavor
or something like:
%{python_expand sh script.sh --python=$python}

You can't, for example, conditionally apply patches, because the source
tree is shared. (which i suppose is what you want to do)
So the logic of the patch would have to be included in setup.py.
Or you could apply and unapply the patch before/after build, see below.

if you're taking special steps for build, you could do:
%{python_expand ./do-the-special-step
%$python_build}
similar for %python_install

or even:
%{python_expand if "$python" == "python2"; then
   ./do-special-python2-step
   %python2_build
else
   %$python_build
fi}

(everything inside the {braces} for python_expand is part of the loop.
But if it has multiple lines, the first one must not be empty. RPM
limitation, i suppose.)

>
>
>> What are you trying to do? Can't you simply do it without the conditional?
>
> In the case in question, argparse doesn't exist for python3, so setup.py
> fails setup_requires. I need a patch, I suppose.

Yes, you need a patch, and make it so that the requirement is completely
removed :)
argparse module is part of Python from 2.7 and 3.2, so unless you're
building for SLE11, you don't need it.

>
> Also, what about libraries that exist only for py2 or py3? Does it make
> sense to use singlespec for those? (I failed when I tried)

For python2, leave it as is. Only if it is a new package, call it
"python2-something". If it is an existing package, add "Provides:
python2-something".

For python3, it's unclear. We will be supporting pypy3 as well, maybe
the library will work there? It would be better to write it as
singlespec and "%undefine have_python2" at start.
This might fail because of bugs. The scenario should work but it is
completely untested as of now.

> Will we have to submit plain python3-foo to d:l:p once d:l:p3 is eliminated?

yes.

>
> Regards
>
> P.S: Should I keep submitting stuff to d:l:p:singlespec? If the conversion
> script is around the corner I'll just wait.

We will now be dropping packages from d:l:py:singlespec as they go to
d:l:py, so at this point you can submit to d:l:py directly.

I will run a mass conversion sometime next week, but we will probably
need to review every autoconverted package. So if you are doing it
manually already, you can continue. Or you can wait and save yourself a
bit of work :)

regards
m.

>
>
>
>
> --
> View this message in context: http://opensuse.14.x6.nabble.com/python-singlespec-how-to-convert-your-package-tp5080741p5081905.html
> Sent from the opensuse-packaging mailing list archive at Nabble.com.
>

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Luigi Baldoni
jan matejek-4 wrote
On 2.3.2017 18:16, Luigi Baldoni wrote:

> Also, what about libraries that exist only for py2 or py3? Does it make
> sense to use singlespec for those? (I failed when I tried)

For python3, it's unclear. We will be supporting pypy3 as well, maybe
the library will work there? It would be better to write it as
singlespec and "%undefine have_python2" at start.
This might fail because of bugs. The scenario should work but it is
completely untested as of now.
In fact it creates both py2 and py3 rpms, populates them both with py3
files and then complains about the conflict:/

I guess I'll submit it plain.

Regards
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Robert Schweikert-6
In reply to this post by jan matejek-4
Hi,

ONce again for taking this on....HELP.....

On 02/17/2017 12:31 PM, jan matejek wrote:
> Dear packagers,
>
<snip>

> Conversion steps:
>
> 0. If you want to build for anything other than Factory, you need to
> include compatibility shims.
> This definition of the %python_module macro goes on top of your spec:
> %{?!python_module:%define python_module() python-%1 python3-%1}
> and a buildrequire:
> BuildRequires: python-rpm-macros
>
> 1. Wrap all your "BuildRequires: python-something":
> BuildRequires: %{python_module something}
> Do not do this in Requires or any other fields.
> If you have a buildrequire that should only apply to one python, say,
> python-enum34 only for python 2, do not wrap it.
>
> 2. At the end of the spec preamble, before %description, place the macro:
> %python_subpackages
> on a line by itself
>
Got this far only :(

For an upcoming project I need python-datrie which currently only exists
in d:l:p3 thus rather than create more things to be converted I figured
I'd try myself on the single-spec use and get the package moved  to d:l:p

To start with I started copying things so I don't fiddle myself into a
corner where rm -rf is my only recourse... So I copied (osc copypac)
from d:l:p3 to home:rjschwei [1]. I set up the spec file to be
single-spec to the point where I thought it should work. Locally I
copied the setup into my checked out d:l:p project directory and then
tried to build, but:

-> osc build openSUSE_Factory
unresolvable: nothing provides python2-pytest-runner

However pytest-runner has already been moved to single-spec [2] thus I
would expect python2-pytest-runner to be there.

Confused.....

Help is appreciated,
Robert

[1] https://build.opensuse.org/package/show/home:rjschwei/python-datrie
[2]
https://build.opensuse.org/package/view_file/devel:languages:python/python-pytest-runner/python-pytest-runner.changes?expand=1

--
Robert Schweikert                   MAY THE SOURCE BE WITH YOU
Distinguished Architect                       LINUX
Team Lead Public Cloud
[hidden email]
IRC: robjo


signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Thomas Bechtold
Hi,

On Fri, 2017-03-03 at 19:51 -0500, Robert Schweikert wrote:
[...]

> 2. At the end of the spec preamble, before %description, place the
> > macro:
> > %python_subpackages
> > on a line by itself
> >
>
> Got this far only :(
>
> For an upcoming project I need python-datrie which currently only
> exists
> in d:l:p3 thus rather than create more things to be converted I
> figured
> I'd try myself on the single-spec use and get the package moved  to
> d:l:p
>
> To start with I started copying things so I don't fiddle myself into
> a
> corner where rm -rf is my only recourse... So I copied (osc copypac)
> from d:l:p3 to home:rjschwei [1]. I set up the spec file to be
> single-spec to the point where I thought it should work. Locally I
> copied the setup into my checked out d:l:p project directory and then
> tried to build, but:
>
> -> osc build openSUSE_Factory
> unresolvable: nothing provides python2-pytest-runner

That works for me now. Maybe the package python2-pytest-runner was not
yet build?

Tom
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Robert Schweikert-6


On 03/06/2017 01:57 AM, Thomas Bechtold wrote:

> Hi,
>
> On Fri, 2017-03-03 at 19:51 -0500, Robert Schweikert wrote:
> [...]
>> 2. At the end of the spec preamble, before %description, place the
>>> macro:
>>> %python_subpackages
>>> on a line by itself
>>>
>>
>> Got this far only :(
>>
>> For an upcoming project I need python-datrie which currently only
>> exists
>> in d:l:p3 thus rather than create more things to be converted I
>> figured
>> I'd try myself on the single-spec use and get the package moved  to
>> d:l:p
>>
>> To start with I started copying things so I don't fiddle myself into
>> a
>> corner where rm -rf is my only recourse... So I copied (osc copypac)
>> from d:l:p3 to home:rjschwei [1]. I set up the spec file to be
>> single-spec to the point where I thought it should work. Locally I
>> copied the setup into my checked out d:l:p project directory and then
>> tried to build, but:
>>
>> -> osc build openSUSE_Factory
>> unresolvable: nothing provides python2-pytest-runner
>
> That works for me now. Maybe the package python2-pytest-runner was not
> yet build?

Well I did check and at least that status for the package in the web
console showed that the build for pytest-runner had succeeded and the
repo had published.

Maybe now with the multi-version build the status in the UI is no longer
consistent with the build? But I have no idea how to investigate this.

@Jan,

Did you look at this previously? I do not know who OBS determines the
status. Could it be possible that OBS switches to "succeeded" an sets
the repo status to "published" when only 1/2 of the build is complete,
i.e. either the py3 or p2 build is done?

Now I am stuck at:

unresolvable: nothing provides python3-hypothesis
      nothing provides python3-pytest-runner

but [1] shows the build of hypothesis for the target I used
openSUSE_Leap_42.1 to be successful and the repo to be published. Also
confirmed in the UI [2]. Or maybe I am hitting some buildinfo issue
being triggered?

Thanks,
Robert

[1]
https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis
[2]
https://build.opensuse.org/package/binaries/devel:languages:python/python-hypothesis?repository=openSUSE_Leap_42.1

--
Robert Schweikert                   MAY THE SOURCE BE WITH YOU
Distinguished Architect                       LINUX
Team Lead Public Cloud
[hidden email]
IRC: robjo
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

jan matejek-4
hello,

On 7.3.2017 00:45, Robert Schweikert wrote:

>>> -> osc build openSUSE_Factory
>>> unresolvable: nothing provides python2-pytest-runner
>>
>> That works for me now. Maybe the package python2-pytest-runner was not
>> yet build?
>
> Well I did check and at least that status for the package in the web
> console showed that the build for pytest-runner had succeeded and the
> repo had published.
>
> Maybe now with the multi-version build the status in the UI is no longer
> consistent with the build? But I have no idea how to investigate this.
>
> @Jan,
>
> Did you look at this previously? I do not know who OBS determines the
> status. Could it be possible that OBS switches to "succeeded" an sets
> the repo status to "published" when only 1/2 of the build is complete,
> i.e. either the py3 or p2 build is done?
Definitely not. there is still a single build step, only now it produces
two (or more) RPMs. The monitor is correct, the only thing that could be
happening is that the resolver is slow to propagate the changes (esp. in
cases where the provided RPMs are now changed)

>
> Now I am stuck at:
>
> unresolvable: nothing provides python3-hypothesis
>       nothing provides python3-pytest-runner
>
> but [1] shows the build of hypothesis for the target I used
> openSUSE_Leap_42.1 to be successful and the repo to be published. Also
> confirmed in the UI [2]. Or maybe I am hitting some buildinfo issue
> being triggered?
note that you are NOT using d:l:py for the basis of your Leap build! In
your home repo, you are building against vanilla Leap, which does not
and will not have many of the packages.

(and indeed, Factory seems to work fine)

hope this helps
m.

>
> Thanks,
> Robert
>
> [1]
> https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis
> [2]
> https://build.opensuse.org/package/binaries/devel:languages:python/python-hypothesis?repository=openSUSE_Leap_42.1
>



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

jan matejek-4
In reply to this post by jan matejek-4
hello,
there is now a wiki page that supersedes the following instructions. It
will be kept up to date, which is impossible with an e-mail :)

see:
https://en.opensuse.org/openSUSE:Packaging_Python_Singlespec

Notably a significant bug is fixed:

> This definition of the %python_module macro goes on top of your spec:
> %{?!python_module:%define python_module() python-%1 python3-%1}

should be:
%{?!python_module:%define python_module() python-%{**} python3-%{**}}

regards
m.


signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Luigi Baldoni
There's still something I don't understand: how do I handle runtime dependencies
if they're different for py2 and py3?

And if I put python-foo and python3-bar in Requires, how is Factory going to
untangle that?

Regards
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Robert Schweikert-6
In reply to this post by jan matejek-4
Hi,

On 03/07/2017 07:48 AM, jan matejek wrote:

> hello,
>
> On 7.3.2017 00:45, Robert Schweikert wrote:
>>>> -> osc build openSUSE_Factory
>>>> unresolvable: nothing provides python2-pytest-runner
>>>
>>> That works for me now. Maybe the package python2-pytest-runner was not
>>> yet build?
>>
>> Well I did check and at least that status for the package in the web
>> console showed that the build for pytest-runner had succeeded and the
>> repo had published.
>>
>> Maybe now with the multi-version build the status in the UI is no longer
>> consistent with the build? But I have no idea how to investigate this.
>>
>> @Jan,
>>
>> Did you look at this previously? I do not know who OBS determines the
>> status. Could it be possible that OBS switches to "succeeded" an sets
>> the repo status to "published" when only 1/2 of the build is complete,
>> i.e. either the py3 or p2 build is done?
>
> Definitely not. there is still a single build step, only now it produces
> two (or more) RPMs. The monitor is correct, the only thing that could be
> happening is that the resolver is slow to propagate the changes (esp. in
> cases where the provided RPMs are now changed)
>
>>
>> Now I am stuck at:
>>
>> unresolvable: nothing provides python3-hypothesis
>>       nothing provides python3-pytest-runner
>>
>> but [1] shows the build of hypothesis for the target I used
>> openSUSE_Leap_42.1 to be successful and the repo to be published. Also
>> confirmed in the UI [2]. Or maybe I am hitting some buildinfo issue
>> being triggered?
>
> note that you are NOT using d:l:py for the basis of your Leap build! In
> your home repo, you are building against vanilla Leap, which does not
> and will not have many of the packages.
Yes, in home:rjschwei the project is not set up correctly. I copied the
content to d:l:py locally, which has other packages checked out and ran
the build there. The error is generated in this local directly which
does build against d:l:py. And yes build against Factory worked.

Later,
Robert

--
Robert Schweikert                   MAY THE SOURCE BE WITH YOU
Distinguished Architect                       LINUX
Team Lead Public Cloud
[hidden email]
IRC: robjo


signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

jan matejek-4
hello,

On 7.3.2017 22:36, Robert Schweikert wrote:
> Yes, in home:rjschwei the project is not set up correctly. I copied the
> content to d:l:py locally, which has other packages checked out and ran
> the build there. The error is generated in this local directly which
> does build against d:l:py. And yes build against Factory worked.

I'm afraid i don't understand your configuration.

Can you set up a subproject in OBS and reproduce your problem there?

thanks
m.

>
> Later,
> Robert
>



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

jan matejek-4
In reply to this post by Luigi Baldoni


On 7.3.2017 18:42, Luigi Baldoni wrote:
> There's still something I don't understand: how do I handle runtime
> dependencies
> if they're different for py2 and py3?

you wrap them in %ifpython2 / %ifpython3 / %ifpypy3 declarations

i have clarified this a little in point 3. Please let me know if you
still think that this should be explained better, or maybe more prominently?

>
> And if I put python-foo and python3-bar in Requires, how is Factory
going to
> untangle that?

python-foo will be translated to python2-foo, python3-foo, or whichever
is appropriate for the target package.

If your package is called "python3-something", then python3-bar will get
the same treatment.

The rewriter is looking for packages that start the same as the main
package. So basically, if your package is called "python3-something",
then it expects to see:
Name: python3-something
Requires: python3-foo

and creates subpackage with:
Name: python2-something
Requires: python2-foo

If your package is *not* called python3, but only "python-something", so
it looks like this:
Name: python-something
Requires: python3-foo

then "python3-foo" is left alone -- and copied to all subpackages, so
even "python2-something" will require "python3-foo".

What you probably mean to write in such case is:
Name: python-something
%ifpython3
Requires: python3-foo
%endif

in which case, only the "python3-something" package gets the
"python3-foo" requirement.

You could also say:
Name: python-something
%ifpython3
Requires: python-foo
%endif

and the same thing would happen: your "python3-something" package gets
"python3-foo" requirement.

---

If you need to avoid this, and simply copy the unchanged package name,
you need to hide it behind a macro:
Name: python-something
%define oldpython python
Requires: %{oldpython}-foo

in this case, all subpackages (python2-something, python3-something)
have requirement on "python-foo".

hope this helps
m.



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Robert Schweikert-6
In reply to this post by jan matejek-4
On 03/08/2017 08:02 AM, jan matejek wrote:

> hello,
>
> On 7.3.2017 22:36, Robert Schweikert wrote:
>> Yes, in home:rjschwei the project is not set up correctly. I copied the
>> content to d:l:py locally, which has other packages checked out and ran
>> the build there. The error is generated in this local directly which
>> does build against d:l:py. And yes build against Factory worked.
>
> I'm afraid i don't understand your configuration.
>
> Can you set up a subproject in OBS and reproduce your problem there?
>
OK, a bit better to follow now I hope [1]

If I add
%{python_sitelib}/*

to the %files section I end up with:

[   14s] RPM build errors:
[   14s]     File not found:
/home/abuild/rpmbuild/BUILDROOT/python-datrie-0.7.1-0.x86_64/usr/lib/python2.7/site-packages/*

Thanks,
Robert

[1]
https://build.opensuse.org/package/live_build_log/home:rjschwei/python-datrie/openSUSE_Factory/x86_64


--
Robert Schweikert                   MAY THE SOURCE BE WITH YOU
Distinguished Architect                       LINUX
Team Lead Public Cloud
[hidden email]
IRC: robjo


signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Robert Schweikert-6
In reply to this post by jan matejek-4
On 03/07/2017 10:39 AM, jan matejek wrote:
> hello,
> there is now a wiki page that supersedes the following instructions. It
> will be kept up to date, which is impossible with an e-mail :)
>
> see:
> https://en.opensuse.org/openSUSE:Packaging_Python_Singlespec
>
> Notably a significant bug is fixed:
>

OK, now that the train is rolling I think we need to come back to the
other part of the discussion, i.e. what to keep in d:l:py and what to
evict, as if I remember correctly that point was postponed.

There exist packages (python3-kiwi) for example for which it really
makes no sense to build a Py2 and a Py3 version. So the question is, I
think, do we keep packages that only need to be built in one version of
Python in d:l:py?

If the answer is yes we'll need some way to configure things that way in
the spec, i.e. %{only_build_py3} for example.

If the answer is no, we need to evict those packages and document
accordingly.

Thoughts?

Thanks,
Robert

--
Robert Schweikert                   MAY THE SOURCE BE WITH YOU
Distinguished Architect                       LINUX
Team Lead Public Cloud
[hidden email]
IRC: robjo


signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Luigi Baldoni
I also have another question: how come %python_expand does not expand %{$py_ver}?

Regards
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

todd rme
On Sun, Mar 12, 2017 at 1:38 PM, Luigi Baldoni <[hidden email]> wrote:
> I also have another question: how come %python_expand does not expand
> %{$py_ver}?
>
> Regards

I think it only works with the full "python" word, not "py".  That
macro is deprecated anyway, the new "%{$python_version}" should work
fine, although in most situations you want %{$python2_bin_suffix},
which gives unique names for different python flavors that have the
same version (like potentially python3 and pypy3)..
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

jan matejek-4
In reply to this post by Robert Schweikert-6
hello,

On 12.3.2017 15:41, Robert Schweikert wrote:
> If I add
> %{python_sitelib}/*
>
> to the %files section I end up with:
>
> [   14s] RPM build errors:
> [   14s]     File not found:
> /home/abuild/rpmbuild/BUILDROOT/python-datrie-0.7.1-0.x86_64/usr/lib/python2.7/site-packages/*

that's because of the difference between "sitelib" (for noarch packages)
and "sitearch" (for arch-dependent ones).

You'll note that this message says file not found in "/usr/lib", and the
error message from your build log says that unpackaged files are in
"/usr/lib64"

in this case, the right entry in filelist is:
%{python_sitearch}/*

hope this helps
m.

>
> Thanks,
> Robert
>
> [1]
> https://build.opensuse.org/package/live_build_log/home:rjschwei/python-datrie/openSUSE_Factory/x86_64
>
>



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Robert Schweikert-6
In reply to this post by jan matejek-4
On 02/17/2017 12:31 PM, jan matejek wrote:

> Dear packagers,
>
> this is an overview of how singlespec works and how to use it for your
> package. First, some key concepts:
>
> * It will allow you to build Python 2 and Python 3 (and PyPy 3 in the
> future) package from a single spec file, with very little manual effort.
> This means that if you're maintaining a separate python3-something in
> d:l:py3, you can now switch over to the common python-something in d:l:py.
>
<snip>

I just realized that we broke quilt with the new macros :(

error: line 30: Dependency tokens must begin with alpha-numeric, '_' or
'/': BuildRequires:  %{python_module setuptools}
The %prep section of python-azure-mgmt-authorization.spec failed;
results may be incomplete


I guess quilt needs to be taught new tricks?

Of course the work around is to create diffs for needed patches the "old
fashioned" way, but quilt is convenient and I think we should not take
that away from packagers.

Thoughts?

Robert


--
Robert Schweikert                   MAY THE SOURCE BE WITH YOU
Distinguished Architect                       LINUX
Team Lead Public Cloud
[hidden email]
IRC: robjo


signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Simon Lees-3


On 03/18/2017 10:59 PM, Robert Schweikert wrote:

> On 02/17/2017 12:31 PM, jan matejek wrote:
>> Dear packagers,
>>
>> this is an overview of how singlespec works and how to use it for your
>> package. First, some key concepts:
>>
>> * It will allow you to build Python 2 and Python 3 (and PyPy 3 in the
>> future) package from a single spec file, with very little manual effort.
>> This means that if you're maintaining a separate python3-something in
>> d:l:py3, you can now switch over to the common python-something in d:l:py.
>>
> <snip>
>
> I just realized that we broke quilt with the new macros :(
>
> error: line 30: Dependency tokens must begin with alpha-numeric, '_' or
> '/': BuildRequires:  %{python_module setuptools}
> The %prep section of python-azure-mgmt-authorization.spec failed;
> results may be incomplete
>
>
> I guess quilt needs to be taught new tricks?
>
> Of course the work around is to create diffs for needed patches the "old
> fashioned" way, but quilt is convenient and I think we should not take
> that away from packagers.
>
> Thoughts?
>
> Robert
>
>
I guess it won't be hard to teach quilt, but it will certainly need to
be done, its used regularly by most serious packages, i'm guessing no
one noticed this until now.

--

Simon Lees (Simotek)                            http://simotek.net

Emergency Update Team                           keybase.io/simotek
SUSE Linux                           Adelaide Australia, UTC+10:30
GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B


signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Andrei Borzenkov
19.03.2017 07:15, Simon Lees пишет:

>
>
> On 03/18/2017 10:59 PM, Robert Schweikert wrote:
>> On 02/17/2017 12:31 PM, jan matejek wrote:
>>> Dear packagers,
>>>
>>> this is an overview of how singlespec works and how to use it for your
>>> package. First, some key concepts:
>>>
>>> * It will allow you to build Python 2 and Python 3 (and PyPy 3 in the
>>> future) package from a single spec file, with very little manual effort.
>>> This means that if you're maintaining a separate python3-something in
>>> d:l:py3, you can now switch over to the common python-something in d:l:py.
>>>
>> <snip>
>>
>> I just realized that we broke quilt with the new macros :(
>>
>> error: line 30: Dependency tokens must begin with alpha-numeric, '_' or
>> '/': BuildRequires:  %{python_module setuptools}
>> The %prep section of python-azure-mgmt-authorization.spec failed;
>> results may be incomplete
>>
>>
>> I guess quilt needs to be taught new tricks?
>>
Not really, you just need to have this macro defined. Either you install
package providing this macro or do

echo "%python_module setuptools this macro definition" >> ~/.rpmmacros

>> Of course the work around is to create diffs for needed patches the "old
>> fashioned" way, but quilt is convenient and I think we should not take
>> that away from packagers.
>>
>> Thoughts?
>>
>> Robert
>>
>>
>
> I guess it won't be hard to teach quilt, but it will certainly need to
> be done, its used regularly by most serious packages, i'm guessing no
> one noticed this until now.
>
It is not quilt that fails, it is RPM. quilt simply does "rpmbuild -bp
foo.spec"; it's RPM which handles macro expansion.

I did hit it in the past and I did define macros for packages I required
locally. I do not see how it can be fixed else.


signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python singlespec: how to convert your package

Christian Boltz-5
Hello,

Am Sonntag, 19. März 2017, 07:43:45 CET schrieb Andrei Borzenkov:
> It is not quilt that fails, it is RPM. quilt simply does "rpmbuild -bp
> foo.spec"; it's RPM which handles macro expansion.
>
> I did hit it in the past and I did define macros for packages I
> required locally. I do not see how it can be fixed else.

Wild guess: install the latest   python-rpm-macros   package?
(and, in general, all *-macros packages you might need)

Hmm, I wonder if we should have something like
    QuiltRequires:   python-rpm-macros
in our spec files ;-)


Regards,

Christian Boltz
--
Will ich mich demnaechst mal ranmachen,
allerdings momentan zuviel extrem unwichtige Sachen zu tun.
[Marcel Schmedes in suse-linux]   ^^

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

123