Bug 1260164 - Fix default Requires: to its python3 subpackage
Summary: Fix default Requires: to its python3 subpackage
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf-plugin-system-upgrade
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Will Woods
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-04 15:42 UTC by Parag Nemade
Modified: 2015-09-18 18:29 UTC (History)
5 users (show)

Fixed In Version: 0.4.1-1.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-18 01:31:33 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Parag Nemade 2015-09-04 15:42:53 UTC
Description of problem:
As dnf on F23+ uses python3 default, this package should pull python3-dnf-plugin-system-upgrade for F23+ branches.

when fedup package is updated on my system I get only python2 subpackage and "dnf --help" failed to show system-upgrade as available plugin.

Version-Release number of selected component (if applicable):
dnf-plugin-system-upgrade-0.4.0-1.fc23.noarch

FIX: just change in spec file

Requires: python-%{name}
to
Requires: python3-%{name}

Thanks.

Comment 1 Will Woods 2015-09-04 20:04:28 UTC
Hmm. This is supposed to be handled automatically by the %{python_provides} macro, as described in the Python packaging guidelines here:

  https://fedoraproject.org/wiki/Packaging:Python#The_.25python_provide_macro

dnf-plugin-system-upgrade follows the example given in that page, so in F22 python-%{name} is provided by python2-%{name}, and the python2 version is pulled in - as you can see here:

  http://koji.fedoraproject.org/koji/rpminfo?rpmID=6732806

In F23 the python3 subpackage should Provide python-%{name}, but it doesn't:

  http://koji.fedoraproject.org/koji/rpminfo?rpmID=6732820

As far as I can tell I followed the instructions in the Python packaging guidelines, so this seems like it might be a problem with the %{python_provides} macro implementation?

Comment 2 Orion Poplawski 2015-09-04 21:33:43 UTC
%python_provide does not set Requires. it only adds "Provides: python-foo" to python2-foo packages, and "Provides: python2-foo" to python-foo packages.  It seems to state that relatively clearly in the guidelines - there is no mention of "Requires" in that section.

Comment 3 Will Woods 2015-09-08 16:51:06 UTC
(In reply to Orion Poplawski from comment #2)
> %python_provide does not set Requires. it only adds "Provides: python-foo"
> to python2-foo packages, and "Provides: python2-foo" to python-foo packages.
> It seems to state that relatively clearly in the guidelines - there is no
> mention of "Requires" in that section.

No, but that's the point of having the %{python-provides} macro. The guidelines say it's to be used:

    To avoid having to alter every python module package when this change
    happens, and to allow the same spec to build for releases with different
    system versions of python [...]

So that macro seems to exist to *allow* other packages to do "Require: python-%{name}" to pull in the correct python2 or python3 version as appropriate for the system.

It's supposed to work like so:

    When given (as an argument) the name of the current subpackage, it will
    evaluate to either the proper Provide: line or nothing at all as
    appropriate for the version of the system runtime.

So if you do as it says in the example (and as I did in this spec):

    %package -n python2-%{srcname}
    Summary:        An example python module
    %{?python_provide:%python_provide python2-%{srcname}}

    [...]

    %package -n python3-%{srcname}
    Summary:        An example python module
    %{?python_provide:%python_provide python3-%{srcname}}

For F22, the %{?python_provide:...} line will evaluate to "Provide: python-%{name}" *only* in the python2 subpackage, and the other one will be empty.

For F23, that line should "evaluate to either the proper Provide: line ... as appropriate for the version of the system runtime", meaning it should only appear for the *python3* subpackage.

In other words, if those macros work as described:
* For F22 and earlier, the python2-%{name} package will Provide: python-%{name}.
* For F23 and later, the python3-%{name} package will Provide: python-%{name}.

Except my F23 builds *don't* have the Provide: python-%{name} in the python3 subpackage. So I'm pretty sure the macro isn't working right in F23.

(rkuska, I'm CC'ing you at sgallagh's suggestion - any ideas?)

Comment 4 Orion Poplawski 2015-09-08 17:03:48 UTC
I think until /usr/bin/python points to /usr/bin/python3, the python-foo provides will be tied to the python2 package.  In any case, the macro certainly does this at the moment.

Comment 6 Fedora Update System 2015-09-15 19:07:20 UTC
dnf-plugin-system-upgrade-0.4.1-1.fc21 has been submitted as an update to Fedora 21. https://bodhi.fedoraproject.org/updates/FEDORA-2015-15941

Comment 7 Fedora Update System 2015-09-15 19:07:20 UTC
dnf-plugin-system-upgrade-0.4.1-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-15940

Comment 8 Fedora Update System 2015-09-15 19:07:28 UTC
dnf-plugin-system-upgrade-0.4.1-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-15942

Comment 9 Fedora Update System 2015-09-16 04:52:45 UTC
dnf-plugin-system-upgrade-0.4.1-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update dnf-plugin-system-upgrade'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-15940

Comment 10 Fedora Update System 2015-09-17 01:02:16 UTC
dnf-plugin-system-upgrade-0.4.1-1.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update dnf-plugin-system-upgrade'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-15941

Comment 11 Fedora Update System 2015-09-17 01:05:52 UTC
dnf-plugin-system-upgrade-0.4.1-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update dnf-plugin-system-upgrade'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-15942

Comment 12 Fedora Update System 2015-09-18 01:31:28 UTC
dnf-plugin-system-upgrade-0.4.1-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2015-09-18 18:29:28 UTC
dnf-plugin-system-upgrade-0.4.1-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.