METADATA 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. Metadata-Version: 2.4
  2. Name: uvloop
  3. Version: 0.22.1
  4. Summary: Fast implementation of asyncio event loop on top of libuv
  5. Author-email: Yury Selivanov <yury@magic.io>
  6. License: MIT License
  7. Project-URL: github, https://github.com/MagicStack/uvloop
  8. Keywords: asyncio,networking
  9. Classifier: Development Status :: 5 - Production/Stable
  10. Classifier: Framework :: AsyncIO
  11. Classifier: Intended Audience :: Developers
  12. Classifier: License :: OSI Approved :: Apache Software License
  13. Classifier: License :: OSI Approved :: MIT License
  14. Classifier: Operating System :: POSIX
  15. Classifier: Operating System :: MacOS :: MacOS X
  16. Classifier: Programming Language :: Python :: 3 :: Only
  17. Classifier: Programming Language :: Python :: 3.8
  18. Classifier: Programming Language :: Python :: 3.9
  19. Classifier: Programming Language :: Python :: 3.10
  20. Classifier: Programming Language :: Python :: 3.11
  21. Classifier: Programming Language :: Python :: 3.12
  22. Classifier: Programming Language :: Python :: 3.13
  23. Classifier: Programming Language :: Python :: Implementation :: CPython
  24. Classifier: Topic :: System :: Networking
  25. Requires-Python: >=3.8.1
  26. Description-Content-Type: text/x-rst
  27. License-File: LICENSE-APACHE
  28. License-File: LICENSE-MIT
  29. Provides-Extra: test
  30. Requires-Dist: aiohttp>=3.10.5; extra == "test"
  31. Requires-Dist: flake8~=6.1; extra == "test"
  32. Requires-Dist: psutil; extra == "test"
  33. Requires-Dist: pycodestyle~=2.11.0; extra == "test"
  34. Requires-Dist: pyOpenSSL~=25.3.0; extra == "test"
  35. Requires-Dist: mypy>=0.800; extra == "test"
  36. Provides-Extra: dev
  37. Requires-Dist: setuptools>=60; extra == "dev"
  38. Requires-Dist: Cython~=3.0; extra == "dev"
  39. Provides-Extra: docs
  40. Requires-Dist: Sphinx~=4.1.2; extra == "docs"
  41. Requires-Dist: sphinxcontrib-asyncio~=0.3.0; extra == "docs"
  42. Requires-Dist: sphinx_rtd_theme~=0.5.2; extra == "docs"
  43. Dynamic: license-file
  44. .. image:: https://img.shields.io/github/actions/workflow/status/MagicStack/uvloop/tests.yml?branch=master
  45. :target: https://github.com/MagicStack/uvloop/actions/workflows/tests.yml?query=branch%3Amaster
  46. .. image:: https://img.shields.io/pypi/v/uvloop.svg
  47. :target: https://pypi.python.org/pypi/uvloop
  48. .. image:: https://pepy.tech/badge/uvloop
  49. :target: https://pepy.tech/project/uvloop
  50. :alt: PyPI - Downloads
  51. uvloop is a fast, drop-in replacement of the built-in asyncio
  52. event loop. uvloop is implemented in Cython and uses libuv
  53. under the hood.
  54. The project documentation can be found
  55. `here <http://uvloop.readthedocs.org/>`_. Please also check out the
  56. `wiki <https://github.com/MagicStack/uvloop/wiki>`_.
  57. Performance
  58. -----------
  59. uvloop makes asyncio 2-4x faster.
  60. .. image:: https://raw.githubusercontent.com/MagicStack/uvloop/master/performance.png
  61. :target: http://magic.io/blog/uvloop-blazing-fast-python-networking/
  62. The above chart shows the performance of an echo server with different
  63. message sizes. The *sockets* benchmark uses ``loop.sock_recv()`` and
  64. ``loop.sock_sendall()`` methods; the *streams* benchmark uses asyncio
  65. high-level streams, created by the ``asyncio.start_server()`` function;
  66. and the *protocol* benchmark uses ``loop.create_server()`` with a simple
  67. echo protocol. Read more about uvloop in a
  68. `blog post <http://magic.io/blog/uvloop-blazing-fast-python-networking/>`_
  69. about it.
  70. Installation
  71. ------------
  72. uvloop requires Python 3.8 or greater and is available on PyPI.
  73. Use pip to install it::
  74. $ pip install uvloop
  75. Note that it is highly recommended to **upgrade pip before** installing
  76. uvloop with::
  77. $ pip install -U pip
  78. Using uvloop
  79. ------------
  80. As of uvloop 0.18, the preferred way of using it is via the
  81. ``uvloop.run()`` helper function:
  82. .. code:: python
  83. import uvloop
  84. async def main():
  85. # Main entry-point.
  86. ...
  87. uvloop.run(main())
  88. ``uvloop.run()`` works by simply configuring ``asyncio.run()``
  89. to use uvloop, passing all of the arguments to it, such as ``debug``,
  90. e.g. ``uvloop.run(main(), debug=True)``.
  91. With Python 3.11 and earlier the following alternative
  92. snippet can be used:
  93. .. code:: python
  94. import asyncio
  95. import sys
  96. import uvloop
  97. async def main():
  98. # Main entry-point.
  99. ...
  100. if sys.version_info >= (3, 11):
  101. with asyncio.Runner(loop_factory=uvloop.new_event_loop) as runner:
  102. runner.run(main())
  103. else:
  104. uvloop.install()
  105. asyncio.run(main())
  106. Building From Source
  107. --------------------
  108. To build uvloop, you'll need Python 3.8 or greater:
  109. 1. Clone the repository:
  110. .. code::
  111. $ git clone --recursive git@github.com:MagicStack/uvloop.git
  112. $ cd uvloop
  113. 2. Create a virtual environment and activate it:
  114. .. code::
  115. $ python3 -m venv uvloop-dev
  116. $ source uvloop-dev/bin/activate
  117. 3. Install development dependencies:
  118. .. code::
  119. $ pip install -e .[dev]
  120. 4. Build and run tests:
  121. .. code::
  122. $ make
  123. $ make test
  124. License
  125. -------
  126. uvloop is dual-licensed under MIT and Apache 2.0 licenses.