Bug 1014595 - Update sos to Python 3
Summary: Update sos to Python 3
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: sos
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F23PYTHON3 1194577
TreeView+ depends on / blocked
 
Reported: 2013-10-02 11:26 UTC by Miro Hrončok
Modified: 2015-07-17 13:17 UTC (History)
5 users (show)

Fixed In Version: sos-3.2-0.3.a.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-17 13:17:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2013-10-02 11:26:10 UTC
Hi, we would like to use Python 3 on the default installation instead of Python 2 on Fedora 22.

From that perspective, your package is considered as IMPORTANT - that means, is has to be updated to Python 3, for our intention come true.

The goal here is, that this package uses Python 3 as default in Fedora 22.

Please, help use update to Python 3 flawlessly.

Check if upstream already support Python 3, if yes, use it and add te support to the package.

If upstream doesn't support Python 3 yet, encourage it to do so by sending patches and offering your help.

When upstream is dead or unwilling to support Python 3, you'll need to patch this package on Fedora level. Try to avoid this as much as you can, but use it, if it's the last option.

Chances are, that you ARE the upstream. In that case, everything is easier, just do it yourself.

There is a table on wiki, that should list your package. Chances are, that you can see an upstream link that covers the problem. Anyway, please update the table with information you know.

https://fedoraproject.org/wiki/User:Churchyard/python3

I offer my help with this task, so if you have no idea, how to work on this, or it is just not your priority, don't hesitate to ask for help.

(As you've already realized, this is a bulk text, so if something is not quite exact about your package, sorry for that, just ask)

Comment 1 Toshio Ernie Kuratomi 2013-10-02 22:43:14 UTC
Note: do not follow this portion of the advice as it is against the Packaging Guidelines: "When upstream is dead or unwilling to support Python 3, you'll need to patch this package on Fedora level. Try to avoid this as much as you can, but use it, if it's the last option."

If you are in this situation, you'll essentially be forking upstream in order to produce a python3 port.  In that situation, the proper thing to do is to create a new package with the python3 port.  It would be even better to create the proper upstream infrastructure as well (new upstream scm and issue tracker) but that isn't 100% required by the guidelines.

Comment 2 Bryn M. Reeves 2014-04-01 11:48:18 UTC
We support python 2 & 3 upstream now (via six). Debian and Ubuntu have started shipping a py3 based sos build and I'm getting some reports of problems there.

Once we understand and fix the problem upstream I'll start making plans to switch the Fedora builds to py3 too.

Comment 3 Bohuslav "Slavek" Kabrda 2015-01-28 15:37:06 UTC
Hi, since we're getting close to F22 alpha and the Python guidelines have been changed to suggest building with Python 3 if possible [1], I'd like to ask you to build sos with Python 3. Thanks.

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

Comment 4 Bryn M. Reeves 2015-01-28 15:55:26 UTC
We've had upstream support for py3 runtimes for some time and I have a private branch where I build py3 RPMs for Fedora. I'm currently tied up with Atomic/Docker work and preparation for DevConf but I'll be pushing a python3-enabled sos build for Fedora shortly.

Comment 5 Bohuslav "Slavek" Kabrda 2015-02-18 09:51:51 UTC
Ping, could you please do this ASAP so that it's built for F22 before the Feature Freeze? (24th February)

Comment 6 Bryn M. Reeves 2015-02-19 20:21:45 UTC
Package built and tested for f22:

# rpm -q sos
sos-3.2-16.fc22.noarch

# rpm -q --requires sos
/usr/bin/python3
bzip2
config(sos) = 3.2-16.fc22
libxml2-python
python(abi) = 3.3
python3-six
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
xz
rpmlib(PayloadIsXz) <= 5.2-1

The libxml2-python dep doesn't make sense & I'll remove it in a future build; there is code in sos that uses the libxml bindings however it's not been used/maintained for some time and I'm going to remove it upstream in the near future.

Comment 7 Bohuslav "Slavek" Kabrda 2015-02-20 07:34:28 UTC
(In reply to Bryn M. Reeves from comment #6)
> Package built and tested for f22:
> 
> # rpm -q sos
> sos-3.2-16.fc22.noarch
> 
> # rpm -q --requires sos
> /usr/bin/python3
> bzip2
> config(sos) = 3.2-16.fc22
> libxml2-python
> python(abi) = 3.3
> python3-six
> rpmlib(CompressedFileNames) <= 3.0.4-1
> rpmlib(FileDigests) <= 4.6.0-1
> rpmlib(PartialHardlinkSets) <= 4.0.4-1
> rpmlib(PayloadFilesHavePrefix) <= 4.0-1
> xz
> rpmlib(PayloadIsXz) <= 5.2-1
> 
> The libxml2-python dep doesn't make sense & I'll remove it in a future
> build; there is code in sos that uses the libxml bindings however it's not
> been used/maintained for some time and I'm going to remove it upstream in
> the near future.

Hmm, the python(abi) = 3.3 is weird. This should be 3.4 in F22. AFAIK there's now even libxml2-python3, so you may want to use that if you wish. Thanks!

Comment 8 Bryn M. Reeves 2015-02-20 10:01:00 UTC
Haha, well spotted :) That's just me cheating and doing a 'fedpkg local' on an f20 machine while I waited for the f22 RPMs to pop out of koji. The properly build packages do have the correct requires.

I'm not happy with the current distutils build however; /etc/sos.conf is not handled properly (looks like Ubuntu just dropped it from the install) so I'll be fixing this and pushing a new build today.

> libxml2-python3, so you may want to use that if you wish.

Thanks, didn't realise this was available now (last time I checked libxml2 wasn't ported).

The XML reporting code is actually broken even on a py2 runtime however - it's not been used in years and removing it was already on the upstream plan.

Comment 9 Bohuslav "Slavek" Kabrda 2015-02-23 12:23:49 UTC
Ok, so it seems that we'll have to revert after all for F22 [1]. Please only build this for F23 (so this doesn't need to be built today). Thanks.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1194577#c4

Comment 10 Jaroslav Reznik 2015-03-03 16:55:47 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 11 Robert Kuska 2015-07-03 07:47:25 UTC
Hello,

our system wide change was accepted by FESCO for Fedora23. Please switch sos to use python3.

Comment 12 Bryn M. Reeves 2015-07-03 09:50:41 UTC
Will do; I still have a branch in dist-git somewhere with the changes that were backed out from the previous attempt to switch.

Comment 13 Miro Hrončok 2015-07-14 11:34:56 UTC
Bryn, have you found the python3 branch in dist-git somewhere? I could provide the patch for spec, but I don't want to do it if it already exists.

Comment 14 Bryn M. Reeves 2015-07-14 12:06:11 UTC
Miro, you should be able to find this on the f22 branch, commit 42637e3 although I should really update this to include more post-3.2 patches (it's quite out of date compared to e.g. the current RHEL branches).

http://pkgs.fedoraproject.org/cgit/sos.git/log/?h=f22

Any feedback on the py3 changes very welcome.

Comment 15 Miro Hrončok 2015-07-14 12:35:48 UTC
You should not invoke python3 command directly, but use %{__python3} macro. The result is the same, but that's the guideline.

sos-install-sos_conf-from-setup_py.patch patch is missing from git but used

    Requires: libxml2-python

should be 

    Requires: libxml2-python3

Otherwise it looks good.

Comment 16 Miro Hrončok 2015-07-17 09:39:45 UTC
Bryn, what's the status? Do you need my help with this?

Comment 17 Miro Hrončok 2015-07-17 12:01:50 UTC
After IRC conversation with Bryn, I'will do this.


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