Hello community, here is the log from the commit of package python-aiodns for openSUSE:Factory checked in at 2019-03-05 12:19:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-aiodns (Old) and /work/SRC/openSUSE:Factory/.python-aiodns.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-aiodns" Tue Mar 5 12:19:32 2019 rev:3 rq:680482 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-aiodns/python-aiodns.changes 2018-05-15 10:33:26.124114526 +0200 +++ /work/SRC/openSUSE:Factory/.python-aiodns.new.28833/python-aiodns.changes 2019-03-05 12:19:47.604942592 +0100 @@ -1,0 +2,11 @@ +Fri Mar 1 09:30:55 UTC 2019 - Ondřej Súkup <[email protected]> + +- update to 1.2.0 +- Fix dependencies + * Add support for Python 3.7 + * Fix CNAME test + * Add examples with `async` and `await` + * Fix Python version check + * Add gethostbyaddr + +------------------------------------------------------------------- Old: ---- aiodns-1.1.1.tar.gz New: ---- aiodns-1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-aiodns.spec ++++++ --- /var/tmp/diff_new_pack.CKbcSY/_old 2019-03-05 12:19:48.684942262 +0100 +++ /var/tmp/diff_new_pack.CKbcSY/_new 2019-03-05 12:19:48.692942260 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-aiodns # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -21,7 +21,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-aiodns -Version: 1.1.1 +Version: 1.2.0 Release: 0 Summary: Simple DNS resolver for asyncio License: MIT @@ -29,11 +29,16 @@ Url: https://github.com/saghul/aiodns/releases 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-pycares -BuildRequires: python-trollius +BuildRequires: %{python_module pycares} +BuildRequires: %{python_module trollius} +BuildRequires: python-typing %endif BuildArch: noarch ++++++ aiodns-1.1.1.tar.gz -> aiodns-1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiodns-aiodns-1.1.1/.travis.yml new/aiodns-aiodns-1.2.0/.travis.yml --- old/aiodns-aiodns-1.1.1/.travis.yml 2016-08-28 10:45:11.000000000 +0200 +++ new/aiodns-aiodns-1.2.0/.travis.yml 2019-01-17 09:00:22.000000000 +0100 @@ -1,13 +1,25 @@ language: python sudo: false -python: - - "2.7" - - "3.2" - - "3.3" - - "3.4" +matrix: + include: + - python: 2.7 + - python: 3.4 + - python: 3.5 + - python: 3.6 + - python: 3.7 + dist: xenial + sudo: true + #- python: pypy3 +branches: + only: + - master + +before_install: + - pip install -U setuptools pip wheel install: + - python -V - pip install . script: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiodns-aiodns-1.1.1/ChangeLog new/aiodns-aiodns-1.2.0/ChangeLog --- old/aiodns-aiodns-1.1.1/ChangeLog 2016-08-28 10:45:11.000000000 +0200 +++ new/aiodns-aiodns-1.2.0/ChangeLog 2019-01-17 09:00:22.000000000 +0100 @@ -1,3 +1,11 @@ +1.2.0 +===== +- Add support for Python 3.7 +- Fix CNAME test +- Add examples with `async` and `await` +- Fix Python version check +- Add gethostbyaddr + 1.1.1 ===== - Use per-version requires for wheels diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiodns-aiodns-1.1.1/README.rst new/aiodns-aiodns-1.2.0/README.rst --- old/aiodns-aiodns-1.1.1/README.rst 2016-08-28 10:45:11.000000000 +0200 +++ new/aiodns-aiodns-1.2.0/README.rst 2019-01-17 09:00:22.000000000 +0100 @@ -28,7 +28,23 @@ The library supports both *asyncio* and *Trollius*. -If you use Python 3 you may use `yield from` statement:: +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) + + coro = query('google.com', 'A') + result = loop.run_until_complete(coro) + + + +If you use Python 3.3/3.4 you may use `yield from` statement:: @asyncio.coroutine def func(): @@ -57,6 +73,7 @@ local hostnames (such as ``localhost``). Please check `the documentation <http://pycares.readthedocs.io/en/latest/channel.html#pycares.Channel.gethostbyname>`_ for the result fields. The actual result of the call is a ``asyncio.Future``. +* ``gethostbyaddr(name)``: Make a reverse lookup for an address. * ``cancel()``: Cancel all pending DNS queries. All futures will get ``DNSError`` exception set, with ``ARES_ECANCELLED`` errno. @@ -70,7 +87,7 @@ Author ====== -Saúl Ibarra Corretgé <[email protected]> +Saúl Ibarra Corretgé <[email protected]> License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiodns-aiodns-1.1.1/aiodns/__init__.py new/aiodns-aiodns-1.2.0/aiodns/__init__.py --- old/aiodns-aiodns-1.1.1/aiodns/__init__.py 2016-08-28 10:45:11.000000000 +0200 +++ new/aiodns-aiodns-1.2.0/aiodns/__init__.py 2019-01-17 09:00:22.000000000 +0100 @@ -6,10 +6,17 @@ import trollius as asyncio import pycares -from . import error +from typing import ( + Any, + List, + Optional, +) +# TODO: Work out mypy no attribute error and remove ignore +from . import error # type: ignore -__version__ = '1.1.1' + +__version__ = '1.2.0' __all__ = ('DNSResolver', 'error') @@ -33,26 +40,30 @@ class DNSResolver(object): 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() assert self.loop is not None kwargs.pop('sock_state_cb', None) self._channel = pycares.Channel(sock_state_cb=self._sock_state_cb, **kwargs) if nameservers: self.nameservers = nameservers - self._read_fds = set() - self._write_fds = set() + self._read_fds = set() # type: Set[int] + self._write_fds = set() # type: Set[int] self._timer = None @property def nameservers(self): + # type: () -> pycares.Channel return self._channel.servers @nameservers.setter def nameservers(self, value): + # type: (List[str]) -> None self._channel.servers = value @staticmethod def _callback(fut, result, errorno): + # type: (asyncio.Future, Any, int) -> None if fut.cancelled(): return if errorno is not None: @@ -61,6 +72,7 @@ fut.set_result(result) def query(self, host, qtype): + # type: (str, str) -> asyncio.Future try: qtype = query_type_map[qtype] except KeyError: @@ -71,15 +83,25 @@ return fut def gethostbyname(self, host, family): + # type: (str, str) -> asyncio.Future fut = asyncio.Future(loop=self.loop) cb = functools.partial(self._callback, fut) self._channel.gethostbyname(host, family, cb) return fut + def gethostbyaddr(self, name): + # type: (str) -> asyncio.Future + fut = asyncio.Future(loop=self.loop) + cb = functools.partial(self._callback, fut) + self._channel.gethostbyaddr(name, cb) + return fut + def cancel(self): + # type: () -> None self._channel.cancel() def _sock_state_cb(self, fd, readable, writable): + # type: (int, bool, bool) -> None if readable or writable: if readable: self.loop.add_reader(fd, self._handle_event, fd, READ) @@ -104,6 +126,7 @@ self._timer = None def _handle_event(self, fd, event): + # type: (int, Any) -> None read_fd = pycares.ARES_SOCKET_BAD write_fd = pycares.ARES_SOCKET_BAD if event == READ: @@ -113,6 +136,7 @@ self._channel.process_fd(read_fd, write_fd) def _timer_cb(self): + # type: () -> None if self._read_fds or self._write_fds: self._channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) self._timer = self.loop.call_later(1.0, self._timer_cb) @@ -120,5 +144,5 @@ 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.1.1/setup.py new/aiodns-aiodns-1.2.0/setup.py --- old/aiodns-aiodns-1.1.1/setup.py 2016-08-28 10:45:11.000000000 +0200 +++ new/aiodns-aiodns-1.2.0/setup.py 2019-01-17 09:00:22.000000000 +0100 @@ -17,11 +17,11 @@ setup(name = "aiodns", version = get_version(), author = "Saúl Ibarra Corretgé", - author_email = "[email protected]", + author_email = "[email protected]", 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'], + install_requires = ['pycares>=1.0.0', 'typing'], extras_require = { ':python_version=="3.3"': ['asyncio'], ':python_version<="3.2"': ['trollius'], @@ -44,7 +44,8 @@ "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5" + "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.1.1/tasks.py new/aiodns-aiodns-1.2.0/tasks.py --- old/aiodns-aiodns-1.1.1/tasks.py 2016-08-28 10:45:11.000000000 +0200 +++ new/aiodns-aiodns-1.2.0/tasks.py 2019-01-17 09:00:22.000000000 +0100 @@ -1,14 +1,20 @@ -import invoke +import re +from invoke import task -# Based on https://github.com/pyca/cryptography/blob/master/tasks.py +def get_version(): + return re.search(r"""__version__\s+=\s+(?P<quote>['"])(?P<version>.+?)(?P=quote)""", open('aiodns/__init__.py').read()).group('version') [email protected] -def release(version): - invoke.run("git tag -a aiodns-{0} -m \"aiodns {0} release\"".format(version)) - invoke.run("git push --tags") - invoke.run("python setup.py sdist") - invoke.run("twine upload -r pypi dist/aiodns-{0}*".format(version)) +@task +def release(c): + version = get_version() + + c.run("git tag -a aiodns-{0} -m \"aiodns {0} release\"".format(version)) + c.run("git push --tags") + + c.run("python setup.py sdist") + c.run("python setup.py bdist_wheel") + c.run("twine upload -r pypi dist/aiodns-{0}*".format(version)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aiodns-aiodns-1.1.1/tests.py new/aiodns-aiodns-1.2.0/tests.py --- old/aiodns-aiodns-1.1.1/tests.py 2016-08-28 10:45:11.000000000 +0200 +++ new/aiodns-aiodns-1.2.0/tests.py 2019-01-17 09:00:22.000000000 +0100 @@ -40,7 +40,7 @@ self.assertTrue(result) def test_query_cname(self): - f = self.resolver.query('livechat.ripe.net', 'CNAME') + f = self.resolver.query('www.amazon.com', 'CNAME') result = self.loop.run_until_complete(f) self.assertTrue(result) @@ -113,7 +113,7 @@ # self.assertTrue(e) def test_query_twice(self): - if sys.version[:3] >= '3.3': + if sys.version_info >= (3, 3): exec('''if 1: @asyncio.coroutine def coro(self, host, qtype, n=2): @@ -138,6 +138,11 @@ result = self.loop.run_until_complete(f) self.assertTrue(result) + def test_gethostbyaddr(self): + 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) result = self.loop.run_until_complete(f)
