Hello community, here is the log from the commit of package python-acme for openSUSE:Factory checked in at 2017-12-12 21:22:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-acme (Old) and /work/SRC/openSUSE:Factory/.python-acme.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-acme" Tue Dec 12 21:22:56 2017 rev:14 rq:556038 version:0.20.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-acme/python-acme.changes 2017-10-08 20:15:16.543852008 +0200 +++ /work/SRC/openSUSE:Factory/.python-acme.new/python-acme.changes 2017-12-12 21:22:57.374466196 +0100 @@ -1,0 +2,6 @@ +Mon Dec 11 17:28:38 UTC 2017 - [email protected] + +- update to 0.20.0 + - No changelog from upstream + +------------------------------------------------------------------- Old: ---- acme-0.19.0.tar.gz acme-0.19.0.tar.gz.asc New: ---- acme-0.20.0.tar.gz acme-0.20.0.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-acme.spec ++++++ --- /var/tmp/diff_new_pack.DHRANj/_old 2017-12-12 21:22:57.962437812 +0100 +++ /var/tmp/diff_new_pack.DHRANj/_new 2017-12-12 21:22:57.962437812 +0100 @@ -21,7 +21,7 @@ %define libname acme Name: python-%{libname} -Version: 0.19.0 +Version: 0.20.0 Release: 0 Summary: Python library for the ACME protocol License: Apache-2.0 ++++++ acme-0.19.0.tar.gz -> acme-0.20.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-0.19.0/PKG-INFO new/acme-0.20.0/PKG-INFO --- old/acme-0.19.0/PKG-INFO 2017-10-04 21:05:25.000000000 +0200 +++ new/acme-0.20.0/PKG-INFO 2017-12-06 23:39:18.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: acme -Version: 0.19.0 +Version: 0.20.0 Summary: ACME protocol implementation in Python Home-page: https://github.com/letsencrypt/letsencrypt Author: Certbot Project diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-0.19.0/acme/client.py new/acme-0.20.0/acme/client.py --- old/acme-0.19.0/acme/client.py 2017-10-04 21:05:07.000000000 +0200 +++ new/acme-0.20.0/acme/client.py 2017-12-06 23:38:57.000000000 +0100 @@ -11,6 +11,7 @@ from six.moves import http_client # pylint: disable=import-error import OpenSSL +import re import requests import sys @@ -599,6 +600,7 @@ return response def _send_request(self, method, url, *args, **kwargs): + # pylint: disable=too-many-locals """Send HTTP request. Makes sure that `verify_ssl` is respected. Logs request and @@ -624,7 +626,32 @@ kwargs.setdefault('headers', {}) kwargs['headers'].setdefault('User-Agent', self.user_agent) kwargs.setdefault('timeout', self._default_timeout) - response = self.session.request(method, url, *args, **kwargs) + try: + response = self.session.request(method, url, *args, **kwargs) + except requests.exceptions.RequestException as e: + # pylint: disable=pointless-string-statement + """Requests response parsing + + The requests library emits exceptions with a lot of extra text. + We parse them with a regexp to raise a more readable exceptions. + + Example: + HTTPSConnectionPool(host='acme-v01.api.letsencrypt.org', + port=443): Max retries exceeded with url: /directory + (Caused by NewConnectionError(' + <requests.packages.urllib3.connection.VerifiedHTTPSConnection + object at 0x108356c50>: Failed to establish a new connection: + [Errno 65] No route to host',))""" + + # pylint: disable=line-too-long + err_regex = r".*host='(\S*)'.*Max retries exceeded with url\: (\/\w*).*(\[Errno \d+\])([A-Za-z ]*)" + m = re.match(err_regex, str(e)) + if m is None: + raise # pragma: no cover + else: + host, path, _err_no, err_msg = m.groups() + raise ValueError("Requesting {0}{1}:{2}".format(host, path, err_msg)) + # If content is DER, log the base64 of it instead of raw bytes, to keep # binary data out of the logs. if response.headers.get("Content-Type") == DER_CONTENT_TYPE: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-0.19.0/acme/client_test.py new/acme-0.20.0/acme/client_test.py --- old/acme-0.19.0/acme/client_test.py 2017-10-04 21:05:07.000000000 +0200 +++ new/acme-0.20.0/acme/client_test.py 2017-12-06 23:38:57.000000000 +0100 @@ -621,6 +621,21 @@ self.assertRaises(requests.exceptions.RequestException, self.net._send_request, 'GET', 'uri') + def test_urllib_error(self): + # Using a connection error to test a properly formatted error message + try: + # pylint: disable=protected-access + self.net._send_request('GET', "http://localhost:19123/nonexistent.txt") + + # Value Error Generated Exceptions + except ValueError as y: + self.assertEqual("Requesting localhost/nonexistent: " + "Connection refused", str(y)) + + # Requests Library Exceptions + except requests.exceptions.ConnectionError as z: #pragma: no cover + self.assertEqual("('Connection aborted.', " + "error(111, 'Connection refused'))", str(z)) class ClientNetworkWithMockedResponseTest(unittest.TestCase): """Tests for acme.client.ClientNetwork which mock out response.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-0.19.0/acme/crypto_util_test.py new/acme-0.20.0/acme/crypto_util_test.py --- old/acme-0.19.0/acme/crypto_util_test.py 2017-10-04 21:05:07.000000000 +0200 +++ new/acme-0.20.0/acme/crypto_util_test.py 2017-12-06 23:38:57.000000000 +0100 @@ -18,7 +18,6 @@ class SSLSocketAndProbeSNITest(unittest.TestCase): """Tests for acme.crypto_util.SSLSocket/probe_sni.""" - _multiprocess_can_split_ = True def setUp(self): self.cert = test_util.load_comparable_cert('rsa2048_cert.pem') @@ -69,7 +68,6 @@ class PyOpenSSLCertOrReqSANTest(unittest.TestCase): """Test for acme.crypto_util._pyopenssl_cert_or_req_san.""" - _multiprocess_can_split_ = True @classmethod def _call(cls, loader, name): @@ -140,7 +138,6 @@ class RandomSnTest(unittest.TestCase): """Test for random certificate serial numbers.""" - _multiprocess_can_split_ = True def setUp(self): self.cert_count = 5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-0.19.0/acme/messages.py new/acme-0.20.0/acme/messages.py --- old/acme-0.19.0/acme/messages.py 2017-10-04 21:05:07.000000000 +0200 +++ new/acme-0.20.0/acme/messages.py 2017-12-06 23:38:57.000000000 +0100 @@ -325,13 +325,26 @@ """ __slots__ = ('chall',) - uri = jose.Field('uri') + # ACMEv1 has a "uri" field in challenges. ACMEv2 has a "url" field. This + # challenge object supports either one, but should be accessed through the + # name "uri". In Client.answer_challenge, whichever one is set will be + # used. + _uri = jose.Field('uri', omitempty=True, default=None) + _url = jose.Field('url', omitempty=True, default=None) status = jose.Field('status', decoder=Status.from_json, omitempty=True, default=STATUS_PENDING) validated = fields.RFC3339Field('validated', omitempty=True) error = jose.Field('error', decoder=Error.from_json, omitempty=True, default=None) + def __init__(self, **kwargs): + kwargs = dict((self._internal_name(k), v) for k, v in kwargs.items()) + # pylint: disable=star-args + super(ChallengeBody, self).__init__(**kwargs) + + def encode(self, name): + return super(ChallengeBody, self).encode(self._internal_name(name)) + def to_partial_json(self): jobj = super(ChallengeBody, self).to_partial_json() jobj.update(self.chall.to_partial_json()) @@ -343,9 +356,23 @@ jobj_fields['chall'] = challenges.Challenge.from_json(jobj) return jobj_fields + @property + def uri(self): + """The URL of this challenge.""" + return self._url or self._uri + def __getattr__(self, name): return getattr(self.chall, name) + def __iter__(self): + # When iterating over fields, use the external name 'uri' instead of + # the internal '_uri'. + for name in super(ChallengeBody, self).__iter__(): + yield name[1:] if name == '_uri' else name + + def _internal_name(self, name): + return '_' + name if name == 'uri' else name + class ChallengeResource(Resource): """Challenge Resource. @@ -358,10 +385,10 @@ authzr_uri = jose.Field('authzr_uri') @property - def uri(self): # pylint: disable=missing-docstring,no-self-argument - # bug? 'method already defined line None' - # pylint: disable=function-redefined - return self.body.uri # pylint: disable=no-member + def uri(self): + """The URL of the challenge body.""" + # pylint: disable=function-redefined,no-member + return self.body.uri class Authorization(ResourceBody): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-0.19.0/acme/messages_test.py new/acme-0.20.0/acme/messages_test.py --- old/acme-0.19.0/acme/messages_test.py 2017-10-04 21:05:07.000000000 +0200 +++ new/acme-0.20.0/acme/messages_test.py 2017-12-06 23:38:57.000000000 +0100 @@ -71,6 +71,12 @@ self.assertTrue(is_acme_error(Error.with_code('badCSR'))) self.assertRaises(ValueError, Error.with_code, 'not an ACME error code') + def test_str(self): + self.assertEqual( + str(self.error), + u"{0.typ} :: {0.description} :: {0.detail} :: {0.title}" + .format(self.error)) + class ConstantTest(unittest.TestCase): """Tests for acme.messages._Constant.""" @@ -277,6 +283,9 @@ 'detail': 'Unable to communicate with DNS server', } + def test_encode(self): + self.assertEqual(self.challb.encode('uri'), self.challb.uri) + def test_to_partial_json(self): self.assertEqual(self.jobj_to, self.challb.to_partial_json()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-0.19.0/acme/standalone_test.py new/acme-0.20.0/acme/standalone_test.py --- old/acme-0.19.0/acme/standalone_test.py 2017-10-04 21:05:07.000000000 +0200 +++ new/acme-0.20.0/acme/standalone_test.py 2017-12-06 23:38:57.000000000 +0100 @@ -23,7 +23,6 @@ class TLSServerTest(unittest.TestCase): """Tests for acme.standalone.TLSServer.""" - _multiprocess_can_split_ = True def test_bind(self): # pylint: disable=no-self-use from acme.standalone import TLSServer @@ -42,7 +41,6 @@ class TLSSNI01ServerTest(unittest.TestCase): """Test for acme.standalone.TLSSNI01Server.""" - _multiprocess_can_split_ = True def setUp(self): self.certs = {b'localhost': ( @@ -70,7 +68,6 @@ class HTTP01ServerTest(unittest.TestCase): """Tests for acme.standalone.HTTP01Server.""" - _multiprocess_can_split_ = True def setUp(self): self.account_key = jose.JWK.load( @@ -124,7 +121,6 @@ class BaseDualNetworkedServersTest(unittest.TestCase): """Test for acme.standalone.BaseDualNetworkedServers.""" - _multiprocess_can_split_ = True class SingleProtocolServer(socketserver.TCPServer): """Server that only serves on a single protocol. FreeBSD has this behavior for AF_INET6.""" @@ -174,7 +170,6 @@ class TLSSNI01DualNetworkedServersTest(unittest.TestCase): """Test for acme.standalone.TLSSNI01DualNetworkedServers.""" - _multiprocess_can_split_ = True def setUp(self): self.certs = {b'localhost': ( @@ -202,7 +197,6 @@ class HTTP01DualNetworkedServersTest(unittest.TestCase): """Tests for acme.standalone.HTTP01DualNetworkedServers.""" - _multiprocess_can_split_ = True def setUp(self): self.account_key = jose.JWK.load( @@ -254,7 +248,6 @@ class TestSimpleTLSSNI01Server(unittest.TestCase): """Tests for acme.standalone.simple_tls_sni_01_server.""" - _multiprocess_can_split_ = True def setUp(self): # mirror ../examples/standalone diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-0.19.0/acme.egg-info/PKG-INFO new/acme-0.20.0/acme.egg-info/PKG-INFO --- old/acme-0.19.0/acme.egg-info/PKG-INFO 2017-10-04 21:05:25.000000000 +0200 +++ new/acme-0.20.0/acme.egg-info/PKG-INFO 2017-12-06 23:39:18.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: acme -Version: 0.19.0 +Version: 0.20.0 Summary: ACME protocol implementation in Python Home-page: https://github.com/letsencrypt/letsencrypt Author: Certbot Project diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-0.19.0/acme.egg-info/requires.txt new/acme-0.20.0/acme.egg-info/requires.txt --- old/acme-0.19.0/acme.egg-info/requires.txt 2017-10-04 21:05:25.000000000 +0200 +++ new/acme-0.20.0/acme.egg-info/requires.txt 2017-12-06 23:39:18.000000000 +0100 @@ -8,7 +8,8 @@ six>=1.9.0 [dev] -nose +pytest +pytest-xdist tox [docs] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-0.19.0/setup.py new/acme-0.20.0/setup.py --- old/acme-0.19.0/setup.py 2017-10-04 21:05:07.000000000 +0200 +++ new/acme-0.20.0/setup.py 2017-12-06 23:38:57.000000000 +0100 @@ -4,7 +4,7 @@ from setuptools import find_packages -version = '0.19.0' +version = '0.20.0' # Please update tox.ini when modifying dependency version requirements install_requires = [ @@ -31,7 +31,8 @@ ]) dev_extras = [ - 'nose', + 'pytest', + 'pytest-xdist', 'tox', ]
