Bug 1342056

Summary: bad implementation of python2 prefix
Product: [Fedora] Fedora Reporter: Germano Massullo <germano.massullo>
Component: python-requestsAssignee: Fedora Infrastructure SIG <infra-sig>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: apevec, awilliam, bkabrda, extras-qa, fale, infra-sig, itamar, jeremy, kumarpraveen.nitdgp, marmarek, mrunge, npmccallum, rbean, sagarun
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-requests-2.10.0-2.fc23 python-requests-2.10.0-2.fc22 python-requests-2.10.0-2.fc24 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-07 01:24:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1342116    

Description Germano Massullo 2016-06-02 11:03:45 UTC
Description of problem:
we've more or less settled on a preferred convention now, where we have 'python2-foo' and 'python3-foo' subpackages and the %python_provide macro handles the 'python-foo' Provides and Obsoletes, but this package does not follow Python packaging guidelines
https://fedoraproject.org/wiki/Packaging:Python

Line of code
Provides:       python2-requests
at
http://pkgs.fedoraproject.org/cgit/rpms/python-requests.git/tree/python-requests.spec#n41
is not a good implementation of the guidelines since
# dnf install python2-requests
will result in an installation of package
python-requests

This causes also misunderstandings problems to other maintainers that rely on python-requests and are going to implement the new guidelines in the Python packages they maintain.

Comment 1 Germano Massullo 2016-06-02 11:11:27 UTC
You can take as example spec file
http://pkgs.fedoraproject.org/cgit/rpms/python-responses.git/tree/python-responses.spec

Comment 2 Ralph Bean 2016-06-02 16:13:19 UTC
Thanks for reporting!  Will fix.  (I think I did this before I knew about python_provides...)

Comment 3 Fedora Update System 2016-06-02 16:41:35 UTC
python-requests-2.10.0-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-528036d072

Comment 4 Fedora Update System 2016-06-02 16:41:48 UTC
python-requests-2.10.0-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-09cd493166

Comment 5 Fedora Update System 2016-06-02 16:41:54 UTC
python-requests-2.10.0-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-a4a303abd0

Comment 6 Germano Massullo 2016-06-02 21:16:21 UTC
1) Be careful if applyting the patch to Fedora's stable branches because package python-requests will be completely replaced by python2-requests. So it could affect other python packages that rely on python-requests.

2) FAS fale that teached me to package python software always told me that all BuildRequires: should go all together and all Requires: should go under their own subpackage

Comment 7 Adam Williamson 2016-06-02 21:21:47 UTC
"1) Be careful if applyting the patch to Fedora's stable branches because package python-requests will be completely replaced by python2-requests. So it could affect other python packages that rely on python-requests."

It's undocumented (at least last time I checked), but the %python_provide macro actually handles this:

[adamw@adam openqa_fedora (cockpit-freeipa %)]$ rpm --eval "%python_provide python2-foo"
Provides: python-foo(x86-64) = %{version}-%{release}
Provides: python-foo = %{version}-%{release}
Obsoletes: python-foo(x86-64) < %{version}-%{release}
Obsoletes: python-foo < %{version}-%{release}

Comment 8 Adam Williamson 2016-06-02 21:23:14 UTC
Sorry, to be clear - what I mean by 'undocumented' is that https://fedoraproject.org/wiki/Packaging:Python says nothing about the macro handling Obsoletes as well as Provides.

Comment 9 Germano Massullo 2016-06-03 06:58:37 UTC
Hi Fabio, what is your opinion about comments from #6 to #8?

Comment 10 Fedora Update System 2016-06-03 09:25:48 UTC
python-requests-2.10.0-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-528036d072

Comment 11 Fabio Alessandro Locati 2016-06-03 09:42:30 UTC
My experiences on %python_provide:

- It works as Adam described in comment 7
- If you use it, it will solve all the upgrade path from the python- version to the python2- version
- Is not present in EL6 (so you'll need to write the provides/obsoletes manually

Comment 12 Fedora Update System 2016-06-03 16:22:07 UTC
python-requests-2.10.0-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-09cd493166

Comment 13 Fedora Update System 2016-06-03 16:27:19 UTC
python-requests-2.10.0-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-a4a303abd0

Comment 14 Fedora Update System 2016-06-07 01:24:05 UTC
python-requests-2.10.0-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Marek Marczykowski 2016-06-07 13:26:33 UTC
Please revert this change from the *stable* branch. It breaks packages dependent on `python-requests`. For example pykickstart:

# dnf builddep pykickstart
(...)
Last metadata expiration check: 0:02:21 ago on Tue Jun  7 15:23:09 2016.
Package python-setuptools-18.0.1-2.fc23.noarch is already installed, skipping.
Package gettext-0.19.7-3.fc23.x86_64 is already installed, skipping.
Package python-devel-2.7.11-3.fc23.x86_64 is already installed, skipping.
Package python3-setuptools-18.0.1-2.fc23.noarch is already installed, skipping.
Package python-nose-1.3.7-4.fc23.noarch is already installed, skipping.
Package python3-six-1.9.0-3.fc23.noarch is already installed, skipping.
Package python3-requests-2.10.0-2.fc23.noarch is already installed, skipping.
Error: installed package python2-requests-2.10.0-2.fc23.noarch obsoletes python-requests < 2.10.0-2.fc23 provided by python-requests-2.7.0-7.fc23.noarch
(try to add '--allowerasing' to command line to replace conflicting packages)

Comment 16 Fedora Update System 2016-06-12 22:50:28 UTC
python-requests-2.10.0-2.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2016-06-18 18:47:04 UTC
python-requests-2.10.0-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.