async-solipsism 0.7__tar.gz → 0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {async_solipsism-0.7 → async_solipsism-0.8}/.pre-commit-config.yaml +1 -1
  2. {async_solipsism-0.7 → async_solipsism-0.8}/PKG-INFO +9 -2
  3. {async_solipsism-0.7 → async_solipsism-0.8}/README.md +6 -0
  4. async_solipsism-0.8/pytest.ini +3 -0
  5. {async_solipsism-0.7 → async_solipsism-0.8}/requirements.txt +13 -16
  6. {async_solipsism-0.7 → async_solipsism-0.8}/src/async_solipsism/__init__.py +2 -2
  7. {async_solipsism-0.7 → async_solipsism-0.8}/src/async_solipsism/loop.py +5 -3
  8. {async_solipsism-0.7 → async_solipsism-0.8}/src/async_solipsism/socket.py +12 -1
  9. {async_solipsism-0.7 → async_solipsism-0.8}/src/async_solipsism.egg-info/PKG-INFO +9 -2
  10. {async_solipsism-0.7 → async_solipsism-0.8}/src/async_solipsism.egg-info/SOURCES.txt +0 -1
  11. async_solipsism-0.7/pytest.ini +0 -2
  12. async_solipsism-0.7/requirements.in +0 -4
  13. {async_solipsism-0.7 → async_solipsism-0.8}/.flake8 +0 -0
  14. {async_solipsism-0.7 → async_solipsism-0.8}/.github/workflows/test.yml +0 -0
  15. {async_solipsism-0.7 → async_solipsism-0.8}/.gitignore +0 -0
  16. {async_solipsism-0.7 → async_solipsism-0.8}/LICENSE +0 -0
  17. {async_solipsism-0.7 → async_solipsism-0.8}/pyproject.toml +0 -0
  18. {async_solipsism-0.7 → async_solipsism-0.8}/setup.cfg +0 -0
  19. {async_solipsism-0.7 → async_solipsism-0.8}/setup.py +0 -0
  20. {async_solipsism-0.7 → async_solipsism-0.8}/src/async_solipsism/clock.py +0 -0
  21. {async_solipsism-0.7 → async_solipsism-0.8}/src/async_solipsism/exceptions.py +0 -0
  22. {async_solipsism-0.7 → async_solipsism-0.8}/src/async_solipsism/selector.py +0 -0
  23. {async_solipsism-0.7 → async_solipsism-0.8}/src/async_solipsism.egg-info/dependency_links.txt +0 -0
  24. {async_solipsism-0.7 → async_solipsism-0.8}/src/async_solipsism.egg-info/requires.txt +0 -0
  25. {async_solipsism-0.7 → async_solipsism-0.8}/src/async_solipsism.egg-info/top_level.txt +0 -0
  26. {async_solipsism-0.7 → async_solipsism-0.8}/test/test_loop.py +0 -0
  27. {async_solipsism-0.7 → async_solipsism-0.8}/test/test_socket.py +0 -0
@@ -1,6 +1,6 @@
1
1
  repos:
2
2
  - repo: https://github.com/pycqa/flake8
3
- rev: "7.0.0"
3
+ rev: "7.1.1"
4
4
  hooks:
5
5
  - id: flake8
6
6
  - repo: https://github.com/jazzband/pip-tools
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: async-solipsism
3
- Version: 0.7
3
+ Version: 0.8
4
4
  Summary: Asyncio event loop that doesn't interact with the outside world
5
5
  Author-email: Bruce Merry <bmerry@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/bmerry/async-solipsism
@@ -16,6 +16,7 @@ Requires-Dist: pre-commit; extra == "test"
16
16
  Requires-Dist: pytest; extra == "test"
17
17
  Requires-Dist: pytest-asyncio>=0.23; extra == "test"
18
18
  Requires-Dist: pytest-mock; extra == "test"
19
+ Dynamic: license-file
19
20
 
20
21
  # A solipsist event loop
21
22
 
@@ -206,6 +207,12 @@ Calling functions that are not supported will generally raise
206
207
 
207
208
  ## Changelog
208
209
 
210
+ ### 0.8
211
+
212
+ - Support `socket.sendmsg`.
213
+ - Support `socket.getpeername` for listening sockets (raises OSError).
214
+ - Make `EventLoop.time` work even after the event loop is closed.
215
+
209
216
  ### 0.7
210
217
 
211
218
  - Add a replacement function for `aiohappyeyeballs.start_connection`.
@@ -187,6 +187,12 @@ Calling functions that are not supported will generally raise
187
187
 
188
188
  ## Changelog
189
189
 
190
+ ### 0.8
191
+
192
+ - Support `socket.sendmsg`.
193
+ - Support `socket.getpeername` for listening sockets (raises OSError).
194
+ - Make `EventLoop.time` work even after the event loop is closed.
195
+
190
196
  ### 0.7
191
197
 
192
198
  - Add a replacement function for `aiohappyeyeballs.start_connection`.
@@ -0,0 +1,3 @@
1
+ [pytest]
2
+ asyncio_default_fixture_loop_scope=function
3
+ asyncio_mode=auto
@@ -6,41 +6,38 @@
6
6
  #
7
7
  cfgv==3.4.0
8
8
  # via pre-commit
9
- distlib==0.3.8
9
+ distlib==0.3.9
10
10
  # via virtualenv
11
- exceptiongroup==1.2.0
11
+ exceptiongroup==1.2.2
12
12
  # via pytest
13
- filelock==3.13.1
13
+ filelock==3.16.1
14
14
  # via virtualenv
15
- identify==2.5.35
15
+ identify==2.6.1
16
16
  # via pre-commit
17
17
  iniconfig==2.0.0
18
18
  # via pytest
19
- nodeenv==1.8.0
19
+ nodeenv==1.9.1
20
20
  # via pre-commit
21
- packaging==24.0
21
+ packaging==24.2
22
22
  # via pytest
23
- platformdirs==4.2.0
23
+ platformdirs==4.3.6
24
24
  # via virtualenv
25
- pluggy==1.4.0
25
+ pluggy==1.5.0
26
26
  # via pytest
27
27
  pre-commit==3.5.0
28
28
  # via async-solipsism (pyproject.toml)
29
- pytest==8.1.1
29
+ pytest==8.3.4
30
30
  # via
31
31
  # async-solipsism (pyproject.toml)
32
32
  # pytest-asyncio
33
33
  # pytest-mock
34
- pytest-asyncio==0.23.6
34
+ pytest-asyncio==0.24.0
35
35
  # via async-solipsism (pyproject.toml)
36
36
  pytest-mock==3.14.0
37
37
  # via async-solipsism (pyproject.toml)
38
- pyyaml==6.0.1
38
+ pyyaml==6.0.2
39
39
  # via pre-commit
40
- tomli==2.0.1
40
+ tomli==2.2.1
41
41
  # via pytest
42
- virtualenv==20.25.1
42
+ virtualenv==20.29.0
43
43
  # via pre-commit
44
-
45
- # The following packages are considered to be unsafe in a requirements file:
46
- # setuptools
@@ -1,4 +1,4 @@
1
- # Copyright 2020-2022, 2024 Bruce Merry
1
+ # Copyright 2020-2022, 2024-2025 Bruce Merry
2
2
  #
3
3
  # This file is part of async-solipsism.
4
4
  #
@@ -19,4 +19,4 @@ from .exceptions import * # noqa
19
19
  from .socket import * # noqa
20
20
  from .loop import * # noqa
21
21
 
22
- __version__ = '0.7'
22
+ __version__ = '0.8'
@@ -1,4 +1,4 @@
1
- # Copyright 2020, 2022, 2024 Bruce Merry
1
+ # Copyright 2020, 2022, 2024-2025 Bruce Merry
2
2
  #
3
3
  # This file is part of async-solipsism.
4
4
  #
@@ -30,14 +30,16 @@ __all__ = ('EventLoop', 'EventLoopPolicy', 'aiohappyeyeballs_start_connection',
30
30
  class EventLoop(asyncio.selector_events.BaseSelectorEventLoop):
31
31
  def __init__(self):
32
32
  super().__init__(selector=selector.Selector())
33
- self._selector = selector.Selector()
34
33
  self._clock_resolution = self._selector.clock.resolution
35
34
  # Map from (host, port) pair to ListenSocket
36
35
  self.__listening_sockets = {}
37
36
  self.__next_port = 1
37
+ # Copy this so that time() works even when after the event loop is
38
+ # closed (which clears _selector).
39
+ self.__clock = self._selector.clock
38
40
 
39
41
  def time(self):
40
- return self._selector.clock.time()
42
+ return self.__clock.time()
41
43
 
42
44
  def call_soon_threadsafe(self, callback, *args, context=None):
43
45
  if self._thread_id == threading.get_ident():
@@ -1,4 +1,4 @@
1
- # Copyright 2020, 2024 Bruce Merry
1
+ # Copyright 2020, 2024-2025 Bruce Merry
2
2
  #
3
3
  # This file is part of async-solipsism.
4
4
  #
@@ -188,6 +188,14 @@ class Socket(_SocketBase):
188
188
  self._check_closed()
189
189
  return self._write_queue.write(bytes)
190
190
 
191
+ def sendmsg(self, buffers, ancdata=None, flags=0, address=None, /):
192
+ self._check_closed()
193
+ if ancdata is not None:
194
+ raise SolipsismError('ancilliary data is not supported in sendmsg')
195
+ if address is not None:
196
+ raise SolipsismError('address is not supported in sendmsg')
197
+ return self._write_queue.write(b"".join(buffers))
198
+
191
199
  def read_ready(self):
192
200
  return self._read_queue is None or self._read_queue.read_ready()
193
201
 
@@ -217,6 +225,9 @@ class ListenSocket(_SocketBase):
217
225
  def getsockname(self):
218
226
  return self._sockname
219
227
 
228
+ def getpeername(self):
229
+ raise OSError(errno.ENOTCONN, "Transport endpoint is not connected")
230
+
220
231
  def listen(self, backlog=None):
221
232
  pass
222
233
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: async-solipsism
3
- Version: 0.7
3
+ Version: 0.8
4
4
  Summary: Asyncio event loop that doesn't interact with the outside world
5
5
  Author-email: Bruce Merry <bmerry@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/bmerry/async-solipsism
@@ -16,6 +16,7 @@ Requires-Dist: pre-commit; extra == "test"
16
16
  Requires-Dist: pytest; extra == "test"
17
17
  Requires-Dist: pytest-asyncio>=0.23; extra == "test"
18
18
  Requires-Dist: pytest-mock; extra == "test"
19
+ Dynamic: license-file
19
20
 
20
21
  # A solipsist event loop
21
22
 
@@ -206,6 +207,12 @@ Calling functions that are not supported will generally raise
206
207
 
207
208
  ## Changelog
208
209
 
210
+ ### 0.8
211
+
212
+ - Support `socket.sendmsg`.
213
+ - Support `socket.getpeername` for listening sockets (raises OSError).
214
+ - Make `EventLoop.time` work even after the event loop is closed.
215
+
209
216
  ### 0.7
210
217
 
211
218
  - Add a replacement function for `aiohappyeyeballs.start_connection`.
@@ -5,7 +5,6 @@ LICENSE
5
5
  README.md
6
6
  pyproject.toml
7
7
  pytest.ini
8
- requirements.in
9
8
  requirements.txt
10
9
  setup.py
11
10
  .github/workflows/test.yml
@@ -1,2 +0,0 @@
1
- [pytest]
2
- asyncio_mode=auto
@@ -1,4 +0,0 @@
1
- pre-commit
2
- pytest
3
- pytest-asyncio>=0.23
4
- pytest-mock
File without changes
File without changes
File without changes
File without changes
File without changes