|
| 1 | +Metadata-Version: 2.4 |
| 2 | +Name: trio_asyncio |
| 3 | +Version: 0.15.0+dev |
| 4 | +Summary: A re-implementation of the asyncio mainloop on top of Trio |
| 5 | +Author-email: Matthias Urlichs <matthias@urlichs.de> |
| 6 | +License-Expression: MIT OR Apache-2.0 |
| 7 | +Project-URL: Homepage, https://github.com/python-trio/trio-asyncio |
| 8 | +Project-URL: Documentation, http://trio-asyncio.readthedocs.io |
| 9 | +Project-URL: Changelog, https://trio-asyncio.readthedocs.io/en/latest/history.html |
| 10 | +Keywords: async,io,trio,asyncio,trio-asyncio |
| 11 | +Classifier: Development Status :: 4 - Beta |
| 12 | +Classifier: Intended Audience :: Developers |
| 13 | +Classifier: Operating System :: POSIX :: Linux |
| 14 | +Classifier: Operating System :: MacOS :: MacOS X |
| 15 | +Classifier: Operating System :: POSIX :: BSD |
| 16 | +Classifier: Operating System :: Microsoft :: Windows |
| 17 | +Classifier: Programming Language :: Python :: Implementation :: CPython |
| 18 | +Classifier: Programming Language :: Python :: Implementation :: PyPy |
| 19 | +Classifier: Programming Language :: Python :: 3 :: Only |
| 20 | +Classifier: Programming Language :: Python :: 3.9 |
| 21 | +Classifier: Programming Language :: Python :: 3.10 |
| 22 | +Classifier: Programming Language :: Python :: 3.11 |
| 23 | +Classifier: Programming Language :: Python :: 3.12 |
| 24 | +Classifier: Programming Language :: Python :: 3.13 |
| 25 | +Classifier: Topic :: System :: Networking |
| 26 | +Classifier: Framework :: Trio |
| 27 | +Classifier: Framework :: AsyncIO |
| 28 | +Requires-Python: >=3.9 |
| 29 | +Description-Content-Type: text/x-rst |
| 30 | +License-File: LICENSE |
| 31 | +License-File: LICENSE.APACHE2 |
| 32 | +License-File: LICENSE.MIT |
| 33 | +Requires-Dist: trio>=0.22.0 |
| 34 | +Requires-Dist: outcome |
| 35 | +Requires-Dist: sniffio>=1.3.0 |
| 36 | +Requires-Dist: exceptiongroup>=1.0.0; python_version < "3.11" |
| 37 | +Requires-Dist: greenlet |
| 38 | +Provides-Extra: tests |
| 39 | +Requires-Dist: pytest>=5.4; extra == "tests" |
| 40 | +Requires-Dist: pytest-trio>=0.6; extra == "tests" |
| 41 | +Dynamic: license-file |
| 42 | + |
| 43 | +.. image:: https://img.shields.io/pypi/v/trio-asyncio.svg |
| 44 | + :target: https://pypi.org/project/trio-asyncio |
| 45 | + :alt: Latest PyPI version |
| 46 | + |
| 47 | +.. image:: https://img.shields.io/badge/chat-join%20now-blue.svg |
| 48 | + :target: https://gitter.im/python-trio/general |
| 49 | + :alt: Join chatroom |
| 50 | + |
| 51 | +.. image:: https://img.shields.io/badge/docs-read%20now-blue.svg |
| 52 | + :target: https://trio-asyncio.readthedocs.io/en/latest/?badge=latest |
| 53 | + :alt: Documentation status |
| 54 | + |
| 55 | +.. image:: https://github.com/python-trio/trio-asyncio/actions/workflows/ci.yml/badge.svg |
| 56 | + :target: https://github.com/python-trio/trio-asyncio/actions/workflows/ci.yml |
| 57 | + :alt: Automated test status |
| 58 | + |
| 59 | +.. image:: https://codecov.io/gh/python-trio/trio-asyncio/branch/master/graph/badge.svg |
| 60 | + :target: https://codecov.io/gh/python-trio/trio-asyncio |
| 61 | + :alt: Test coverage |
| 62 | + |
| 63 | + |
| 64 | +============== |
| 65 | + trio-asyncio |
| 66 | +============== |
| 67 | + |
| 68 | +**trio-asyncio** is a re-implementation of the ``asyncio`` mainloop on top of |
| 69 | +Trio. |
| 70 | + |
| 71 | +trio-asyncio requires at least Python 3.9. It is tested on recent versions of |
| 72 | +3.9 through 3.13. |
| 73 | + |
| 74 | ++++++++++++ |
| 75 | + Rationale |
| 76 | ++++++++++++ |
| 77 | + |
| 78 | +Trio has native concepts of tasks and task cancellation. Asyncio is based |
| 79 | +on callbacks and chaining Futures, albeit with nicer syntax, making |
| 80 | +handling failures and timeouts fundamentally less reliable, especially in |
| 81 | +larger programs. Thus, you *really* want to base your async project on Trio. |
| 82 | + |
| 83 | +On the other hand, there are quite a few asyncio-enhanced libraries. You |
| 84 | +*really* don't want to re-invent any wheels in your project. |
| 85 | + |
| 86 | +Thus, being able to use asyncio libraries from Trio is useful. |
| 87 | +trio-asyncio enables you to do that and more. |
| 88 | + |
| 89 | +-------------------------------------- |
| 90 | + Transparent vs. explicit translation |
| 91 | +-------------------------------------- |
| 92 | + |
| 93 | +``trio_asyncio`` does not try to magically allow calling ``await |
| 94 | +trio_code()`` from asyncio or vice versa. There are multiple reasons for |
| 95 | +this; the executive summary is that cross-domain calls can't be made to |
| 96 | +work correctly, and any such call is likely to result in an irrecoverable |
| 97 | +error. You need to keep your code's ``asyncio`` and ``trio`` domains |
| 98 | +rigidly separate. |
| 99 | + |
| 100 | +Fortunately, this is not difficult. |
| 101 | + |
| 102 | ++++++++ |
| 103 | + Usage |
| 104 | ++++++++ |
| 105 | + |
| 106 | +Trio-Asyncio's documentation is too large for a README. |
| 107 | + |
| 108 | +For further information, `see the manual on readthedocs <http://trio-asyncio.readthedocs.io/en/latest/>`_. |
| 109 | + |
| 110 | +++++++++++++++ |
| 111 | + Contributing |
| 112 | +++++++++++++++ |
| 113 | + |
| 114 | +Like Trio, trio-asyncio is licensed under both the MIT and Apache licenses. |
| 115 | +Submitting a patch or pull request implies your acceptance of these licenses. |
| 116 | + |
| 117 | +Testing is done with ``pytest``. Test coverage is pretty thorough; please |
| 118 | +keep it that way when adding new code. |
| 119 | + |
| 120 | +See the `Trio contributor guide |
| 121 | +<https://trio.readthedocs.io/en/stable/contributing.html>`__ for much |
| 122 | +more detail on how to get involved. |
| 123 | + |
| 124 | +Contributors are requested to follow our `code of conduct |
| 125 | +<https://trio.readthedocs.io/en/stable/code-of-conduct.html>`__ in all |
| 126 | +project spaces. |
| 127 | + |
| 128 | +++++++++ |
| 129 | + Author |
| 130 | +++++++++ |
| 131 | + |
| 132 | +Matthias Urlichs <matthias@urlichs.de> originally wrote trio-asyncio. |
| 133 | +It is now maintained by the `Trio project <https://github.com/python-trio>`_. |
0 commit comments