Bug 1311515

Summary: python-cinderclient: Provide a Python 3 subpackage
Product: [Fedora] Fedora Reporter: Tomas Orsava <torsava>
Component: python-cinderclientAssignee: Haïkel Guémar <karlthered>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: apevec, eharney, jruzicka, karlthered, lbalhar, pronix.service
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-17 13:22:59 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: 1285816, 1312032    
Attachments:
Description Flags
0001-pytho3-subpackages.patch
none
py3 subpackage
none
0001-pytho3-subpackages none

Description Tomas Orsava 2016-02-24 11:49:55 UTC
Upstream, this software supports Python 3. Please provide a Python 3
package for Fedora.


According to the Python packaging guidelines [0], software must be
packaged for Python 3 if upstream supports it.
The guidelines give detailed information on how to do this, and even
provide an example spec file [1].

The current best practice is to provide subpackages for the two Python
versions (called "Common SRPM" in the guidelines). Alternatively, if
nothing depends on your Python2 package, you can just switch to Python 3
entirely.

It's fine to do this in Rawhide only.


If anything is unclear, or if you need any kind of assistance with the
porting, you can ask on IRC (#fedora-python on Freenode), or reply here.
We'll be happy to help!


[0] https://fedoraproject.org/wiki/Packaging:Python
[1] https://fedoraproject.org/wiki/Packaging:Python#Example_common_spec_file

Comment 1 dima 2016-07-16 08:32:16 UTC
Created attachment 1180386 [details]
0001-pytho3-subpackages.patch

hello
i add subpackages for python2 and python3.
is it correct way change name for subpackage for python2 from python-cinderclient to python2-cinderclient ?

Comment 2 dima 2016-07-24 09:32:22 UTC
how can i help for speed up process ?
may be you need co-maintainer ?

Comment 3 Jan Kurik 2016-07-26 04:05:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 4 Lumír Balhar 2016-07-28 09:16:09 UTC
Hello.

Thank you very much for your work.

I am reviewing your patch and there are some issues which I mentioned in previous reviews (like global definition for srcname).

This package is application with some executable in %{_bindir} so it needs different approach. In current specfile you have python2 installation first which creates %{_bindir}/cinder and then python3 installation which replace this file with version built with python3. This means that you will have version buit with python3 in python2 subpackage.
You should move this file to other location after one installation process and then create some symlinks. Everything is explained in this part of guideline: http://python-rpm-porting.readthedocs.io/en/latest/application-modules.html

My other suggestions:
- You should add description to subpackages (You can use global definition as well)
- For documentation, you need only Python3 dependencies and documentation needs to be built only once with sphinx-build-3. In current specfile documentation is built first time with sphinx for Python2 and then replaced by build with sphinx for Python3.
- Please, use %license macro in the files section for license files instead of %doc.
- There isn't changelog entry for your changes.

Thank you and have a nice day.

Comment 5 dima 2016-07-31 19:47:39 UTC
Created attachment 1186162 [details]
py3 subpackage

added changes after review

Comment 6 Lumír Balhar 2016-08-01 09:45:15 UTC
Hello.

Thanks for updated patch. There are still some issues:
- Increment release number
- Be more specific in BuildRequires and Requires - python2-pbr instead python-pbr.
- Maybe it would be better to use some global macros for 'cinder' and 'cinderclient'.

Your approach to handling binary files looks correct but please consider to use standard symlinks for both pythons version like cinder-2, cinder-2.7, cinder-3, cinder-3.5 mentioned in the guideline for this type of software.

Have a nice day.

Comment 7 Tomas Orsava 2016-08-01 09:50:10 UTC
For more detailed instructions how to properly setup these symlinks, refer to this section [0] of the Python RPM Porting guide.

[0] http://python-rpm-porting.readthedocs.io/en/latest/tools.html#moving-the-executables-and-making-symlinks

Comment 8 dima 2016-08-11 21:22:37 UTC
Created attachment 1190159 [details]
0001-pytho3-subpackages

spicified deps and fix links for subpackages

Comment 9 Lumír Balhar 2016-08-16 07:57:41 UTC
Hello Dmitry.

Specfile looks good but you should use preferred way to handle executables mentioned in guide instead of making symlinks in %post sections because this way is not deterministic.

Thank you for your effort.

Comment 10 Haïkel Guémar 2016-08-17 13:22:59 UTC
Fixed in rawhide.

I don't like using scriptlets for creating default symlink. But since upstream still recommends python2 as default interpreter, cinder is a symlink to python2 version. Btw, it will be at some point deprecated by openstackclient and this package will only ship a plugin to the former.