Bug 1311515 - python-cinderclient: Provide a Python 3 subpackage
python-cinderclient: Provide a Python 3 subpackage
Product: Fedora
Classification: Fedora
Component: python-cinderclient (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Haïkel Guémar
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2016-02-24 06:49 EST by Tomas Orsava
Modified: 2016-08-17 09:22 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-08-17 09:22:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
0001-pytho3-subpackages.patch (3.87 KB, patch)
2016-07-16 04:32 EDT, dima
no flags Details | Diff
py3 subpackage (4.93 KB, patch)
2016-07-31 15:47 EDT, dima
no flags Details | Diff
0001-pytho3-subpackages (5.39 KB, patch)
2016-08-11 17:22 EDT, dima
no flags Details | Diff

  None (edit)
Description Tomas Orsava 2016-02-24 06:49:55 EST
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

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 04:32 EDT
Created attachment 1180386 [details]

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 05:32:22 EDT
how can i help for speed up process ?
may be you need co-maintainer ?
Comment 3 Jan Kurik 2016-07-26 00:05:35 EDT
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 05:16:09 EDT

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 15:47 EDT
Created attachment 1186162 [details]
py3 subpackage

added changes after review
Comment 6 Lumír Balhar 2016-08-01 05:45:15 EDT

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 05:50:10 EDT
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 17:22 EDT
Created attachment 1190159 [details]

spicified deps and fix links for subpackages
Comment 9 Lumír Balhar 2016-08-16 03:57:41 EDT
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 09:22:59 EDT
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.

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