Commit Graph

46 Commits

Author SHA1 Message Date
Victor Stinner 16ddef1ab5 GreenUnixSelectorLoop: pass explicitly the loop 2014-11-05 16:32:02 +01:00
Victor Stinner 671cdf2c1d runtests.py: skip Python 3.3 tests on Python 2
Skip test_tasks.py and test_asyncio_trollius.py on Python < 3.3.
2014-08-27 15:53:10 +02:00
Yury Selivanov 6f5ce9bbb8 Mark 0.6.0 version 2014-07-21 17:15:20 -04:00
Victor Stinner 727158b311 cleanup examples
* explicitly close the event loop at exit
* don't convert explicitly coroutines to tasks
2014-07-21 23:10:31 +02:00
Yury Selivanov 77539b0e0d travis: Test 2.7 with trollius 2014-07-21 17:04:53 -04:00
Victor Stinner 19e6c3d70a Add an loop parameter to yield_from() and task() 2014-07-21 22:59:13 +02:00
Yury Selivanov 90e77b6906 Merge pull request #9 from haypo/trollius2
Support Trollius
2014-07-21 16:37:57 -04:00
Victor Stinner 5ed6b443db Also use loop.create_task() with asyncio 2014-07-21 14:40:49 +02:00
Victor Stinner f2dcc50515 Run test_socket on asyncio and trollius 2014-07-21 14:40:49 +02:00
Victor Stinner 783b0a8526 Cleanup tests 2014-07-21 14:40:49 +02:00
Victor Stinner cbefa18887 Split test_tasks.py in two parts
* Add a new test_asyncio_trollius.py file to test asyncio and trollius
  interoperability
* Move task tests for trollius into test_tasks_trollius.py
* Remove unused "import socket" in test_socket.py
2014-07-21 13:50:57 +02:00
Victor Stinner 78abe7cc41 Fix test_task_yield_from_invalid()
The exact error message depends on the version of Trollius and Tulip, if
they have the new create_task() function.

The check may be removed later when Trollius and Tulip with
create_task() will be widely deployed.
2014-07-18 19:12:57 +02:00
Victor Stinner c0ec5da9fb Support Trollius
* Add GreenTrolliusTask, GreenTrolliusUnixSelectorLoop,
  GreenTrolliusEventLoopPolicy
* Use backported TestCase of Trollius on Python 2 to get assertRaises()
* Use exec() in test_tass.py because "yield from" raises a SyntaxError
  on Python 2
* New test_trollius.py testing the interoperability of Trollis and
  asyncio coroutines. greenio should support executing asyncio
  coroutines in a trollius event loop.
2014-07-16 09:56:59 +02:00
Yury Selivanov ae185e4ed4 travis: Add python 3.3 2014-07-15 14:28:45 -04:00
Yury Selivanov 9c3d3e6021 Add travis badge to README 2014-07-15 13:18:38 -04:00
Yury Selivanov 9868c780de Add travis.yml 2014-07-15 13:04:56 -04:00
Victor Stinner e19c570935 green.yield_from() now accepts coroutine objects 2014-07-15 12:48:22 -04:00
Victor Stinner 789e10a348 Patch to prepare Python 2 support with Trollius
- Exception class has no __traceback__ attribute on Python 2: use
  sys.exc_info() instead. I'm not sure that sys.exc_info() contains the
  right traceback. I'm also using sys.exc_info() in Trollius in
  Future.set_exception(), method usually called in an "except" block.
- "nonlocal" keyword is not supported in Python 2: use a mutable
  dictionary instead
- socket.socket.recv has no docstring on Python 2
- Python 2 doesn't support function annotation: drop the single
  annotation
- Port runtests.py to Python 2: the patch comes from Trollius
- Python 2 doesn't support "(self, *args, _from_sock=None, **kwargs)"
  function prototype: use "(self, *args, **kwargs)" and pop manually
  _from_sock from kwargs
- greenio.socket: add "from __future__ import absolute_import" to import
  the socket module of the standard library, not greenio/socket.py
2014-07-15 12:43:20 -04:00
Yury Selivanov 672a5f8e42 Reference AUTHORS in LICENSE 2014-07-15 12:29:14 -04:00
Yury Selivanov 895cec2081 Add @haypo to AUTHORS 2014-07-15 12:28:54 -04:00
Yury Selivanov 17d4d6f66f socket: Add some comments; a bit more obvious variable naming 2014-07-15 12:26:06 -04:00
Victor Stinner 1607065f4d Fix ResourceWarning: close sockets 2014-07-10 01:15:03 +02:00
Yury Selivanov 62446d3f6e Use default asyncio.SelectorEventLoop 2014-01-14 11:44:49 -05:00
Yury Selivanov e9333a807d Make setup.py ready for release on PyPI 2014-01-14 11:40:40 -05:00
Yury Selivanov 0c80f1fca6 Remove last traces of Tulup (now asyncio) 2014-01-14 11:26:12 -05:00
Yury Selivanov 238da774c1 Rename greentulip -> greenio 2014-01-14 11:23:20 -05:00
Yury Selivanov 15a9e38b1c Fix examples to work with asyncio 2014-01-14 11:20:46 -05:00
Yury Selivanov e9c4bc3b49 Fix unittests to work with asyncio 2014-01-14 11:19:41 -05:00
Yury Selivanov cb8604d450 Fix Task.current_task() related code 2014-01-14 11:18:39 -05:00
Yury Selivanov 23b8c51a20 Merge pull request #4 from haypo/trollius
With this second change, greentulip works on Python 2 (with Trollius) and Python 3 (with Trollius and Tulip)
2014-01-14 07:41:20 -08:00
Victor Stinner 16e227bac8 Changes to be compatible with Trollius 2014-01-14 14:54:58 +01:00
Victor Stinner 1f47b8314d Update to latest Tulip API 2014-01-14 14:54:21 +01:00
Yury Selivanov 04214f9b93 Add AUTHORS file 2013-07-24 11:59:28 -04:00
Nikolay Kim 76c9541373 some tests 2013-07-23 11:06:25 -07:00
Nikolay Kim bf4a25fd85 pep8-ify code 2013-07-23 10:15:57 -07:00
Nikolay Kim d0abe40dbf pymsql example 2013-06-12 17:02:06 -07:00
Nikolay Kim 8c74e2afff simple implementation for makefile() wb/rb modes 2013-06-12 17:01:47 -07:00
Nikolay Kim 0ed3fde595 deprecate run_once() 2013-06-12 16:52:48 -07:00
Yury Selivanov 5914cad75d greenlet: Document "yield_from" and "GreenTask._step" 2013-06-08 15:46:44 -04:00
Yury Selivanov e8b8cea305 socket: Add unit-tests, fixes, docs 2013-06-08 15:41:53 -04:00
Yury Selivanov 5b5bbe55e1 Add README 2013-06-08 15:23:00 -04:00
Yury Selivanov 2b9787cca6 yield_from: Ensure that the loop is under GreenEventLoopPolicy (or compatible) 2013-06-08 15:23:00 -04:00
Yury Selivanov 7a22e9e38e examples: Add py-postgresql non-blocking adapter
Demonstrates how easy it is to make existing codebase non-blocking
2013-06-08 15:22:58 -04:00
Yury Selivanov 2649a488a4 socket: Add 'send' method
For now 'send' behaves exactly like 'sendall', i.e. all data is sent
in one call.
2013-06-08 14:02:37 -04:00
Yury Selivanov f307c79d2c Add LICENSE file (Apache 2.0) 2013-06-08 14:02:25 -04:00
Yury Selivanov 399772447b greentulip -- greenlets + tulip
Checking in a first working code + unittests.  See examples for details.
2013-06-08 13:57:36 -04:00