Commit Graph

887 Commits

Author SHA1 Message Date
Fantix King c896e50858
Bump version to 0.15.3 2021-07-13 11:25:35 -04:00
Fantix King 6387a4e47a
Fix `call_soon_threadsafe` thread safety
Don't start the idle handler in other threads or signal handlers,
leaving the job to `_on_wake()`.

Co-authored-by: hexin02 <hexin02@megvii.com>
2021-07-13 11:15:11 -04:00
Fantix King 2e71c4c257
Fix a possible race condition in sslproto test
test_shutdown_timeout_handler_not_set() might have a race between the
SHUT_WR message and `eof` asyncio event. This fix changes to use the
eof_received() callback triggered by SHUT_WR. Refs #412 2nd issue.
2021-07-13 11:15:11 -04:00
Fantix King 0df12282c1
SSL: schedule first data after waiter wakeup
The waiter given to SSLProtocol should be woke up before the first
data callback, especially for `start_tls()` where the user protocol's
`connection_made()` won't be called and the waiter wakeup is the only
time the user have access to the new SSLTransport for the first time.
The user may want to e.g. check ALPN before handling the first data,
it's better that uvloop doesn't force the user to check this by
themselves.
2021-07-13 11:15:11 -04:00
Fantix King c9e07ddfd5
Bump version to 0.15.2 2021-02-18 20:38:22 -05:00
Thomas Grainger 235d7680ff
set python_requires 2021-02-18 20:35:51 -05:00
Fantix King f7634ef22a
Bump the version to 0.15.1 2021-02-15 12:00:44 -05:00
Fantix King f0b9e65c00
Fix ref issue when protocol is in Cython
Because `context.run()` doesn't hold reference to the callable, when
e.g. the protocol is written in Cython, the callbacks were not
guaranteed to hold the protocol reference. This PR fixes the issue by
explicitly add a reference before `context.run()` calls.

Refs edgedb/edgedb#2222
2021-02-15 11:58:49 -05:00
Fantix King 33c1d6a13b Fix the CI badge 2021-02-09 23:52:30 -06:00
Fantix King 513ff14277
Bump the version to 0.15.0 2021-02-09 23:50:23 -05:00
Fantix King e955017936 Remove `import tests` for testinstalled 2021-02-09 22:42:07 -06:00
Fantix King 20905374fc Workaround Github Action issue
Refs actions/runner#781, add LD_LIBRARY_PATH manually here for now
before an upstream fix is added.
2021-02-09 22:41:09 -06:00
Fantix King 6596685af6 Remove deprecated setup.py test 2021-02-09 14:29:27 -06:00
Bryan Forbes 9426e2b184
Add typings (#366)
* Add typings and mypy test case
* Update flake8
* Rename test class

Co-authored-by: Fantix King <fantix.king@gmail.com>
2021-02-09 13:11:20 -06:00
Fantix King fe3d02816d Fix future issue in sock_connect()
Use _SyncSocketWriterFuture for cancellation, so that we could remove
the writer directly in the callback.

Fixes #378
Closes #389
2021-02-09 10:28:58 -06:00
Fantix King 8cdb30022a Use FD=0/1/2 for subprocess(stdio=None)
This aligns uvloop with the same behavior in asyncio - when stdin,
stdout or stderr is None, the subprocess will use FD 0, 1 or 2 now
instead of sys.stdin, sys.stdout or sys.stderr.

Fixes #136
2021-02-09 09:45:14 -06:00
jack1142 8c471f827b
Don't stop the loop in `run_until_complete()` on `SystemExit` and `KeyboardInterrupt` exceptions (#337)
* Don't stop the loop in run_until_complete on SystemExit & KeyboardInterrupt
* Add unit test (based on CPython's equivalent)
* Fix the test to resume its coverage.

Co-authored-by: Victor Stinner <victor.stinner@gmail.com>
Co-authored-by: Fantix King <fantix.king@gmail.com>
2021-02-08 17:25:53 -06:00
Fantix King b7048b94a2 Fix examples for Python 3.10 2021-02-05 18:49:01 -06:00
Ophir LOJKINE 68db1a2321 Add a regression test for large stderr reading
Regression test for
https://github.com/MagicStack/uvloop/issues/363
2021-02-05 16:02:25 -06:00
Felix Yan fcb37350d1 Correct a typo in test_sourcecode.py 2021-02-05 15:07:22 -06:00
Fantix King f691212b26 Fix context in protocol callbacks (#348)
This is a combined fix to correct contexts from which protocal callbacks
are invoked. In short, callbacks like data_received() should always be
invoked from consistent contexts which are copied from the context where
the underlying UVHandle is created or started.

The new test case covers also asyncio, but skipping the failing ones.
2021-02-05 14:38:11 -06:00
Versus Void 7b202ccf64 Restore context on listen in UVStreamServer. Fix #305 2021-02-05 14:38:11 -06:00
Fantix King ae44ec2d9d Add tests for bpo-39951 2021-02-05 12:03:18 -06:00
Fantix King 98e113ee5b
Refactor SSL shutdown process (#385)
Co-authored-by: Yury Selivanov <yury@edgedb.com>
2021-02-05 09:27:08 -06:00
Fantix King cdd2218fa3
Drop Python 3.5/3.6 support (#383)
Fixes #381
2021-01-24 19:59:20 -06:00
Elvis Pranskevichus e21ceea0f0
Add release workflow (#376)
This is mostly a copy of asyncpg/release workflow
2021-01-20 18:01:14 -06:00
Fantix King 998c19ec7c Bump libuv to v1.40.0 2021-01-20 12:53:26 -06:00
Pavel Savchenko 3810530552 Use full path to performance.png
To make it visible in https://pypi.org/project/uvloop/
2020-12-15 10:54:40 -08:00
Fantix King 311997eda6 Switch to Github Actions 2020-12-06 19:43:25 -08:00
Fantix King afc3ee8fdc Skip failing test on asyncio 3.8
Fixes: #318.
2020-12-06 19:43:25 -08:00
Fantix King 200e140436 Fix tests for Python 3.9 2020-12-06 19:43:25 -08:00
Alexander Shadchin 1fd90665b2 Fix TypeError('cancel() takes exactly one argument (2 given)') with Python 3.9 2020-12-06 19:43:25 -08:00
Elvis Pranskevichus 3be8967eb4 Add github test workflow 2020-12-06 19:43:25 -08:00
Kyle Stanley 6ef69a797d Implement loop.shutdown_default_executor()
* Adds loop.shutdown_default_executor(), a new coroutine method added to
  asyncio in 3.9 for safe finalization of the event loop's ThreadPoolExecutor.
2020-07-10 14:29:11 -07:00
Fantix King 465717fdaf Skip for bpo-30064 until 3.8.2 2020-05-25 15:59:13 -05:00
Joongi Kim 0d14ec6452 fix: Accept path-like objects in subprocess arguments
* Also add subprocess test case using Path object

* uvloop already handles path-like cwd correctly, so I just
  copy-and-pasted the same logic to _init_args() method.

* The standard library uses "isinstance(obj, os.PathLike)" to check
  if an object is path-like, but os.PathLike exists as of Python 3.6.
  Since uvloop needs to support Python 3.5, we should use manual check
  for existence of the __fspath__ attribute.

* According to the official Python documentation:

  - https://docs.python.org/3/library/subprocess.html#subprocess.Popen
    The subprocess.Popen() constructor support path-like objects since
    Python 3.6 on POSIX and since Python 3.8 on Windows.

  - https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.subprocess_exec
    This page does not mention about path-like objects,
    but as of Python 3.8, it DOES support path-like objects.
2020-05-16 10:59:56 -07:00
Pierre Tardy c39297204a Add failing unit tests to reproduce issue #312
* closes #313
2020-05-13 20:06:44 -05:00
Fantix King 5d41af8079 forcely add UV_HANDLE_READABLE on pipe_t
* in order to detect peer close on O_WRONLY pipe_t
* partially reverted d8fe153
* refs libuv/libuv#2058
* refs #317
* fixes #311, fixes #312
2020-05-13 20:06:44 -05:00
Fantix King 506a2aa1eb apply bpo-37228
* refs python/cpython#17311
2020-05-13 13:52:17 -05:00
Fantix King 9e017e6ee9 Accept empty addr in UDP on_receive
* Fixes #304
2020-04-27 21:46:03 -05:00
Fantix King d51ce36785 Add name keyword argument to loop.create_task()
* Fixes #309.
* Refs bpo-34270.
2020-04-16 12:47:51 -05:00
Fantix King d99d7dcf46 skip for bpo-27500 2020-04-10 20:55:27 -05:00
Fantix King 1d9267afa8 Allow sendto the same addr if remote_addr is set
* Fixes #319.
2020-04-10 20:55:27 -05:00
Jeremy Lainé e8eb50269f Add .flake8 to distribution tarball (fixes: #330) 2020-04-09 08:29:24 +02:00
jack1142 2870219558
Stop using `loop` kwarg in `asyncio.wait()` call (DeprecationWarning) (#327) 2020-03-30 17:37:38 -07:00
Andrew Svetlov 9bc4a204ca Wakeup the waiter with exception if handshake fails 2020-03-24 13:11:31 -05:00
Fantix King f17ab4329e
fix Travis macOS build (#325) 2020-03-24 10:05:36 -05:00
YoSTEALTH 5dc299b788 updated cython version check 2020-02-19 23:36:00 -08:00
Yury Selivanov 35f82506d1
Bump the version to 0.15.0.dev0 2019-10-28 23:27:22 -04:00
Fantix King 8beacd2656 run `test_shutdown_timeout_handler_not_set` in aio 2019-10-28 22:53:47 -04:00