Bug 1260164 - Fix default Requires: to its python3 subpackage
Fix default Requires: to its python3 subpackage
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: dnf-plugin-system-upgrade (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Will Woods
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-04 11:42 EDT by Parag Nemade
Modified: 2015-09-18 14:29 EDT (History)
5 users (show)

See Also:
Fixed In Version: 0.4.1-1.fc23
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-09-17 21:31:33 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Parag Nemade 2015-09-04 11:42:53 EDT
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 16:04:28 EDT
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 17:33:43 EDT
%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 12:51:06 EDT
(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 13:03:48 EDT
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 15:07:20 EDT
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 15:07:20 EDT
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 15:07:28 EDT
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 00:52:45 EDT
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-16 21:02:16 EDT
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-16 21:05:52 EDT
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-17 21:31:28 EDT
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 14:29:28 EDT
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.