METADATA 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. Metadata-Version: 2.4
  2. Name: uvloop
  3. Version: 0.23.0
  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; python_version < "3.9" and extra == "test"
  35. Requires-Dist: pyOpenSSL~=26.4.0; python_version >= "3.9" and extra == "test"
  36. Requires-Dist: mypy>=0.800; extra == "test"
  37. Provides-Extra: dev
  38. Requires-Dist: packaging>=20; extra == "dev"
  39. Requires-Dist: setuptools>=60; extra == "dev"
  40. Requires-Dist: Cython~=3.1; extra == "dev"
  41. Provides-Extra: docs
  42. Requires-Dist: Sphinx~=4.1.2; extra == "docs"
  43. Requires-Dist: sphinxcontrib-asyncio~=0.3.0; extra == "docs"
  44. Requires-Dist: sphinx_rtd_theme~=0.5.2; extra == "docs"
  45. Dynamic: license-file
  46. .. image:: https://img.shields.io/github/actions/workflow/status/MagicStack/uvloop/tests.yml?branch=master
  47. :target: https://github.com/MagicStack/uvloop/actions/workflows/tests.yml?query=branch%3Amaster
  48. .. image:: https://img.shields.io/pypi/v/uvloop.svg
  49. :target: https://pypi.python.org/pypi/uvloop
  50. .. image:: https://pepy.tech/badge/uvloop
  51. :target: https://pepy.tech/project/uvloop
  52. :alt: PyPI - Downloads
  53. uvloop is a fast, drop-in replacement of the built-in asyncio
  54. event loop. uvloop is implemented in Cython and uses libuv
  55. under the hood.
  56. The project documentation can be found
  57. `here <http://uvloop.readthedocs.org/>`_. Please also check out the
  58. `wiki <https://github.com/MagicStack/uvloop/wiki>`_.
  59. Performance
  60. -----------
  61. uvloop makes asyncio 2-4x faster.
  62. .. image:: https://raw.githubusercontent.com/MagicStack/uvloop/master/performance.png
  63. :target: http://magic.io/blog/uvloop-blazing-fast-python-networking/
  64. The above chart shows the performance of an echo server with different
  65. message sizes. The *sockets* benchmark uses ``loop.sock_recv()`` and
  66. ``loop.sock_sendall()`` methods; the *streams* benchmark uses asyncio
  67. high-level streams, created by the ``asyncio.start_server()`` function;
  68. and the *protocol* benchmark uses ``loop.create_server()`` with a simple
  69. echo protocol. Read more about uvloop in a
  70. `blog post <http://magic.io/blog/uvloop-blazing-fast-python-networking/>`_
  71. about it.
  72. Installation
  73. ------------
  74. uvloop requires Python 3.8 or greater and is available on PyPI.
  75. Use pip to install it::
  76. $ pip install uvloop
  77. Note that it is highly recommended to **upgrade pip before** installing
  78. uvloop with::
  79. $ pip install -U pip
  80. Using uvloop
  81. ------------
  82. As of uvloop 0.18, the preferred way of using it is via the
  83. ``uvloop.run()`` helper function:
  84. .. code:: python
  85. import uvloop
  86. async def main():
  87. # Main entry-point.
  88. ...
  89. uvloop.run(main())
  90. ``uvloop.run()`` works by simply configuring ``asyncio.run()``
  91. to use uvloop, passing all of the arguments to it, such as ``debug``,
  92. e.g. ``uvloop.run(main(), debug=True)``.
  93. With Python 3.11 and earlier the following alternative
  94. snippet can be used:
  95. .. code:: python
  96. import asyncio
  97. import sys
  98. import uvloop
  99. async def main():
  100. # Main entry-point.
  101. ...
  102. if sys.version_info >= (3, 11):
  103. with asyncio.Runner(loop_factory=uvloop.new_event_loop) as runner:
  104. runner.run(main())
  105. else:
  106. uvloop.install()
  107. asyncio.run(main())
  108. Building From Source
  109. --------------------
  110. To build uvloop, you'll need Python 3.8 or greater:
  111. 1. Clone the repository:
  112. .. code::
  113. $ git clone --recursive git@github.com:MagicStack/uvloop.git
  114. $ cd uvloop
  115. 2. Create a virtual environment and activate it:
  116. .. code::
  117. $ python3 -m venv uvloop-dev
  118. $ source uvloop-dev/bin/activate
  119. 3. Install development dependencies:
  120. .. code::
  121. $ pip install -e .[dev]
  122. 4. Build and run tests:
  123. .. code::
  124. $ make
  125. $ make test
  126. License
  127. -------
  128. uvloop is dual-licensed under MIT and Apache 2.0 licenses.