diff --git a/CHANGELOG.md b/CHANGELOG.md index 5423a09dff05d7ed46872154793693db2a50e4a5..0f74fdd6d214281853e60f4c8e2828d34d639ec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,4 +4,5 @@ have been made so far, between releases. # v1.3.2 -* removed the requirement for a Queue that for it to be equal to other Queue if their types do match \ No newline at end of file +* removed the requirement for a Queue that for it to be equal to other Queue if their types do match +* compile_definitions will now depend on requests diff --git a/README.md b/README.md index 0160f4f6fa93c4ab6fc04f16332bd38e2b0662ac..78731701929565a719bec78d82a5ec050359978a 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ A tool to generate [definitions.py](coolamqp/framing/definitions.py) from the AM In order to compile the definitions: -* Make sure that you have `yapf` installed +* Make sure that you have `yapf` and `requests` installed * then perform: ```python python -m compile_definitions diff --git a/compile_definitions/__main__.py b/compile_definitions/__main__.py index 124f786ff83fd69f816764f8b559a8f6ff941585..c3d26de1c705731c8f1c1a30cb7843307a7d7a26 100644 --- a/compile_definitions/__main__.py +++ b/compile_definitions/__main__.py @@ -5,14 +5,12 @@ import sys if sys.version.startswith('2.'): raise RuntimeError('Cannot run under Python 2.7') -from urllib.request import urlopen +import requests import collections import math import struct import subprocess -from io import BytesIO from xml.etree import ElementTree -from zipfile import ZipFile import six @@ -37,9 +35,10 @@ TYPE_TRANSLATOR = { def get_xml(xml_file): """Download XML definition from OASIS's website""" - r = urlopen(f'https://www.rabbitmq.com/resources/specs/amqp0-9-1.extended.xml') + r = requests.get('https://www.rabbitmq.com/resources/specs/amqp0-9-1.extended.xml') + r.raise_for_status() with open(xml_file, 'wb') as out: - out.write(r.read()) + out.write(r.content) def compile_definitions(xml_file='amqp0-9-1.extended.xml', diff --git a/coolamqp/__init__.py b/coolamqp/__init__.py index c7d8778d6952a2ec555b4f80d08bbbb7388e588e..f81ce5ab65cfa7ddcf3c66a0eb00c95e7358a0da 100644 --- a/coolamqp/__init__.py +++ b/coolamqp/__init__.py @@ -1 +1 @@ -__version__ = '1.3.2a2' +__version__ = '1.3.2a3'