This is a large merge which adds support for python 3.6+
It was a bit time consuming and took 3 full days. Some of the time was spent improving the tests and a good majority was spent dealing with the bytes/str handling between the api and the underlying sockets, buffers, and encoder/decoder.
Summary of changes:
Updating the test suite to properly clean up all queues and exchanges regardless of the test outcome and make it a little more externally configurable to run against different amqp user name
Introduce a dependency on python-future to bridge the support between python 2/3
Drop support for < py 2.7 and remove unnecessary vendored backports
Updated syntax in library and tests
Update and re-vendor the amqp_codegen tool
Update the local codegen tooling
Update buffer/socket/table logic to deal with bytes in py3
Updated doctests
I had to make a decision on the option for handling bytes vs str between python 2 and 3, and opted to keep a compatible experience for existing py2 users. And in py3 I went with encoding to bytes at the buffer/socket layer to allow for str type at the api layer. I had also encountered a new situation in my porting experience, where dictionaries unmarshaled directly from bytes produce bytes format keys. This means b'key' != 'key'. So I went with updating the codegen so the spec will decode the keys to a more natural str type.
Caveats:
There are 4 tests that originally failed for me in python2 using the master branch or 0.0.7 release tag (tested against RabbitMQ 3.6.6)
test_basic_qos
test_shared_qos
test_exchange_delete_not_found
test_queue_delete_not_found
For the qos tests, I was finding that the failure happened after the setting of the basic_qos, when the expected remaining messages were not read.
For the delete tests, I was finding that the expected NotFound exception no longer raises when deleting a queue or exchange that does not exist.
I have not spent time investigating these tests since they have not impacted our own higher level library consumption of puka.
This is a large merge which adds support for python 3.6+ It was a bit time consuming and took 3 full days. Some of the time was spent improving the tests and a good majority was spent dealing with the
bytes
/str
handling between the api and the underlying sockets, buffers, and encoder/decoder.Summary of changes:
bytes
in py3I had to make a decision on the option for handling
bytes
vsstr
between python 2 and 3, and opted to keep a compatible experience for existing py2 users. And in py3 I went with encoding to bytes at the buffer/socket layer to allow forstr
type at the api layer. I had also encountered a new situation in my porting experience, where dictionaries unmarshaled directly from bytes produce bytes format keys. This meansb'key' != 'key'
. So I went with updating the codegen so the spec will decode the keys to a more naturalstr
type.Caveats: There are 4 tests that originally failed for me in python2 using the master branch or 0.0.7 release tag (tested against RabbitMQ 3.6.6)
For the qos tests, I was finding that the failure happened after the setting of the
basic_qos
, when the expected remaining messages were not read. For the delete tests, I was finding that the expectedNotFound
exception no longer raises when deleting a queue or exchange that does not exist. I have not spent time investigating these tests since they have not impacted our own higher level library consumption of puka.Fixes #7 Refs #68