#4 Port to Python 3
Closed 4 years ago by kparal. Opened 5 years ago by adamwill.

bodhi-client has been made Python 3 only for F29 and later. This obviously means that fedora-easy-karma must be ported to Python 3 to remain useful on F29+ systems.

It is currently not Python 3-compatible at all:

[adamw@adam fedora-kickstarts (master)]$ python3 /usr/bin/fedora-easy-karma
  File "/usr/bin/fedora-easy-karma", line 506
    print "'Rawhide' found in %s, aborting, because "\
                                                    ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("'Rawhide' found in %s, aborting, because "\)?

Probably shouldn't be too hard to port, with the help of a few conversion tools.


@sumantrom said he was interested in working on this.

Just a note - technically I made the bodhi-client package be only /usr/bin/bodhi and its associated files (like the man page), and it is Python 3 in F29+. In the process I added new python2-bodhi-client and python3-bodhi-client subpackages. I believe f-e-k does not use /usr/bin/bodhi but imports bodhi.client.bindings.BodhiClient which is now provided by the fancy new subpackages.

Technically, f-e-k could just require the python2- one for now until someone has time to port it. You should also be able to do this, which should work in all current Fedora versions:

Requires: %{py2_dist bodhi-client}

As a workaround, you can probably just sudo dnf install python2-bodhi-client and things will probably work.

I'm gonna send a PR to f-e-k to add the requires that I think will get it working for now. Should be small.

Ah, OK, thanks - I misread the notification. Porting to Python 3 would likely be a good thing anyway, of course.

Porting to Python 3 would likely be a good thing anyway, of course.

Indeed!

Is this something that we are still looking to do? I've been slowly playing around with converting it on my computer.

Are there any tests or anything that I can run with it to check that I am finding all the issues to change?

Still basically as above, I think - would be nice, not urgent right now. Getting a bit more urgent with the plan to deprecate Python 2 in Fedora 30, of course - thinking about that, we should have this done in the next month or two...

I don't think f-e-k really has much in the way of tests :( You could write some! Aside from that, just check that it runs properly in normal use and all the actions you can do work properly.

Thanks a lot for working on this!

@himmallright any news? do you need help porting or testing?

The PR was merged to master, so this can be closed now - apparently I don't have the power to close it even though I opened it.

Metadata Update from @kparal:
- Issue status updated to: Closed (was: Open)

4 years ago

Login to comment on this ticket.

Metadata