summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-05-20 15:47:13 +0200
committerVictor Stinner <victor.stinner@gmail.com>2014-05-20 15:47:13 +0200
commit5aec3b5a75394cc2215559c7d1ecef4ea6c9c6fb (patch)
treefa41fd6780ca2f37dbd0d8c9aaacd7d1ddd09ddd
parent4dfe02a3890b51f3c5476d1fa6ada2d0a4d2cf1e (diff)
downloadtrollius-5aec3b5a75394cc2215559c7d1ecef4ea6c9c6fb.tar.gz
Update documentation; set version to 0.3
-rw-r--r--doc/conf.py4
-rw-r--r--doc/index.rst35
-rw-r--r--setup.py6
3 files changed, 32 insertions, 13 deletions
diff --git a/doc/conf.py b/doc/conf.py
index cb64884..b2eef49 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -48,9 +48,7 @@ copyright = u'2014, Victor Stinner'
# built documents.
#
# The short X.Y version.
-version = '0.2.1'
-# The full version, including alpha/beta/rc tags.
-release = '0.2.1'
+version = release = '0.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/doc/index.rst b/doc/index.rst
index 2364076..b637022 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -34,16 +34,16 @@ Hello World
Print ``Hello World`` every two seconds, using a coroutine::
- import asyncio
- from asyncio import From
+ import trollius
+ from trolllius import From
- @asyncio.coroutine
+ @trollius.coroutine
def greet_every_two_seconds():
while True:
print('Hello World')
- yield From(asyncio.sleep(2))
+ yield From(trollius.sleep(2))
- loop = asyncio.get_event_loop()
+ loop = trollius.get_event_loop()
loop.run_until_complete(greet_every_two_seconds())
@@ -179,6 +179,8 @@ Tulip Trollius
Other differences
-----------------
+* The name of the Trollius module is "trollius", whereas Tulip module is called
+ "asyncio", as the asyncio builtin in Python 3.4 standard library.
* On Python 2.7, ``asyncio.SSLContext`` has less features than the
``ssl.SSLContext`` of Python 3.3: no options, verify_mode cannot be modified
(fixed to ``CERT_NONE``), no set_default_verify_paths() method, no SNI, etc.
@@ -226,6 +228,15 @@ Write code working on Trollius and Tulip
Trollius and Tulip are different, especially for coroutines (``yield
From(...)`` vs ``yield from``).
+To use asyncio on Python 2, add the following code at the top of your file::
+
+ try:
+ # Use Trollius on Python <= 3.2
+ import trollius as asyncio
+ except ImportError:
+ # Use Tulip on Python 3.3, or builtin asyncio on Python 3.4+
+ import asyncio
+
It is possible to write code working on both projects using only callbacks.
This option is used by the following projects which work on Trollius and Tulip:
@@ -319,8 +330,18 @@ grow in heavy, wet clay soils.
Change log
==========
-Version 0.2.1
--------------
+Version 0.3
+-----------
+
+Rename the Python module ``asyncio`` to "trollius`` to support Python 3.4.
+
+On Python 3.4, there is already a module called ``asyncio`` in the standard
+library which conflicts with Trollius ``asyncio`` (of Trollius 0.2). To write
+asyncio code working on Trollius and Tulip, use ``import trollius as asyncio``.
+
+Major changes:
+
+* Synchronize with Tulip 3.4.1.
Bugfixes:
diff --git a/setup.py b/setup.py
index 1e76562..a454619 100644
--- a/setup.py
+++ b/setup.py
@@ -30,7 +30,7 @@ with open("README") as fp:
extensions = []
if os.name == 'nt':
ext = Extension(
- 'asyncio._overlapped', ['overlapped.c'], libraries=['ws2_32'],
+ 'trollius._overlapped', ['overlapped.c'], libraries=['ws2_32'],
)
extensions.append(ext)
@@ -42,7 +42,7 @@ if sys.version_info < (3,):
install_options = {
"name": "trollius",
- "version": "0.2.1",
+ "version": "0.3",
"license": "Apache License 2.0",
"author": 'Victor Stinner',
"author_email": 'victor.stinner@gmail.com',
@@ -57,7 +57,7 @@ install_options = {
"License :: OSI Approved :: Apache Software License",
],
- "packages": ["asyncio"],
+ "packages": ["trollius"],
"ext_modules": extensions,
}