How to "Provide" <name> for python singlespec packages without the "python2/3"-prefix?

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

How to "Provide" <name> for python singlespec packages without the "python2/3"-prefix?

Oliver Kurz-2
With python singlespec my package names get prepended by python3- or python2-
in all cases. Can I somehow achieve to provide a package name for one of the
two python versions without any "python2/3-" prefix?

For example:
https://build.opensuse.org/package/view_file/network:messaging:matrix/matrix-synapse/matrix-synapse.spec?expand=1

has
Name:           matrix-synapse

but is a full python singlespec spec file yielding
* python2-matrix-synapse
* python3-matrix-synapse

but I would like at least one package to be or "provide" matrix-synapse. If
not possible I would also be ok to build it just with one python version to
end up with just "matrix-synapse". But again: What's the proper way?

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

Reply | Threaded
Open this post in threaded view
|

Re: How to "Provide" <name> for python singlespec packages without the "python2/3"-prefix?

Martin Pluskal-2
On 6/30/17 9:36 PM, Oliver Kurz wrote:

> With python singlespec my package names get prepended by python3- or python2-
> in all cases. Can I somehow achieve to provide a package name for one of the
> two python versions without any "python2/3-" prefix?
>
> For example:
> https://build.opensuse.org/package/view_file/network:messaging:matrix/matrix-synapse/matrix-synapse.spec?expand=1
>
> has
> Name:           matrix-synapse
>
> but is a full python singlespec spec file yielding
> * python2-matrix-synapse
> * python3-matrix-synapse
>
> but I would like at least one package to be or "provide" matrix-synapse. If
> not possible I would also be ok to build it just with one python version to
> end up with just "matrix-synapse". But again: What's the proper way?
>
> Regards,
> Oliver
>
Hi

Something like:

%ifpython3
Provides:       matrix-synapse = %{version}
%endif

Cheers

M


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

Re: How to "Provide" <name> for python singlespec packages without the "python2/3"-prefix?

Oliver Kurz-2
On Saturday, 1 July 2017 10:53:03 CEST Martin Pluskal wrote:

> On 6/30/17 9:36 PM, Oliver Kurz wrote:
> > With python singlespec my package names get prepended by python3- or
> > python2- in all cases. Can I somehow achieve to provide a package name
> > for one of the two python versions without any "python2/3-" prefix?
> >
> > For example:
> > https://build.opensuse.org/package/view_file/network:messaging:matrix/matr
> > ix-synapse/matrix-synapse.spec?expand=1
> >
> > has
> > Name:           matrix-synapse
> >
> > but is a full python singlespec spec file yielding
> > * python2-matrix-synapse
> > * python3-matrix-synapse
> >
> > but I would like at least one package to be or "provide" matrix-synapse.
> > If
> > not possible I would also be ok to build it just with one python version
> > to
> > end up with just "matrix-synapse". But again: What's the proper way?
> >
> > Regards,
> > Oliver
>
> Hi
>
> Something like:
>
> %ifpython3
> Provides:       matrix-synapse = %{version}
> %endif

I don't think that works.
https://build.opensuse.org/package/live_build_log/network:messaging:matrix/
matrix-synapse/openSUSE_Tumbleweed_dlp_hobdlp/x86_64
states
[   96s] python2-matrix-synapse.noarch: W: useless-provides python2-matrix-
synapse
[   96s] This package provides 2 times the same capacity. It should only
provide it
[   96s] once.

but the spec file never stated python-… but only %{name} which is without the
python-prefix. Any other ideas?
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to "Provide" <name> for python singlespec packages without the "python2/3"-prefix?

Martin Pluskal-2
On 7/1/17 10:15 PM, Oliver Kurz wrote:
> https://build.opensuse.org/package/live_build_log/network:messaging:matrix/
> matrix-synapse/openSUSE_Tumbleweed_dlp_hobdlp/x86_64
Hmpf maybe dont use %{name} but instead just name of provided package -
it worked for cram [1]

Cheers

M

1. https://build.opensuse.org/package/show/devel:tools/cram


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

Re: How to "Provide" <name> for python singlespec packages without the "python2/3"-prefix?

jan matejek-4
In reply to this post by Oliver Kurz-2
hello,

plusky is correct, the following will work:

%ifpython3
Provides: matrix-synapse = %{version}
%endif

The %name macro is handled in a special way so that you can use it in subpackages and have it refer
to the correct thing. Unfortunately, this breaks your usecase, because your package is not called
"python-something".

On 30.6.2017 21:36, Oliver Kurz wrote:
> not possible I would also be ok to build it just with one python version to
> end up with just "matrix-synapse". But again: What's the proper way?

The expected way here is to not use singlespec ;) and require all python-related stuff in the
appropriate version.

That is not to say that you're doing it wrong, just that you're doing something that was not
anticipated during development.

All in all, using singlespec with packages that are not "python-something" is not really supported
at the moment. I'm surprised (and happy) that it works as well as it does. But I'm also open to
suggestions as to how it could work better and what it should do.

regards
m.

>
> Regards,
> Oliver
>



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

Re: How to "Provide" <name> for python singlespec packages without the "python2/3"-prefix?

Oliver Kurz-2
On Monday, 3 July 2017 15:46:50 CEST jan matejek wrote:

> hello,
>
> plusky is correct, the following will work:
>
> %ifpython3
> Provides: matrix-synapse = %{version}
> %endif
>
> The %name macro is handled in a special way so that you can use it in
> subpackages and have it refer to the correct thing. Unfortunately, this
> breaks your usecase, because your package is not called "python-something".

That is unfortunately still not working or not doing what I wanted to achieve

https://build.opensuse.org/package/view_file/network:messaging:matrix/matrix-synapse/matrix-synapse.spec?expand=1

shows that I try to do that but the "unresolvable" in https://
build.opensuse.org/project/show/network:messaging:matrix
shows that the package "matrix-synapse" can not be found by test-matrix-
synapse.

Any other ideas?

>
> On 30.6.2017 21:36, Oliver Kurz wrote:
> > not possible I would also be ok to build it just with one python version
> > to
> > end up with just "matrix-synapse". But again: What's the proper way?
>
> The expected way here is to not use singlespec ;) and require all
> python-related stuff in the appropriate version.
>
> That is not to say that you're doing it wrong, just that you're doing
> something that was not anticipated during development.

I see. What I am trying to achieve is to support both python2 and python3 as
far as possible because I don't even know yet if there would be runtime
problems with any of the two versions. This is also what I want to test with
https://build.opensuse.org/package/show/network:messaging:matrix/test-matrix-synapse

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

Reply | Threaded
Open this post in threaded view
|

Re: How to "Provide" <name> for python singlespec packages without the "python2/3"-prefix?

jan matejek-4
hello,

On 4.7.2017 23:17, Oliver Kurz wrote:
> That is unfortunately still not working or not doing what I wanted to achieve
>
> https://build.opensuse.org/package/view_file/network:messaging:matrix/matrix-synapse/matrix-synapse.spec?expand=1
>
> shows that I try to do that but the "unresolvable" in https://
> build.opensuse.org/project/show/network:messaging:matrix
> shows that the package "matrix-synapse" can not be found by test-matrix-
> synapse.

actually, it's working, even though it doesn't look like it :)
for instance in Factory, you can see that "matrix-synapse" is provided by the rpm [1], and the
test-matrix-synapse is failing because it can't find matrix-synapse dependencies.

In 42.2 and 42.3, matrix-synapse is failing to build completely, and that is because you're not
using the compatibility shims [2] in the spec file.

regards
m.

[1]
https://build.opensuse.org/package/binary/network:messaging:matrix/matrix-synapse?arch=i586&filename=python2-matrix-synapse-0.19.2-9.1.noarch.rpm&repository=openSUSE_Factory
[2] https://en.opensuse.org/openSUSE:Packaging_Python_Singlespec#Compatibility_shims


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

Re: How to "Provide" <name> for python singlespec packages without the "python2/3"-prefix?

Oliver Kurz-2
On Friday, 7 July 2017 15:06:02 CEST jan matejek wrote:

> On 4.7.2017 23:17, Oliver Kurz wrote:
> > That is unfortunately still not working or not doing what I wanted to
> > achieve
> >
> > https://build.opensuse.org/package/view_file/network:messaging:matrix/matr
> > ix-synapse/matrix-synapse.spec?expand=1
> >
> > shows that I try to do that but the "unresolvable" in https://
> > build.opensuse.org/project/show/network:messaging:matrix
> > shows that the package "matrix-synapse" can not be found by test-matrix-
> > synapse.
>
> actually, it's working, even though it doesn't look like it :)
> for instance in Factory, you can see that "matrix-synapse" is provided by
> the rpm [1], and the test-matrix-synapse is failing because it can't find
> matrix-synapse dependencies.
>
> In 42.2 and 42.3, matrix-synapse is failing to build completely, and that is
> because you're not using the compatibility shims [2] in the spec file.

Yes, I removed the compatibility shim suspecting it to implicitly add the
python prefix to all "provides" but I guess I did not understand that part
correctly.

Ok, that seems to work now:
https://build.opensuse.org/package/binary/network:messaging:matrix/matrix-synapse?arch=x86_64&filename=matrix-synapse-0.19.2-10.1.noarch.rpm&repository=openSUSE_Leap_42.3

Thank you for pointing me to that yet another so far unknown helpful OBS
subpage :-)

Now I can concentrate on fixing dependencies again.

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