Bug 1194324 - Please switch pcp to Python 3
Summary: Please switch pcp to Python 3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pcp
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nathan Scott
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1194577
TreeView+ depends on / blocked
 
Reported: 2015-02-19 14:47 UTC by Bohuslav "Slavek" Kabrda
Modified: 2015-03-25 20:06 UTC (History)
11 users (show)

Fixed In Version: pcp-3.10.3-1.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-13 16:56:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Bohuslav "Slavek" Kabrda 2015-02-19 14:47:55 UTC
Hi, as per [1], I'd like to ask you to switch pcp to Python 3 as default. pcp is compatible with Python 3 in upstream, so this only requires few simple downstream fixes:

- Getting rid of /usr/bin/python generated autodeps - all hashbangs /usr/bin/python should be replaced by /usr/bin/python3
- The main pcp package should depend on python3-pcp rather than on python-pcp
- All python2 explicit deps should be removed/replaced by python3 explicit deps in the main pcp package

These changes shouldn't break any depending packages, AFAICS - everyone will still be able to depend on python-pcp explicitly and use it in Python 2, all the /usr/bin scripts should keep working under Python 3.

I'd like to ask you to do this before 24th February in both Rawhide and F22. I'm terribly sorry that this is on such a short notice, but I only now realized that pcp and python-pcp are on the Fedora atomic host and thus need to be switched. If I can be of any assistance, please let me know.

Thanks a lot!

[1] https://fedoraproject.org/wiki/Changes/Python_3_Migration_Improvements

Comment 1 Nathan Scott 2015-02-19 23:51:11 UTC
> I'd like to ask you to do this before 24th February in both Rawhide and F22.

I think we should be able to respin in time - I'll begin work on it immediately.

I'd like to discuss some of those simple fixes though, are you on IRC somewhere?  Thanks.

> pcp is compatible with Python 3 in upstream

Its not quite this simple - while work has been done on the python modules side of things, and packaging that up, other work remains in the pcp scripts that use those modules.  I'll attempt to audit and test each of those before Tuesday though.

cheers.

Comment 2 Bohuslav "Slavek" Kabrda 2015-02-20 07:44:04 UTC
(In reply to Nathan Scott from comment #1)
> > I'd like to ask you to do this before 24th February in both Rawhide and F22.
> 
> I think we should be able to respin in time - I'll begin work on it
> immediately.
> 
> I'd like to discuss some of those simple fixes though, are you on IRC
> somewhere?  Thanks.

Thank you very much. I'm on PTO today, but feel free to ask Robert Kuska (rkuska), Matej Stuchlik (mstuchli) or Miro Hroncok (mhroncok) on #fedora-python or #fedora-devel. (CCing them)

> > pcp is compatible with Python 3 in upstream
> 
> Its not quite this simple - while work has been done on the python modules
> side of things, and packaging that up, other work remains in the pcp scripts
> that use those modules.  I'll attempt to audit and test each of those before
> Tuesday though.
> 
> cheers.

Great, thanks. Robert, Matej and Miro will help you, I'm sure.

Comment 3 Frank Ch. Eigler 2015-02-23 12:22:43 UTC
> Hi, as per [1], I'd like to ask you to switch pcp to Python 3 as default.
> pcp is compatible with Python 3 in upstream

This is misleading.  Numerous .py scripts in the pcp sources are not
compatible with python3, even if the hashbangs are redirected to
/usr/bin/python3.  Just a random testing indicates parse/syntax
errors in:

pcp-free.py
pcp-dmcache.py
pcp-numastat.py
pcp-uptime.py
pmcollectl.py
pcp2graphite.py
pmiostat.py
pmatop.py (maybe)

... and that's approximately every single one, when invoked as
"python3 FOO.py" instead of "python FOO.py".

Comment 4 Bohuslav "Slavek" Kabrda 2015-02-23 12:27:12 UTC
Ok, so it seems that we'll have to revert after all for F22 [1]. All the effort is not lost, we're still doing this for F23. I'll revert this myself, no need for action on your end (for F22). This should give plenty of time to fix anything that doesn't work with Python 3 for F23.
Thanks.

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

Comment 5 Bohuslav "Slavek" Kabrda 2015-02-23 13:41:38 UTC
Reverted for F22 in pcp-3.10.2-3.fc22 - http://koji.fedoraproject.org/koji/taskinfo?taskID=9038696

Due to Franks comment 3, I'm leaving this in assigned. We still need to do this for F23.

Comment 6 Frank Ch. Eigler 2015-02-23 13:57:58 UTC
Sorry - the above testing was prior to the most recent pcp commit #21205e44.
But things are not all well afterwards either (pcp2graphite e.g.).  Plus
it's not obvious to me what to make of errors like:

% python3 ./pmatop/pmatop.py
Traceback (most recent call last):
  File "./pmatop/pmatop.py", line 921, in <module>
    status = curses.wrapper(main)   # pylint: disable-msg=C0103
  File "/usr/lib64/python3.4/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "./pmatop/pmatop.py", line 799, in main
    (delta, errmsg) = pmc.pmParseInterval(str(opts.interval_arg) + " seconds")
  File "/usr/lib64/python3.4/site-packages/pcp/pmapi.py", line 1877, in pmParseInterval
    return (timeval.fromInterval(interval), '')
  File "/usr/lib64/python3.4/site-packages/pcp/pmapi.py", line 180, in fromInterval
    status = LIBPCP.pmParseInterval(interval, byref(tvp), byref(errmsg))

when running without the modified pcp-python* libraries installed.

Was there any testing done to see if preexisting python2 scripts/pmdas
(run with normal python2) can run against the new-current pmapi/pmda
bindings?

Comment 7 Nathan Scott 2015-02-23 21:10:42 UTC
> Sorry - the above testing was prior to the most recent pcp commit #21205e44.

These remaining issues are known and were discussed on fedora-python yesterday - the plan being to get an immediate update in now so that others can proceed with building python3-only images for things like atomic host, and a second update later this week will resolve the remaining issues in the handful of monitor tools that are affected.

> Was there any testing done [...]

If you look, you will see the patch includes a significant number of test updates as well (e.g. all py PMDAs are now known working & verified both py2/3).  There are some known issues that are limited to a handful of client tools, as discussed yesterday, and they will be resolved forthwith.

Comment 8 Fedora Update System 2015-03-03 15:16:29 UTC
pcp-3.10.3-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/pcp-3.10.3-1.el5

Comment 9 Fedora Update System 2015-03-03 15:17:55 UTC
pcp-3.10.3-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/pcp-3.10.3-1.fc22

Comment 10 Fedora Update System 2015-03-03 15:19:06 UTC
pcp-3.10.3-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/pcp-3.10.3-1.fc21

Comment 11 Fedora Update System 2015-03-03 15:20:14 UTC
pcp-3.10.3-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/pcp-3.10.3-1.fc20

Comment 12 Fedora Update System 2015-03-04 21:07:36 UTC
Package pcp-3.10.3-1.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing pcp-3.10.3-1.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-3082/pcp-3.10.3-1.fc22
then log in and leave karma (feedback).

Comment 13 Fedora Update System 2015-03-13 16:56:55 UTC
pcp-3.10.3-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2015-03-13 17:07:27 UTC
pcp-3.10.3-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2015-03-13 17:15:14 UTC
pcp-3.10.3-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 16 Fedora Update System 2015-03-25 20:06:30 UTC
pcp-3.10.3-1.el5 has been pushed to the Fedora EPEL 5 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.