Skip to main content

Coroutine-based network library

Project description

gevent

https://travis-ci.org/gevent/gevent.svg?branch=master https://ci.appveyor.com/api/projects/status/q4kl21ng2yo2ixur?svg=true https://coveralls.io/repos/gevent/gevent/badge.svg?branch=master&service=github

gevent is a coroutine -based Python networking library that uses greenlet to provide a high-level synchronous API on top of the libev or libuv event loop.

Features include:

gevent is inspired by eventlet but features a more consistent API, simpler implementation and better performance. Read why others use gevent and check out the list of the open source projects based on gevent.

gevent was written by Denis Bilenko.

Since version 1.1, gevent is maintained by Jason Madden for NextThought with help from the contributors and is licensed under the MIT license.

See what’s new in the latest major release.

Check out the detailed changelog for this version.

Read the documentation online at http://www.gevent.org.

Post feedback and issues on the bug tracker, mailing list, blog and twitter (@gevent).

Installation and Requirements

Supported Platforms

gevent 1.3 runs on Python 2.7 and Python 3. Releases 3.4, 3.5 and 3.6 of Python 3 are supported. (Users of older versions of Python 2 need to install gevent 1.0.x (2.5), 1.1.x (2.6) or 1.2.x (<=2.7.8); gevent 1.2 can be installed on Python 3.3.) gevent requires the greenlet library and will install the cffi library by default on Windows.

gevent 1.3 also runs on PyPy 5.5 and above, although 5.9 or above is strongly recommended. On PyPy, there are no external dependencies.

gevent is tested on Windows, OS X, and Linux, and should run on most other Unix-like operating systems (e.g., FreeBSD, Solaris, etc.)

Installation

gevent and greenlet can both be installed with pip, e.g., pip install gevent. Installation using buildout is also supported.

On Windows, OS X, and Linux, both gevent and greenlet are distributed as binary wheels.

Installing From Source

If you are unable to use the binary wheels (for platforms where no pre-built wheels are available or if wheel installation is disabled, e.g., for libuv support on Linux), here are some things you need to know.

  • You can install gevent from source with pip install --no-binary gevent gevent.

  • You’ll need a working C compiler that can build Python extensions. On some platforms, you may need to install Python development packages.

  • Installing from source requires setuptools. This is installed automatically in virtual environments and by buildout. However, gevent uses PEP 496 environment markers in setup.py. Consequently, you’ll need a version of setuptools newer than 25 (mid 2016) to install gevent from source; a version that’s too old will produce a ValueError. Older versions of pipenv may also have issues installing gevent for this reason.

  • To build the libuv backend (which is required on Windows and optional elsewhere), or the CFFI-based libev backend, you must install cffi before attempting to install gevent on CPython (on PyPy this step is not necessary).

Common Installation Issues

The following are some common installation problems and solutions for those compiling gevent from source.

  • Some Linux distributions are now mounting their temporary directories with the noexec option. This can cause a standard pip install gevent to fail with an error like cannot run C compiled programs. One fix is to mount the temporary directory without that option. Another may be to use the --build option to pip install to specify another directory. See issue #570 and issue #612 for examples.

  • Also check for conflicts with environment variables like CFLAGS. For example, see Library Updates.

  • Users of a recent SmartOS release may need to customize the CPPFLAGS (the environment variable containing the default options for the C preprocessor) if they are using the libev shipped with gevent. See Operating Systems for more information.

  • If you see ValueError: ("Expected ',' or end-of-list in", "cffi >= 1.11.5 ; sys_platform == 'win32' and platform_python_implementation == 'CPython'", 'at', " ; sys_platform == 'win32' and platform_python_implementation == 'CPython'"), the version of setuptools is too old. Install a more recent version of setuptools.

Extra Dependencies

gevent has no runtime dependencies outside the standard library, greenlet and (on some platforms) cffi. However, there are a number of additional libraries that extend gevent’s functionality and will be used if they are available.

The psutil library is needed to monitor memory usage.

zope.event is highly recommended for configurable event support; it can be installed with the events extra, e.g., pip install gevent[events].

dnspython is required for the new pure-Python resolver, and on Python 2, so is idna. They can be installed with the dnspython extra.

Development

To install the latest development version:

pip install setuptools cffi 'cython>=0.28' git+git://github.com/gevent/gevent.git#egg=gevent

To hack on gevent (using a virtualenv):

$ git clone https://github.com/gevent/gevent.git
$ cd gevent
$ virtualenv env
$ source env/bin/activate
(env) $ pip install -r dev-requirements.txt

Running Tests

There are a few different ways to run the tests. To simply run the tests on one version of Python during development, begin with the above instructions to install gevent in a virtual environment and then run:

(env) $ cd src/greentest
(env) $ python ./testrunner.py

Before submitting a pull request, it’s a good idea to run the tests across all supported versions of Python, and to check the code quality using prospector. This is what is done on Travis CI. Locally it can be done using tox:

pip install tox
tox

The testrunner accepts a --coverage argument to enable code coverage metrics through the coverage.py package. That would go something like this:

cd src/greentest
python testrunner.py --coverage
coverage combine
coverage html -i
<open htmlcov/index.html>

Continuous integration

A test suite is run for every push and pull request submitted. Travis CI is used to test on Linux, and AppVeyor runs the builds on Windows.

https://travis-ci.org/gevent/gevent.svg?branch=master https://ci.appveyor.com/api/projects/status/q4kl21ng2yo2ixur?svg=true

Builds on Travis CI automatically submit updates to coveralls.io to monitor test coverage.

https://coveralls.io/repos/gevent/gevent/badge.svg?branch=master&service=github

Project details


Release history Release notifications | RSS feed

This version

1.3.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gevent-1.3.3.tar.gz (4.6 MB view details)

Uploaded Source

Built Distributions

gevent-1.3.3-pp260-pypy_41-macosx_10_13_x86_64.whl (691.5 kB view details)

Uploaded PyPy macOS 10.13+ x86-64

gevent-1.3.3-pp259-pypy_41-win32.whl (666.5 kB view details)

Uploaded PyPy Windows x86

gevent-1.3.3-cp37-cp37m-macosx_10_9_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

gevent-1.3.3-cp36-cp36m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.6m Windows x86-64

gevent-1.3.3-cp36-cp36m-win32.whl (1.9 MB view details)

Uploaded CPython 3.6m Windows x86

gevent-1.3.3-cp36-cp36m-manylinux1_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.6m

gevent-1.3.3-cp36-cp36m-macosx_10_6_intel.whl (3.1 MB view details)

Uploaded CPython 3.6m macOS 10.6+ Intel (x86-64, i386)

gevent-1.3.3-cp35-cp35m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.5m Windows x86-64

gevent-1.3.3-cp35-cp35m-win32.whl (1.9 MB view details)

Uploaded CPython 3.5m Windows x86

gevent-1.3.3-cp35-cp35m-manylinux1_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.5m

gevent-1.3.3-cp35-cp35m-macosx_10_6_intel.whl (3.1 MB view details)

Uploaded CPython 3.5m macOS 10.6+ Intel (x86-64, i386)

gevent-1.3.3-cp34-cp34m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.4m Windows x86-64

gevent-1.3.3-cp34-cp34m-win32.whl (2.0 MB view details)

Uploaded CPython 3.4m Windows x86

gevent-1.3.3-cp34-cp34m-manylinux1_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.4m

gevent-1.3.3-cp34-cp34m-macosx_10_6_intel.whl (3.1 MB view details)

Uploaded CPython 3.4m macOS 10.6+ Intel (x86-64, i386)

gevent-1.3.3-cp27-cp27mu-manylinux1_x86_64.whl (4.2 MB view details)

Uploaded CPython 2.7mu

gevent-1.3.3-cp27-cp27m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 2.7m Windows x86-64

gevent-1.3.3-cp27-cp27m-win32.whl (2.0 MB view details)

Uploaded CPython 2.7m Windows x86

gevent-1.3.3-cp27-cp27m-manylinux1_x86_64.whl (4.2 MB view details)

Uploaded CPython 2.7m

gevent-1.3.3-cp27-cp27m-macosx_10_9_x86_64.whl (2.2 MB view details)

Uploaded CPython 2.7m macOS 10.9+ x86-64

File details

Details for the file gevent-1.3.3.tar.gz.

File metadata

  • Download URL: gevent-1.3.3.tar.gz
  • Upload date:
  • Size: 4.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gevent-1.3.3.tar.gz
Algorithm Hash digest
SHA256 59465c7bce7671834f58b44ef62cd8626f1557a0e7e3de44a3b596056f8adc73
MD5 161d8686970a2ef7c7ee84a7201dc437
BLAKE2b-256 48a309d1f3c650ae9ade2965ac71cbb61a7dd6fd0d3bd67ac12aa06bb23d3920

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-pp260-pypy_41-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-pp260-pypy_41-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 8957d025e3c361b56b268f35e59777013827848e166d8c0219e47d3b80e2f1ac
MD5 061b1a254fe920722f0465dbd6ef587b
BLAKE2b-256 c5b6e4e9cf22d671f566a49c90ffd43322fc414ec4ab21f75ccb344aa7581b2e

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-pp259-pypy_41-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-pp259-pypy_41-win32.whl
Algorithm Hash digest
SHA256 0bae07cfd8a5a027b8e8a94d74e875d10809f2cc05bde84f31fd1748e4d43657
MD5 f0dd09338a19e571f30bdd07fedcfdaf
BLAKE2b-256 debe57c30eab85395808ed7b78dccd732007b8ee9ef13978f55215573a21a93a

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 01ee9787d0a2182c0d56026d3923f73e6879835b1a85d4f996d00d09f1ecab20
MD5 d5b0bb0edcfb145c5b519dfd5b8f0d45
BLAKE2b-256 b8dc25ecf6c88e6038e4a69ac2f83351c265350e5414afdc1fc5f6e4cef77146

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 42b667080f7ab662d9c13d2e4d03289ee807d7926af9917685c844e481141563
MD5 4943b7e03b574b431a03f5bcff55bd4b
BLAKE2b-256 3ae3845a75c20d49652c44fdb78ac6aad6c6eba34ad53c0daa69eb8f7d4131d8

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 8c461a5897e520dd5ec4de725dae030d8c0ac74d07c704aa1fb3b6453315b865
MD5 902be1b133c50ccbb6f1e3121f995d01
BLAKE2b-256 a0fc79bc53242a3ff536be5ee08204583cc98d5ce948f158e20607d53f172efe

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 73e50dccb4a2787002867ea59f40f5e0a5080f841d003f7660794bde216187c9
MD5 c55488b743a8765f00641bf4ac44da54
BLAKE2b-256 3776ff2a894995c1cb2d3c8e8d6d661ef20caa2216b3e7db750ee8be967e724f

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp36-cp36m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 4b668ea8a3e9e348aec21cd43e6fab63c5b50f0c6d57fa8b4cfb6cf9c72953d1
MD5 30c92ea0658b3c6963a63f0023f0754e
BLAKE2b-256 49202a81aa8c986b3444cd99ac47ed7fa76efd386f5b644205f17f95caee4ee0

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 e66bac19c88faad0884da2e7b95ef90053927e552e3e50046145014d54dd9d01
MD5 528da51689f1e45c6caaaa95ed2806b3
BLAKE2b-256 f7fd88182a4e8639e29feecbf91cc982a480927bbfbd0ada064801b549b4de84

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 a9fa2de95f203982135aaa80979270df83a195a38a152103cd3723b185e407ff
MD5 f19a38299fb4c04b7519e4e69690b88e
BLAKE2b-256 03de6ff79357d001fe8e0de8b54d95d7a276c956bfc67ef104f92aabdf397aa4

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6a28d9e375df29200a5e0503f899a45b902cc0e40f4e4de1471773d87c43607a
MD5 51197820b7fed69dc37199369780a24c
BLAKE2b-256 9a809a4ae76fcf3c5974868a1edb76026d42a0a70c3f14dfe67de3859a5b7ca5

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 bb3bd3aaec9cc51f6fcbb2e7ac2063a1a0160159fe0fee5e978ebceef4ed35d2
MD5 0977e5cc61e5721c7db3c010b65db683
BLAKE2b-256 df9fddadfacd93b17265f12e3dae7425e8ea2ba36fbd4ed3dc2daccba0f731a0

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 5756aabe722e158eff7a34124163f4c4f3dff01d078d00365ca21b380381906d
MD5 3fb2402a7442743c32c16fc5c3f17191
BLAKE2b-256 740958f0b7f17838f114dfb25f930b5c3b2999b0526274d8d4fd0bade0bf2992

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 f04bbc9b64696775a2367b1d07c124d1ae1d1d70bdd4523db28f81de126d22e6
MD5 3e832e2574a9f0babe27eb4ee8059896
BLAKE2b-256 53df70bf859152a8fd1b2d913fb54ddde13f5b9c95dede3eae2054c5382fa96e

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cb2f2810a4a1de40cec38d18d3255eb6f4b0778ed3b4dcce03b0b7d462f1f8d4
MD5 fdcd05160bc5094344cc630c75a9c0ce
BLAKE2b-256 6c7a49f2307fd9ae18c7e30e35d03201f56803c530419fbf07cf3ff45f4f74dd

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp34-cp34m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 fd6fdfa71cf4a21d33c32df2b261b18aaf41128e6db29c1d27c5fa5e0a5459d5
MD5 a3b4e64d415de2226313ad6424bf6981
BLAKE2b-256 ea33dc46cc7f83b66265058eec09c5c5e13b30e3fb613b3563001a31b47f77ba

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 df7794dc0117215a236b7efe83850dbf6ff90c34c5d0b4da01843f89efabc3d4
MD5 4d7ac18c4375f32c3b3c0c83b1430618
BLAKE2b-256 5b33bf4ca60bc45cef724a03f7a04466f69240b794c0587446ce197911883443

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 ac0d572a48275495db9513d7bb5d41ccf4f820b7df4594e704fa5891de0d86c4
MD5 b4567135ce0cee12422d9c6196255b72
BLAKE2b-256 d6590575ff5f23085129ccdc16a774d60ae7a35a19cd4cd9d09393759931f4dc

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 795006da15d13227d811c09999d37acc92c43c27341a2c9ae96094135ad56908
MD5 7726f28b7ac5efe6484f27696340c054
BLAKE2b-256 dfb30021b585bd9f5597ae15a85c94dbe677fc14e2b1c29a7f9f8b9b3c67fa54

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ba94d6b3998fbb2828fb9d585e409ec46d958bafd7e3f185a14146c3615231d7
MD5 807d3bff118547fc65e762bc91668d4e
BLAKE2b-256 10ec25e714947224ac6b057d666fd15a2ab433916828a0da57728c6776fbb984

See more details on using hashes here.

File details

Details for the file gevent-1.3.3-cp27-cp27m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.3-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9bff994b9eb5fb2652af74dc8adb09914f3752db25381ccb2c75e2fa45e4f522
MD5 75c9c4bb1de250bd1c17d89185e1cf02
BLAKE2b-256 bba00d8d86faa1810eb136d0fea0af73d9e0ad640aef4ec309598ddd0a593ff7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page