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

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.4.tar.gz (4.6 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gevent-1.3.4-pp260-pypy_41-macosx_10_13_x86_64.whl (692.3 kB view details)

Uploaded PyPymacOS 10.13+ x86-64

gevent-1.3.4-pp259-pypy_41-win32.whl (667.4 kB view details)

Uploaded PyPyWindows x86

gevent-1.3.4-cp37-cp37m-manylinux1_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.7m

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

Uploaded CPython 3.7mmacOS 10.9+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6m

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

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

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

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

Uploaded CPython 3.5m

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

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

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4mWindows x86

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

Uploaded CPython 3.4m

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

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

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7mWindows x86

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

Uploaded CPython 2.7m

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

Uploaded CPython 2.7mmacOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for gevent-1.3.4.tar.gz
Algorithm Hash digest
SHA256 53c4dc705886d028f5d81e698b1d1479994a421498cd6529cb9711b5e2a84f74
MD5 97deaf53196ba430808e8f18b731112a
BLAKE2b-256 f885f92a8f43c9f15ffad49d743d929863a042ce3e8de5746c63bb4d6ce51a02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-pp260-pypy_41-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 8c41ef269bc743b5bb88a4553627cd4611be5c59589d5390e29956a8d3ab8623
MD5 6eef718f7dd0e678fa73c2b83101c05f
BLAKE2b-256 57d1cda71ce762ffd919009bcda46ca2d141eb5cacb993b7611bd86f8cd78444

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-pp259-pypy_41-win32.whl
Algorithm Hash digest
SHA256 d83370528327364354cfb54c96ca401853599bd7a15f382e6962fd8318cede50
MD5 9369cbd651c5151cb6e329df3a7143c7
BLAKE2b-256 7c001403bdedd52bf5cf97c6bbcb1a8e36597094a1e7d88fea41a99d082516f7

See more details on using hashes here.

File details

Details for the file gevent-1.3.4-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cf707886b9b45e56114c6f5522fc556058de5b5bf8674b609e82dfa2f9633c41
MD5 eeeebed308922b1fc32d335f8ed4b22b
BLAKE2b-256 7d59722687367ecfc4079486e902aa6b909f89423d9be478b6f1090f00915a05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e9d64081e419eb8a268edaa90bba95fb4c78a6278d2105dcc080b24b42679535
MD5 10cce1d01cbddf761e58b2ae4463d8f8
BLAKE2b-256 c6eda189c3a174108a394f48b6733aeef5f8cb1bc3b8849cd52d4153b222b66f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 1a0d422d6c960c36088201d4bbc925dfde87dc4a4e442bf2e4d36ae455f24a96
MD5 692b9da3d93195fbb46909a469d7a065
BLAKE2b-256 9674c82dd7c6b53a948afe3b214780fe73a9628c8416488184c9283ed6fb61f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 a51456f842f7de83fff473a0230e313e44ac6fa83e492412e696924f417088b8
MD5 58f2df2e63f0d5625e59b8ba96a58261
BLAKE2b-256 52e14292694130bd7a5d17a8196c939e409a132991e3b76aa253837621963514

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 00a45774ad6e7a8641af5db011807f53c1f0e0bc62cbdcab83e4db18e6201b6e
MD5 1955ba33d2945ac176d1d0818500d77c
BLAKE2b-256 ef7148aa308c1a92475e89afbd1a45d6978ac69b007169c761f048a5c9336f2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 3c9fbc0dac62e552dc5d03bb67ceaefc5f74d7b4ac04a4bf797cdb0a4438b1db
MD5 158b24a26e6d259b19c5d4ee8680e3e7
BLAKE2b-256 221aac5a7b62041ea20613e277570695d353807215cf5628a08352626fde5a1d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 15dbcc07cdd09f87b9814ee26483ec49e0d71fdc65d7a61b21c2c56bbb550168
MD5 6f514d21e653c998d1eb2339be0c4f84
BLAKE2b-256 67bbc1b76259dffc8feab5ecd119db0fb936517ad9e533ed785c5d37bff94f52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 57729118fbcf0f39ecf721ae9b318a4a738eb5d9b972af6c6c8c96303e30f011
MD5 7018257d47c3ca64a65ccbce768e9ea9
BLAKE2b-256 b37afb3fd5150aa5ec64554f964a5714624141f825abe17ab2a7414c4de69e17

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a1f32f0b01ceb15f93b2914b7057acb008c5173181813424621dc444f73c00e2
MD5 193095c0a4d359b7c8c37cfcc5fab43e
BLAKE2b-256 62c157862e630085073a13b573fca72086947f956feecb693bf8798738dc2ae1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 33320f60be19a865396a7f5e10c15b14e338790ae807c97c90edc990d644dc1c
MD5 a80d24301015c10a5969a44301825cb8
BLAKE2b-256 8cdb64700c23e1363a15568e96fca05376aa54870f4f4bde681604189c368c3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 c7e5f8a6bf865ef507db27f85376808991d3189df185864a5ee326d97e144ec4
MD5 180d82803da211c2ed5820201e37d9c5
BLAKE2b-256 67c7101c3dedf2770c6354ca47645c623700690f91d1b9f81c8d6c0e58ee500a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 72f7cab120e2af89d3a9d6c526e49da5c0b6c94d47e23ab7a26ae8471ee97ffb
MD5 bfd5936f426edb14f831e7dafa82ac2b
BLAKE2b-256 79898b091d3e17729611b563712059de19996ceb7bb2164d2e0bc4d1f8b8fd7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a72a23829ce8eb18086ec6f855715c3f52d3c1e12b83fd040d9fb854e77c0565
MD5 d8b7bb7517abd2c40da9ecafe665c379
BLAKE2b-256 a01382ebcd766b809e18fb6b3fd805f1771c7b7f58ae1b3d051367535153748a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 7bb0e1ef3adfea008688617fedb1741009856f98e26133983646203c718f7f39
MD5 7e98a112cfc3db0f3b4b1ff0115743bf
BLAKE2b-256 0ad6e6e792208ebb9e6e7f5b0edb88f14c205f4acee17bab4676322e8f20ff87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6c41413e1eb0b7bf77dcea42ff276e62903bfdc62cb936d71458d338b9edc9a6
MD5 057a93657dafaaa013f879d79c22c1ff
BLAKE2b-256 19a0abb5f5377da16c20d91c2db6d8d06fa99bc88fbbae8ecf6fb06313c9502f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 16143db7b760d9b512edfaf4d0bbef01cf0391e773362c43084901e3ecb892d5
MD5 5ec0a8fed4017225cd91111778d3049c
BLAKE2b-256 11e8fce5477ec39c5fd0a2255d0c6977f68673d3d1105d2ad1fa6326b093598e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 22187d0aba6506b57075dd05d0df495b04bfd4b047bbf776eeaac93117a6e9d2
MD5 3bde292d756171ed34695361eae8ab64
BLAKE2b-256 2c49182bcc2162a699c3e97ee41dfe22a39e6a1d74615d3db9ce23d9bb986022

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3498fec10e3695f3ad31253857c624435378c6a47969babb54a83ac0101615d3
MD5 5983d2a93878e7a2239ac995848e80c9
BLAKE2b-256 2452619622c7ef319dde82c0cd253d53a7ed62d471520e57838461253f202a1b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.4-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7ac5a4945fc47e3824d55bb50b6dd65823868e87fac841bea5762f79b9d22019
MD5 6f7cd812e302010ecd60aba2488795cb
BLAKE2b-256 fdaebc093872a500d991575fa7aba32e80f3de0ba0c7081d2095294ca0ec0581

See more details on using hashes here.

Supported by

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