Learn more about these different git repos.
Other Git URLs
Looks like tw2.jit package does not support Python 3. It's an indirect dependency for moksha.wsgi (which is needed by moksha). (Edit: Only moksha.hub is required which works fine with Python 3.)
tw2.jit
moksha.wsgi
moksha
moksha.hub
After a workaround for that package [1] and a small fix in tests, it's at least possible to run TEST=true py.test greenwave successfully.
TEST=true py.test greenwave
[1] I've installed the package manually from git repo after converting code with 2to3 and replacing BeautifulSoup package with beautifulsoup4 (bs4 module). Thought tests for the package fail.
2to3
bs4
Hmm, moksha is not used directly anywhere in Greenwave though... is it just a transitive dependency from fedmsg?
But fedmsg already has a working Python 3 port. How does that work, if moksha is not ported?
Looks like moksha.hub is required transitively by fedmsg - which seems to work fine with Python 3.
fedmsg
Now there are lots of issues using resultsdb from functional tests.
resultsdb
Yeah - resultsdb is the blocker now. Filed https://pagure.io/taskotron/resultsdb/issue/109
Hm. But we don't import resultsdb code directly anymore, right? It's just invoked as a subprocess.
True enough. If we make that unversioned python subprocess call into an explicit python2 call.. this might work. :)
python
python2
Yeah, there is no issue with Resultsdb. Just a few import tweaks needed, and some unicode/str cleanups, and things mostly work... Here is a tough one though:
Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 135, in handle self.handle_request(listener, req, client, addr) File "/usr/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 176, in handle_request respiter = self.wsgi(environ, resp.start_response) File "/usr/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__ return self.wsgi_app(environ, start_response) File "/usr/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app response = self.handle_exception(e) File "/usr/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise raise value File "/usr/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise raise value File "/usr/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/home/dcallagh/work/greenwave/greenwave/utils.py", line 55, in wrapped return func(*args, **kwargs) File "/home/dcallagh/work/greenwave/greenwave/api_v1.py", line 257, in make_decision results.extend(retrieve_results(item)) File "/home/dcallagh/work/greenwave/greenwave/cache.py", line 17, in wrapper return decorator(fn)(*args) File "/usr/lib/python3.6/site-packages/dogpile/cache/region.py", line 1250, in decorate should_cache_fn) File "/usr/lib/python3.6/site-packages/dogpile/cache/region.py", line 796, in get_or_create key = self.key_mangler(key) File "/usr/lib/python3.6/site-packages/dogpile/cache/util.py", line 124, in sha1_mangle_key return sha1(key).hexdigest() TypeError: Unicode-objects must be encoded before hashing
Metadata Update from @ralph: - Issue assigned to ralph
Metadata Update from @ralph: - Assignee reset
Metadata Update from @ralph: - Issue assigned to dcallagh
We can work around the issue with sha1_mangle_key() by just using our own implementation that encodes as UTF-8 first. Easy enough. (I should probably file an issue with dogpile about that, it seems surprising that nobody has hit the same problem on Python 3 before...)
sha1_mangle_key()
However now the tests are failing because our cache keys are using the repr() of a dict which means they are sensitive to dict ordering. Like this test failure shows:
E AssertionError: Expected call: delete("greenwave.resources:retrieve_results|{u'item': u'glibc-1.0-16.el7', u'type': u'koji_build'}") E Actual call: delete("greenwave.resources:retrieve_results|{'type': 'koji_build', 'item': 'glibc-1.0-16.el7'}")
I actually noticed that while working on PR#184, the problem goes away there because the function's args change to (subject_type, subject_identifier) strings, instead of a dict.
So I think let's put a pin in this for now, and try again after PR#184 lands. Everything should work then.
TypeError: '<' not supported between instances of 'dict' and 'dict'
🤔
Okay I think I got it. PR#212
Metadata Update from @dcallagh: - Issue set to the milestone: 0.8
Metadata Update from @lholecek: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)
Login to comment on this ticket.