Hello community, here is the log from the commit of package python-aiodns for openSUSE:Factory checked in at 2019-03-22 15:10:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-aiodns (Old) and /work/SRC/openSUSE:Factory/.python-aiodns.new.25356 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-aiodns" Fri Mar 22 15:10:07 2019 rev:4 rq:687347 version:2.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-aiodns/python-aiodns.changes 2019-03-05 12:19:47.604942592 +0100 +++ /work/SRC/openSUSE:Factory/.python-aiodns.new.25356/python-aiodns.changes 2019-03-22 15:10:11.985347498 +0100 @@ -1,0 +2,7 @@ +Thu Mar 21 14:07:32 UTC 2019 - Ondřej Súkup <mimi...@gmail.com> + +- update to 2.0.0 + * drop python2 support + * Add support for ANY queries + +------------------------------------------------------------------- Old: ---- aiodns-1.2.0.tar.gz New: ---- aiodns-2.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-aiodns.spec ++++++ --- /var/tmp/diff_new_pack.AvlJuB/_old 2019-03-22 15:10:13.069346560 +0100 +++ /var/tmp/diff_new_pack.AvlJuB/_new 2019-03-22 15:10:13.073346556 +0100 @@ -20,8 +20,9 @@ %bcond_with tests %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define skip_python2 1 Name: python-aiodns -Version: 1.2.0 +Version: 2.0.0 Release: 0 Summary: Simple DNS resolver for asyncio License: MIT @@ -30,14 +31,10 @@ Source0: https://github.com/saghul/aiodns/archive/aiodns-%{version}.tar.gz BuildRequires: %{python_module setuptools} Requires: python-pycares >= 3.0.0 -%ifpython2 -Requires: python-typing -%endif BuildRequires: fdupes BuildRequires: python-rpm-macros %if %{with tests} BuildRequires: %{python_module pycares} -BuildRequires: %{python_module trollius} BuildRequires: python-typing %endif BuildArch: noarch ++++++ aiodns-1.2.0.tar.gz -> aiodns-2.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiodns-aiodns-1.2.0/.travis.yml new/aiodns-aiodns-2.0.0/.travis.yml --- old/aiodns-aiodns-1.2.0/.travis.yml 2019-01-17 09:00:22.000000000 +0100 +++ new/aiodns-aiodns-2.0.0/.travis.yml 2019-03-02 13:01:34.000000000 +0100 @@ -3,14 +3,12 @@ matrix: include: - - python: 2.7 - - python: 3.4 - python: 3.5 - python: 3.6 - python: 3.7 dist: xenial sudo: true - #- python: pypy3 + - python: pypy3 branches: only: - master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiodns-aiodns-1.2.0/ChangeLog new/aiodns-aiodns-2.0.0/ChangeLog --- old/aiodns-aiodns-1.2.0/ChangeLog 2019-01-17 09:00:22.000000000 +0100 +++ new/aiodns-aiodns-2.0.0/ChangeLog 2019-03-02 13:01:34.000000000 +0100 @@ -1,3 +1,25 @@ +2.0.0 +===== +(changes since version 1.x) + +- Drop support for Python < 3.5 +- Add support for ANY queries +- Raise pycares dependency + +2.0.0b2 +======= +- Raise pycares dependency + +2.0.0b1 +======= +- Fix using typing on Python 3.7 + +2.0.0b0 +======= +- Drop support for Python < 3.5 +- Add support for ANY queries +- Raise pycares dependency + 1.2.0 ===== - Add support for Python 3.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiodns-aiodns-1.2.0/README.rst new/aiodns-aiodns-2.0.0/README.rst --- old/aiodns-aiodns-1.2.0/README.rst 2019-01-17 09:00:22.000000000 +0100 +++ new/aiodns-aiodns-2.0.0/README.rst 2019-03-02 13:01:34.000000000 +0100 @@ -5,8 +5,7 @@ .. image:: https://secure.travis-ci.org/saghul/aiodns.png?branch=master :target: http://travis-ci.org/saghul/aiodns -aiodns provides a simple way for doing asynchronous DNS resolutions -with a synchronous looking interface by using `pycares <https://github.com/saghul/pycares>`_. +aiodns provides a simple way for doing asynchronous DNS resolutions using `pycares <https://github.com/saghul/pycares>`_. Example @@ -19,22 +18,6 @@ loop = asyncio.get_event_loop() resolver = aiodns.DNSResolver(loop=loop) - f = resolver.query('google.com','A') - result = loop.run_until_complete(f) - print(result) - - -The following query types are supported: A, AAAA, CNAME, MX, NAPTR, NS, PTR, SOA, SRV, TXT. - -The library supports both *asyncio* and *Trollius*. - -If you use use Python 3.5+, you can use the `async` and `await` statements:: - - import asyncio - import aiodns - - loop = asyncio.get_event_loop() - resolver = aiodns.DNSResolver(loop=loop) async def query(name, query_type): return await resolver.query(name, query_type) @@ -43,18 +26,8 @@ result = loop.run_until_complete(coro) +The following query types are supported: A, AAAA, ANY, CNAME, MX, NAPTR, NS, PTR, SOA, SRV, TXT. -If you use Python 3.3/3.4 you may use `yield from` statement:: - - @asyncio.coroutine - def func(): - result = yield from resolver.query('google.com','A') - -For Trollius you should use another syntax like:: - - @trollius.coroutine - def func(): - result = yield trollius.From(resolver.query('google.com','A')) API === @@ -81,7 +54,7 @@ Running the test suite ====================== -To run the test suite: ``python test_aiodns.py`` +To run the test suite: ``python tests.py`` Author @@ -99,8 +72,7 @@ Python versions =============== -Python >= 3.4 is natively supported. Python 3.3 supported using the `asyncio package <https://pypi.python.org/pypi/asyncio>`_. -Older Python versions(2.6 - 3.2) are supported using `trollius <https://pypi.python.org/pypi/trollius>`_. +Python >= 3.5 are supported. Contributing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiodns-aiodns-1.2.0/aiodns/__init__.py new/aiodns-aiodns-2.0.0/aiodns/__init__.py --- old/aiodns-aiodns-1.2.0/aiodns/__init__.py 2019-01-17 09:00:22.000000000 +0100 +++ new/aiodns-aiodns-2.0.0/aiodns/__init__.py 2019-03-02 13:01:34.000000000 +0100 @@ -1,9 +1,6 @@ -import functools -try: - import asyncio -except ImportError: - import trollius as asyncio +import asyncio +import functools import pycares from typing import ( @@ -16,7 +13,7 @@ from . import error # type: ignore -__version__ = '1.2.0' +__version__ = '2.0.0' __all__ = ('DNSResolver', 'error') @@ -26,6 +23,7 @@ query_type_map = {'A' : pycares.QUERY_TYPE_A, 'AAAA' : pycares.QUERY_TYPE_AAAA, + 'ANY' : pycares.QUERY_TYPE_ANY, 'CNAME' : pycares.QUERY_TYPE_CNAME, 'MX' : pycares.QUERY_TYPE_MX, 'NAPTR' : pycares.QUERY_TYPE_NAPTR, @@ -37,8 +35,7 @@ } -class DNSResolver(object): - +class DNSResolver: def __init__(self, nameservers=None, loop=None, **kwargs): # type: (Optional[List[str]], Optional[asyncio.AbstractEventLoop], Any) -> None self.loop = loop or asyncio.get_event_loop() @@ -143,6 +140,3 @@ else: self._timer = None - def __del__(self): - # type: () -> None - self._channel.destroy() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiodns-aiodns-1.2.0/setup.py new/aiodns-aiodns-2.0.0/setup.py --- old/aiodns-aiodns-1.2.0/setup.py 2019-01-17 09:00:22.000000000 +0100 +++ new/aiodns-aiodns-2.0.0/setup.py 2019-03-02 13:01:34.000000000 +0100 @@ -4,10 +4,7 @@ import re import sys -try: - from setuptools import setup -except ImportError: - from distutils.core import setup +from setuptools import setup def get_version(): @@ -21,11 +18,7 @@ url = "http://github.com/saghul/aiodns", description = "Simple DNS resolver for asyncio", long_description = codecs.open("README.rst", encoding="utf-8").read(), - install_requires = ['pycares>=1.0.0', 'typing'], - extras_require = { - ':python_version=="3.3"': ['asyncio'], - ':python_version<="3.2"': ['trollius'], - }, + install_requires = ['pycares>=3.0.0', 'typing; python_version<"3.7"'], packages = ['aiodns'], platforms = ["POSIX", "Microsoft Windows"], classifiers = [ @@ -35,15 +28,7 @@ "Operating System :: POSIX", "Operating System :: Microsoft :: Windows", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.0", - "Programming Language :: Python :: 3.1", - "Programming Language :: Python :: 3.2", - "Programming Language :: Python :: 3.3", - "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiodns-aiodns-1.2.0/tests.py new/aiodns-aiodns-2.0.0/tests.py --- old/aiodns-aiodns-1.2.0/tests.py 2019-01-17 09:00:22.000000000 +0100 +++ new/aiodns-aiodns-2.0.0/tests.py 2019-03-02 13:01:34.000000000 +0100 @@ -1,19 +1,15 @@ #!/usr/bin/env python -try: - import asyncio -except ImportError: - import trollius as asyncio +import asyncio +import ipaddress import unittest import socket import sys import aiodns -import pycares class DNSTest(unittest.TestCase): - def setUp(self): self.loop = asyncio.new_event_loop() self.addCleanup(self.loop.close) @@ -25,6 +21,11 @@ def test_query_a(self): f = self.resolver.query('google.com', 'A') result = self.loop.run_until_complete(f) + + def test_query_async_await(self): + async def f(): + return await self.resolver.query('google.com', 'A') + result = self.loop.run_until_complete(f()) self.assertTrue(result) def test_query_a_bad(self): @@ -76,7 +77,7 @@ def test_query_ptr(self): ip = '8.8.8.8' - f = self.resolver.query(pycares.reverse_address(ip), 'PTR') + f = self.resolver.query(ipaddress.ip_address(ip).reverse_pointer, 'PTR') result = self.loop.run_until_complete(f) self.assertTrue(result) @@ -100,59 +101,49 @@ except aiodns.error.DNSError as e: self.assertEqual(e.args[0], aiodns.error.ARES_ECANCELLED) -# def test_future_cancel(self): -# # TODO: write this in such a way it also works with trollius -# f = self.resolver.query('google.com', 'A') -# f.cancel() -# def coro(): -# yield from asyncio.sleep(0.1, loop=self.loop) -# yield from f -# try: -# self.loop.run_until_complete(coro()) -# except asyncio.CancelledError as e: -# self.assertTrue(e) + def test_future_cancel(self): + f = self.resolver.query('google.com', 'A') + f.cancel() + async def coro(): + await asyncio.sleep(0.1, loop=self.loop) + await f + try: + self.loop.run_until_complete(coro()) + except asyncio.CancelledError as e: + self.assertTrue(e) def test_query_twice(self): - if sys.version_info >= (3, 3): - exec('''if 1: - @asyncio.coroutine - def coro(self, host, qtype, n=2): - for i in range(n): - result = yield from self.resolver.query(host, qtype) - self.assertTrue(result) - ''') - - else: - exec('''if 1: - @asyncio.coroutine - def coro(self, host, qtype, n=2): - for i in range(n): - result = yield asyncio.From(self.resolver.query(host, qtype)) - self.assertTrue(result) - ''') - - self.loop.run_until_complete(locals()['coro'](self, 'gmail.com', 'MX')) + async def coro(self, host, qtype, n=2): + for i in range(n): + result = await self.resolver.query(host, qtype) + self.assertTrue(result) + self.loop.run_until_complete(coro(self, 'gmail.com', 'MX')) def test_gethostbyname(self): - f = self.resolver.gethostbyname("google.com", socket.AF_INET) + f = self.resolver.gethostbyname('google.com', socket.AF_INET) result = self.loop.run_until_complete(f) self.assertTrue(result) def test_gethostbyaddr(self): - f = self.resolver.gethostbyaddr("127.0.0.1") + f = self.resolver.gethostbyaddr('127.0.0.1') result = self.loop.run_until_complete(f) self.assertTrue(result) def test_gethostbyname_ipv6(self): - f = self.resolver.gethostbyname("ipv6.google.com", socket.AF_INET6) + f = self.resolver.gethostbyname('ipv6.google.com', socket.AF_INET6) result = self.loop.run_until_complete(f) self.assertTrue(result) def test_gethostbyname_bad_family(self): - f = self.resolver.gethostbyname("ipv6.google.com", -1) + f = self.resolver.gethostbyname('ipv6.google.com', -1) with self.assertRaises(aiodns.error.DNSError): self.loop.run_until_complete(f) + def test_query_bad_chars(self): + f = self.resolver.query('xn--cardeosapeluqueros-r0b.com', 'MX') + result = self.loop.run_until_complete(f) + self.assertTrue(result) + if __name__ == '__main__': unittest.main(verbosity=2)