Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-aiohttp-socks for
openSUSE:Factory checked in at 2025-01-05 15:29:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-aiohttp-socks (Old)
and /work/SRC/openSUSE:Factory/.python-aiohttp-socks.new.1881 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-aiohttp-socks"
Sun Jan 5 15:29:39 2025 rev:13 rq:1234669 version:0.10.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-aiohttp-socks/python-aiohttp-socks.changes
2024-11-25 23:22:45.213807913 +0100
+++
/work/SRC/openSUSE:Factory/.python-aiohttp-socks.new.1881/python-aiohttp-socks.changes
2025-01-05 15:29:45.982085206 +0100
@@ -1,0 +2,11 @@
+Fri Dec 27 07:02:43 UTC 2024 - Jiri Slaby <[email protected]>
+
+- Update to 0.10.1
+ * fix ProxyConnector port type hint: str -> int
+ * Update README.md
+ * Refactoring
+ * Make host and port arguments required
+ * Fix compatibility with Python 3.8
+ * minimal typing changes
+
+-------------------------------------------------------------------
Old:
----
aiohttp_socks-0.9.1.tar.gz
New:
----
aiohttp_socks-0.10.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-aiohttp-socks.spec ++++++
--- /var/tmp/diff_new_pack.LNDYlK/_old 2025-01-05 15:29:46.634112026 +0100
+++ /var/tmp/diff_new_pack.LNDYlK/_new 2025-01-05 15:29:46.634112026 +0100
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-aiohttp-socks
-Version: 0.9.1
+Version: 0.10.1
Release: 0
Summary: SOCKS proxy connector for aiohttp
License: Apache-2.0
++++++ aiohttp_socks-0.9.1.tar.gz -> aiohttp_socks-0.10.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiohttp_socks-0.9.1/PKG-INFO
new/aiohttp_socks-0.10.1/PKG-INFO
--- old/aiohttp_socks-0.9.1/PKG-INFO 2024-11-20 14:49:16.908458500 +0100
+++ new/aiohttp_socks-0.10.1/PKG-INFO 2024-12-26 08:06:00.312892000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: aiohttp_socks
-Version: 0.9.1
+Version: 0.10.1
Summary: Proxy connector for aiohttp
Author-email: Roman Snegirev <[email protected]>
License: Apache-2.0
@@ -46,7 +46,7 @@
## Requirements
- Python >= 3.8
- aiohttp >= 3.10.0
-- python-socks[asyncio] >= 1.0.1
+- python-socks[asyncio] >= 2.4.3
## Installation
```
@@ -71,7 +71,7 @@
# port=1080,
# username='user',
# password='password',
- # rdns=True
+ # rdns=True # default is True for socks5
# )
### proxy chaining (since ver 0.3.3)
@@ -85,25 +85,6 @@
return await response.text()
```
-#### aiohttp-socks also provides `open_connection` and `create_connection`
functions:
-
-```python
-from aiohttp_socks import open_connection
-
-async def fetch():
- reader, writer = await open_connection(
- proxy_url='socks5://user:[email protected]:1080',
- host='check-host.net',
- port=80
- )
- request = (b"GET /ip HTTP/1.1\r\n"
- b"Host: check-host.net\r\n"
- b"Connection: close\r\n\r\n")
-
- writer.write(request)
- return await reader.read(-1)
-```
-
## Why yet another SOCKS connector for aiohttp
Unlike [aiosocksy](https://github.com/romis2012/aiosocksy), aiohttp_socks has
only single point of integration with aiohttp.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiohttp_socks-0.9.1/README.md
new/aiohttp_socks-0.10.1/README.md
--- old/aiohttp_socks-0.9.1/README.md 2024-08-02 07:42:12.000000000 +0200
+++ new/aiohttp_socks-0.10.1/README.md 2024-12-23 11:28:15.000000000 +0100
@@ -14,7 +14,7 @@
## Requirements
- Python >= 3.8
- aiohttp >= 3.10.0
-- python-socks[asyncio] >= 1.0.1
+- python-socks[asyncio] >= 2.4.3
## Installation
```
@@ -39,7 +39,7 @@
# port=1080,
# username='user',
# password='password',
- # rdns=True
+ # rdns=True # default is True for socks5
# )
### proxy chaining (since ver 0.3.3)
@@ -53,25 +53,6 @@
return await response.text()
```
-#### aiohttp-socks also provides `open_connection` and `create_connection`
functions:
-
-```python
-from aiohttp_socks import open_connection
-
-async def fetch():
- reader, writer = await open_connection(
- proxy_url='socks5://user:[email protected]:1080',
- host='check-host.net',
- port=80
- )
- request = (b"GET /ip HTTP/1.1\r\n"
- b"Host: check-host.net\r\n"
- b"Connection: close\r\n\r\n")
-
- writer.write(request)
- return await reader.read(-1)
-```
-
## Why yet another SOCKS connector for aiohttp
Unlike [aiosocksy](https://github.com/romis2012/aiosocksy), aiohttp_socks has
only single point of integration with aiohttp.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiohttp_socks-0.9.1/aiohttp_socks/__init__.py
new/aiohttp_socks-0.10.1/aiohttp_socks/__init__.py
--- old/aiohttp_socks-0.9.1/aiohttp_socks/__init__.py 2024-11-20
13:50:52.000000000 +0100
+++ new/aiohttp_socks-0.10.1/aiohttp_socks/__init__.py 2024-12-26
08:03:51.000000000 +0100
@@ -1,5 +1,5 @@
__title__ = 'aiohttp-socks'
-__version__ = '0.9.1'
+__version__ = '0.10.1'
from python_socks import (
ProxyError,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiohttp_socks-0.9.1/aiohttp_socks/connector.py
new/aiohttp_socks-0.10.1/aiohttp_socks/connector.py
--- old/aiohttp_socks-0.9.1/aiohttp_socks/connector.py 2024-07-31
08:28:58.000000000 +0200
+++ new/aiohttp_socks-0.10.1/aiohttp_socks/connector.py 2024-12-26
08:02:39.000000000 +0100
@@ -1,18 +1,22 @@
import asyncio
import socket
-import typing
-from asyncio import BaseTransport, StreamWriter
-from typing import Iterable
+from ssl import SSLContext
+from typing import Any, Iterable, NamedTuple, Optional, List, Tuple
-from aiohttp import TCPConnector, ClientConnectorError
-from aiohttp.abc import AbstractResolver
+from aiohttp import ClientConnectorError, TCPConnector
+from aiohttp.abc import AbstractResolver, ResolveResult
from aiohttp.client_proto import ResponseHandler
from python_socks import ProxyType, parse_proxy_url
from python_socks.async_.asyncio.v2 import Proxy
class NoResolver(AbstractResolver):
- async def resolve(self, host, port=0, family=socket.AF_INET):
+ async def resolve(
+ self,
+ host: str,
+ port: int = 0,
+ family: socket.AddressFamily = socket.AF_INET, # pylint:
disable=no-member
+ ) -> List[ResolveResult]:
return [
{
'hostname': host,
@@ -36,23 +40,58 @@
See StreamWriter.__del__ method (was added in Python 3.11.5)
"""
- def __init__(self, loop: asyncio.AbstractEventLoop, writer: StreamWriter):
+ def __init__(self, loop: asyncio.AbstractEventLoop, writer:
asyncio.StreamWriter) -> None:
super().__init__(loop)
self._writer = writer
-class ProxyConnector(TCPConnector):
- def __init__(
+class _BaseProxyConnector(TCPConnector):
+ async def _wrap_create_connection(
self,
- proxy_type=ProxyType.SOCKS5,
- host=None,
- port=None,
- username=None,
- password=None,
- rdns=None,
- proxy_ssl=None,
+ *args,
+ addr_infos,
+ req,
+ timeout,
+ client_error=ClientConnectorError,
**kwargs,
- ):
+ ) -> Tuple[asyncio.Transport, ResponseHandler]:
+ try:
+ host: str = addr_infos[0][4][0]
+ port: int = addr_infos[0][4][1]
+ except IndexError as e: # pragma: no cover
+ raise ValueError('Invalid arg: `addr_infos`') from e
+
+ ssl: Optional[SSLContext] = kwargs.get('ssl') # type: ignore
+
+ return await self._connect_via_proxy(
+ host=host,
+ port=port,
+ ssl=ssl,
+ timeout=timeout.sock_connect,
+ )
+
+ async def _connect_via_proxy(
+ self,
+ host: str,
+ port: int,
+ ssl: Optional[SSLContext] = None,
+ timeout: Optional[float] = None,
+ ) -> Tuple[asyncio.Transport, ResponseHandler]:
+ raise NotImplementedError
+
+
+class ProxyConnector(_BaseProxyConnector):
+ def __init__(
+ self,
+ host: str,
+ port: int,
+ proxy_type: ProxyType = ProxyType.SOCKS5,
+ username: Optional[str] = None,
+ password: Optional[str] = None,
+ rdns: Optional[bool] = None,
+ proxy_ssl: Optional[SSLContext] = None,
+ **kwargs: Any,
+ ) -> None:
kwargs['resolver'] = NoResolver()
super().__init__(**kwargs)
@@ -64,7 +103,13 @@
self._rdns = rdns
self._proxy_ssl = proxy_ssl
- async def _connect_via_proxy(self, host, port, ssl=None, timeout=None):
+ async def _connect_via_proxy(
+ self,
+ host: str,
+ port: int,
+ ssl: Optional[SSLContext] = None,
+ timeout: Optional[float] = None,
+ ) -> Tuple[asyncio.Transport, ResponseHandler]:
proxy = Proxy(
proxy_type=self._proxy_type,
host=self._proxy_host,
@@ -82,7 +127,7 @@
timeout=timeout,
)
- transport: BaseTransport = stream.writer.transport
+ transport: asyncio.Transport = stream.writer.transport
protocol: ResponseHandler = _ResponseHandler(
loop=self._loop,
writer=stream.writer,
@@ -93,32 +138,8 @@
return transport, protocol
- async def _wrap_create_connection(
- self,
- *args,
- addr_infos,
- req,
- timeout,
- client_error=ClientConnectorError,
- **kwargs,
- ):
- try:
- host = addr_infos[0][4][0]
- port = addr_infos[0][4][1]
- except IndexError: # pragma: no cover
- raise ValueError('Invalid arg: `addr_infos`')
-
- ssl = kwargs.get('ssl')
-
- return await self._connect_via_proxy(
- host=host,
- port=port,
- ssl=ssl,
- timeout=timeout.sock_connect,
- )
-
@classmethod
- def from_url(cls, url, **kwargs):
+ def from_url(cls, url: str, **kwargs: Any) -> 'ProxyConnector':
proxy_type, host, port, username, password = parse_proxy_url(url)
return cls(
proxy_type=proxy_type,
@@ -130,23 +151,29 @@
)
-class ProxyInfo(typing.NamedTuple):
+class ProxyInfo(NamedTuple):
proxy_type: ProxyType
host: str
port: int
- username: typing.Optional[str] = None
- password: typing.Optional[str] = None
- rdns: typing.Optional[bool] = None
+ username: Optional[str] = None
+ password: Optional[str] = None
+ rdns: Optional[bool] = None
-class ChainProxyConnector(TCPConnector):
+class ChainProxyConnector(_BaseProxyConnector):
def __init__(self, proxy_infos: Iterable[ProxyInfo], **kwargs):
kwargs['resolver'] = NoResolver()
super().__init__(**kwargs)
self._proxy_infos = proxy_infos
- async def _connect_via_proxy(self, host, port, ssl=None, timeout=None):
+ async def _connect_via_proxy(
+ self,
+ host: str,
+ port: int,
+ ssl: Optional[SSLContext] = None,
+ timeout: Optional[float] = None,
+ ) -> Tuple[asyncio.Transport, ResponseHandler]:
forward = None
proxy = None
for info in self._proxy_infos:
@@ -161,6 +188,8 @@
)
forward = proxy
+ assert proxy is not None
+
stream = await proxy.connect(
dest_host=host,
dest_port=port,
@@ -168,7 +197,7 @@
timeout=timeout,
)
- transport: BaseTransport = stream.writer.transport
+ transport: asyncio.Transport = stream.writer.transport
protocol: ResponseHandler = _ResponseHandler(
loop=self._loop,
writer=stream.writer,
@@ -179,32 +208,8 @@
return transport, protocol
- async def _wrap_create_connection(
- self,
- *args,
- addr_infos,
- req,
- timeout,
- client_error=ClientConnectorError,
- **kwargs,
- ):
- try:
- host = addr_infos[0][4][0]
- port = addr_infos[0][4][1]
- except IndexError: # pragma: no cover
- raise ValueError('Invalid arg: `addr_infos`')
-
- ssl = kwargs.get('ssl')
-
- return await self._connect_via_proxy(
- host=host,
- port=port,
- ssl=ssl,
- timeout=timeout.sock_connect,
- )
-
@classmethod
- def from_urls(cls, urls: Iterable[str], **kwargs):
+ def from_urls(cls, urls: Iterable[str], **kwargs: Any) ->
'ChainProxyConnector':
infos = []
for url in urls:
proxy_type, host, port, username, password = parse_proxy_url(url)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aiohttp_socks-0.9.1/aiohttp_socks.egg-info/PKG-INFO
new/aiohttp_socks-0.10.1/aiohttp_socks.egg-info/PKG-INFO
--- old/aiohttp_socks-0.9.1/aiohttp_socks.egg-info/PKG-INFO 2024-11-20
14:49:16.000000000 +0100
+++ new/aiohttp_socks-0.10.1/aiohttp_socks.egg-info/PKG-INFO 2024-12-26
08:06:00.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: aiohttp_socks
-Version: 0.9.1
+Version: 0.10.1
Summary: Proxy connector for aiohttp
Author-email: Roman Snegirev <[email protected]>
License: Apache-2.0
@@ -46,7 +46,7 @@
## Requirements
- Python >= 3.8
- aiohttp >= 3.10.0
-- python-socks[asyncio] >= 1.0.1
+- python-socks[asyncio] >= 2.4.3
## Installation
```
@@ -71,7 +71,7 @@
# port=1080,
# username='user',
# password='password',
- # rdns=True
+ # rdns=True # default is True for socks5
# )
### proxy chaining (since ver 0.3.3)
@@ -85,25 +85,6 @@
return await response.text()
```
-#### aiohttp-socks also provides `open_connection` and `create_connection`
functions:
-
-```python
-from aiohttp_socks import open_connection
-
-async def fetch():
- reader, writer = await open_connection(
- proxy_url='socks5://user:[email protected]:1080',
- host='check-host.net',
- port=80
- )
- request = (b"GET /ip HTTP/1.1\r\n"
- b"Host: check-host.net\r\n"
- b"Connection: close\r\n\r\n")
-
- writer.write(request)
- return await reader.read(-1)
-```
-
## Why yet another SOCKS connector for aiohttp
Unlike [aiosocksy](https://github.com/romis2012/aiosocksy), aiohttp_socks has
only single point of integration with aiohttp.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/aiohttp_socks-0.9.1/aiohttp_socks.egg-info/SOURCES.txt
new/aiohttp_socks-0.10.1/aiohttp_socks.egg-info/SOURCES.txt
--- old/aiohttp_socks-0.9.1/aiohttp_socks.egg-info/SOURCES.txt 2024-11-20
14:49:16.000000000 +0100
+++ new/aiohttp_socks-0.10.1/aiohttp_socks.egg-info/SOURCES.txt 2024-12-26
08:06:00.000000000 +0100
@@ -5,6 +5,7 @@
aiohttp_socks/__init__.py
aiohttp_socks/_deprecated.py
aiohttp_socks/connector.py
+aiohttp_socks/py.typed
aiohttp_socks/utils.py
aiohttp_socks.egg-info/PKG-INFO
aiohttp_socks.egg-info/SOURCES.txt