DESCRIPTION.rst 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. ========
  2. gevent
  3. ========
  4. gevent_ is a coroutine-based Python networking library.
  5. Features include:
  6. * Fast event loop based on libev_.
  7. * Lightweight execution units based on greenlet_.
  8. * Familiar API that re-uses concepts from the Python standard library.
  9. * Cooperative sockets with SSL support.
  10. * DNS queries performed through c-ares_ or a threadpool.
  11. * Ability to use standard library and 3rd party modules written for standard blocking sockets
  12. gevent is `inspired by eventlet`_ but features more consistent API,
  13. simpler implementation and better performance. Read why others `use
  14. gevent`_ and check out the list of the `open source projects based on
  15. gevent`_.
  16. gevent is licensed under the MIT license.
  17. See `what's new`_ in the latest major release.
  18. Check out the detailed changelog_ for this version.
  19. Get gevent
  20. ==========
  21. gevent runs on Python >= 2.7, Python >= 3.4, or PyPy >= 5.5 (including
  22. PyPy2 and PyPy3) (*Note*: PyPy is not supported in Windows). On all
  23. platforms, installing setuptools is required (this is done
  24. automatically if working in a virtual environment).
  25. You can use pip to install gevent::
  26. pip install gevent
  27. .. tip:: You need Pip 8.0 or later to install the binary wheels.
  28. Download the latest release from `Python Package Index`_ or clone `the repository`_.
  29. Read the documentation online at http://www.gevent.org. Additional
  30. installation information can be found `here <http://www.gevent.org/intro.html#installation-and-requirements>`_.
  31. Post feedback and issues on the `bug tracker`_, `mailing list`_, blog_
  32. and `twitter (@gevent)`_.
  33. Development
  34. ===========
  35. To install the latest development version::
  36. pip install setuptools 'cython>=0.25' git+git://github.com/gevent/gevent.git#egg=gevent
  37. To hack on gevent (using a virtualenv)::
  38. $ git clone https://github.com/gevent/gevent.git
  39. $ cd gevent
  40. $ virtualenv env
  41. $ source env/bin/activate
  42. (env) $ pip install -r dev-requirements.txt
  43. .. note::
  44. You must have Cython, GNU Make, a C compiler, and the Python
  45. development headers installed to build a checkout. Installing CFFI
  46. on CPython (it's standard on PyPy) allows building the CFFI backend
  47. for testing, and tox is the command used to test multiple versions
  48. of Python.
  49. BSD based systems like FreeBSD and OpenBSD often have BSD Make on
  50. the PATH as the default ``make`` command, but building gevent from a
  51. source checkout (not a source tarball distributed on PyPI) requires
  52. GNU Make. GNU Make is often called ``gmake``. If you experience
  53. Makefile-related problems building gevent from source on one of
  54. these platforms, you can set the ``MAKE`` environment variable to
  55. the executable that invokes GNU Make. For example::
  56. $ MAKE=gmake python ./setup.py install
  57. Running Tests
  58. -------------
  59. There are a few different ways to run the tests. To simply run the
  60. tests on one version of Python during development, try this::
  61. python setup.py develop
  62. cd src/greentest
  63. PYTHONPATH=.. python testrunner.py --config known_failures.py
  64. Before submitting a pull request, it's a good idea to run the tests
  65. across all supported versions of Python, and to check the code quality
  66. using prospector. This is what is done on Travis CI. Locally it
  67. can be done using tox::
  68. pip install tox
  69. tox
  70. The testrunner accepts a ``--coverage`` argument to enable code
  71. coverage metrics through the `coverage.py`_ package. That would go
  72. something like this::
  73. cd src/greentest
  74. PYTHONPATH=.. python testrunner.py --config known_failures.py --coverage
  75. coverage combine
  76. coverage html -i
  77. <open htmlcov/index.html>
  78. Builds on Travis CI automatically submit updates to `coveralls.io`_ to
  79. monitor test coverage.
  80. .. image:: https://coveralls.io/repos/gevent/gevent/badge.svg?branch=master&service=github
  81. :target: https://coveralls.io/github/gevent/gevent?branch=master
  82. Likewise, builds on Travis CI will automatically submit updates to
  83. `landscape.io`_ to monitor code health (adherence to PEP8, absence of
  84. common code smells, etc).
  85. .. image:: https://landscape.io/github/gevent/gevent/master/landscape.svg?style=flat
  86. :target: https://landscape.io/github/gevent/gevent/master
  87. :alt: Code Health
  88. .. note:: On Debian, you will probably need ``libpythonX.Y-testsuite``
  89. installed to run all the tests.
  90. Continuous integration
  91. ----------------------
  92. A test suite is run for every push and pull request submitted. Travis
  93. CI is used to test on Linux, and `AppVeyor`_ runs the builds on
  94. Windows.
  95. .. image:: https://travis-ci.org/gevent/gevent.svg?branch=master
  96. :target: https://travis-ci.org/gevent/gevent
  97. .. image:: https://ci.appveyor.com/api/projects/status/q4kl21ng2yo2ixur?svg=true
  98. :target: https://ci.appveyor.com/project/denik/gevent
  99. .. _gevent: http://www.gevent.org
  100. .. _greenlet: http://pypi.python.org/pypi/greenlet
  101. .. _libev: http://libev.schmorp.de/
  102. .. _c-ares: http://c-ares.haxx.se/
  103. .. _inspired by eventlet: http://blog.gevent.org/2010/02/27/why-gevent/
  104. .. _use gevent: http://groups.google.com/group/gevent/browse_thread/thread/4de9703e5dca8271
  105. .. _open source projects based on gevent: https://github.com/gevent/gevent/wiki/Projects
  106. .. _Python Package Index: http://pypi.python.org/pypi/gevent
  107. .. _the repository: https://github.com/gevent/gevent
  108. .. _bug tracker: https://github.com/gevent/gevent/wiki/Projects
  109. .. _mailing list: http://groups.google.com/group/gevent
  110. .. _blog: http://blog.gevent.org
  111. .. _twitter (@gevent): http://twitter.com/gevent
  112. .. _coverage.py: https://pypi.python.org/pypi/coverage/
  113. .. _coveralls.io: https://coveralls.io/github/gevent/gevent
  114. .. _AppVeyor: https://ci.appveyor.com/project/denik/gevent
  115. .. _what's new: http://www.gevent.org/whatsnew_1_2.html
  116. .. _changelog: http://www.gevent.org/changelog.html
  117. .. _landscape.io: https://landscape.io/github/gevent/gevent