-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
setup.py
100 lines (83 loc) · 3.46 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
from setuptools import setup
import sys
exec(open("trio_asyncio/_version.py", encoding="utf-8").read())
LONG_DESC = """\
``trio-asyncio`` is a re-implementation of the ``asyncio`` mainloop on top of
Trio.
Rationale
=========
There are quite a few asyncio-compatible libraries.
On the other hand, Trio has native concepts of tasks and task cancellation.
Asyncio, on the other hand, is based on chaining Future objects, albeit
with nicer syntax.
Thus, being able to use asyncio libraries from Trio is useful.
Principle of operation
======================
The core of the "normal" asyncio main loop is the repeated execution of
synchronous code that's submitted to ``call_soon`` or
``add_reader``/``add_writer``.
Everything else within ``asyncio``, i.e. Futures and ``async``/``await``,
is just syntactic sugar. There is no concept of a task; while a Future can
be cancelled, that in itself doesn't affect the code responsible for
fulfilling it.
On the other hand, trio has genuine tasks with no separation between
returning a value asynchronously, and the code responsible for providing
that value.
``trio_asyncio`` implements a task which runs (its own version of) the
asyncio main loop. It also contains shim code which translates between these
concepts as transparently and correctly as possible, and it supplants a few
of the standard loop's key functions.
This works rather well: ``trio_asyncio`` consists of just ~700 lines of
code (asyncio: ~8000) but passes the complete Python 3.6 test suite with no
errors.
``trio_asyncio`` requires Python 3.8 or later.
Author
======
Matthias Urlichs <matthias@urlichs.de>
"""
setup(
name="trio_asyncio",
version=__version__, # noqa: F821
description="A re-implementation of the asyncio mainloop on top of Trio",
long_description=LONG_DESC,
author="Matthias Urlichs",
author_email="matthias@urlichs.de",
url="https://github.com/python-trio/trio-asyncio",
license="MIT -or- Apache License 2.0",
packages=["trio_asyncio"],
install_requires=[
"trio >= 0.22.0",
"outcome",
"sniffio >= 1.3.0",
"exceptiongroup >= 1.0.0; python_version < '3.11'",
"greenlet",
],
# This means, just install *everything* you see under trio/, even if it
# doesn't look like a source file, so long as it appears in MANIFEST.in:
include_package_data=True,
python_requires=">=3.8",
keywords=["async", "io", "trio", "asyncio", "trio-asyncio"],
setup_requires=["pytest-runner"],
tests_require=["pytest >= 5.4", "pytest-trio >= 0.6", "outcome"],
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: BSD",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: System :: Networking",
"Framework :: Trio",
"Framework :: AsyncIO",
],
)