New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port to python3. #117
Port to python3. #117
Conversation
@@ -47,6 +47,7 @@ | |||
import turbogears.util as tg_util | |||
from turbogears.controllers import check_app_root | |||
from turbogears.identity.exceptions import RequestRequiredException | |||
import six |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all for TG1 stuff no? Does import turbogears
really work on py3? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely not.
👍 on 1rst pass. |
As of now, I have the bodhi and fas clients working on python3. Hand "tested" with this script: import sys
import fedora.client
import getpass
print(sys.version)
print(fedora.client.__file__)
password = getpass.getpass()
fas = fedora.client.AccountSystem(username='ralph', password=password)
print(fas.people_by_groupname('sysadmin-main'))
print(fas.person_by_username('ralph'))
bodhi = fedora.client.BodhiClient(username='ralph', password=password)
print(bodhi.latest_builds('ansi2html'))
print(bodhi.get_releases())
print(bodhi.query(mine=True)) |
Package review for python-munch is here: https://bugzilla.redhat.com/show_bug.cgi?id=1210969 |
password = getpass.getpass() | ||
#fas = fedora.client.AccountSystem(username='ralph', password=password) | ||
#print(fas.people_by_groupname('sysadmin-main')) | ||
#print(fas.person_by_username('ralph')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment out ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops! I didn't mean to commit that file.
@@ -142,7 +142,7 @@ def query(self, release=None, status=None, type_=None, bugs=None, | |||
auth = False | |||
if params['mine']: | |||
auth = True | |||
for key, value in params.items(): | |||
for key, value in list(params.items()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list()
call here isn't really needed, since you just iterate over the items once. You'd need to do something like this in PY3 if you were assigning params.items()
to a variable and would want to iterate over it multiple times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you see the del
below? It was raising an error about the dict changing size during iteration (python3 only).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't see that. Everything's ok as it is, then.
This looks very good. I left one inline comment in the code and have one more general comment: Since you've already decided to depend on six, I'd advise using |
@bkabrda all cleaned up :) |
✨ 🔮 ✨ The Future! ✨ 🔮 ✨ |
This is still a work in progress. The current test suite passes on python3,
but that's not saying much ;p We could use some more test cases.