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

Uploaded Source

Built Distributions

gevent-1.3.5-pp260-pypy_41-macosx_10_13_x86_64.whl (696.1 kB view details)

Uploaded PyPymacOS 10.13+ x86-64

gevent-1.3.5-pp259-pypy_41-win32.whl (671.4 kB view details)

Uploaded PyPyWindows x86

gevent-1.3.5-cp37-cp37m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

gevent-1.3.5-cp36-cp36m-manylinux1_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.6m

gevent-1.3.5-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.5-cp35-cp35m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

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

Uploaded CPython 3.5m

gevent-1.3.5-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.5-cp34-cp34m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4mWindows x86

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

Uploaded CPython 3.4m

gevent-1.3.5-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.5-cp27-cp27mu-manylinux1_x86_64.whl (4.2 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7mWindows x86

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

Uploaded CPython 2.7m

gevent-1.3.5-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.5.tar.gz.

File metadata

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

File hashes

Hashes for gevent-1.3.5.tar.gz
Algorithm Hash digest
SHA256 7f15861f3cc92f49663ca88c4774d26d8044783a65fbc28071a2bd1c7bf36ff0
MD5 413eb8e8b64fee1ea0f1bb1e52e9982f
BLAKE2b-256 e60afc345c6e6161f84484870dbcaa58e427c10bd9bdcd08a69bed3d6b398bf1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-pp260-pypy_41-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 425edae7557599f16bf428b84d58f5aa5623c7ed9c2c2ef4a915046799992069
MD5 b5f7c57ab8c2f2f9c9b4b0913df7a9f5
BLAKE2b-256 522d90f5745d4a8ddf18f5dd28dd33764b863588ebee135fe9331c4c93ff2b95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-pp259-pypy_41-win32.whl
Algorithm Hash digest
SHA256 298fff6b452e879ffd8de2cf17b453469bef4f34fecc1c3d2252358d01000d42
MD5 dc7de5ff0a129696d670060276bedbba
BLAKE2b-256 2462ac1bf8394b4df377c61cbc21695eb867e609c110fdc1229e4cfe2ecd2fa5

See more details on using hashes here.

File details

Details for the file gevent-1.3.5-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 5fcf30b6172c6ae4f89dbe6051971a71bb04080d0eda9a0c31862054346d1ddd
MD5 340b21336e8baee9001e81ac75188b87
BLAKE2b-256 1cf64e586d562ec1aa5ed8412c8254a8d25301180e0a970947d806329e6345c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 916457841e4f335ccd228ac274801f1773973d27be3c53ed3ee1209f7629950e
MD5 f3e5e32f112ca1783f56b32be50b5e72
BLAKE2b-256 31513ac1065fdd957c77fa488d1e97848f5d37b9b2fc8f0ed22b304801163eea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 201b14bb62f72073369f86f21f824bfc079477b864590d43574d625266d358ec
MD5 21d0de484713a1a919cbfcc0dd83c855
BLAKE2b-256 337316b9b2d2f8d51c65ae5b61378b764755086395f290d5de574d2ace773055

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e2e3a6a2a147330d24e6e2b2f144c196841a707a41ee61253565d400ed7df62f
MD5 a3c3d29e4d8e8b8e09cef09ba991a801
BLAKE2b-256 b62b6be042be1023df54889d9e2a90b167f6fea65445384fccfdfd988cc16239

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 bd34e943810df73d7bf346262dae09281d045edebd086205e9ff2db377bae060
MD5 17931c0aeedb93f8ea93ef2c3d803156
BLAKE2b-256 241e970a7c4690f86b120df25985ba2e99cd50c136f8e54204706acb75c717c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 a52f5cef4073d9e8d58c8c44d4795cbc2e298d374125745637d8f078f8970b6b
MD5 f43939850af28ab36b17591bafeddafd
BLAKE2b-256 a4f3fd016dc08e43395553e3741efcc2aba4798b44fe385691fde51b8e08a050

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 8bbf3f2ab60e39be4363923d2b5996bff65d4163fe560280b71bb8ca18df2055
MD5 871287c8865883052e2fdb0cce0ddcc9
BLAKE2b-256 5424d9666f5ac5214c29abf545ac991b765b94439a5df5e077f5e3d3a1a5d9d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 55fa0607b72710372d37b35e9af85755a0c8bd0e3e82d70970a349feb2b426f6
MD5 accaf75351648bb64a56482f1e700570
BLAKE2b-256 6cc355290480d3c992fbe563478e302fb0bf228ccca398174de6cca3dff9d11c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 d0a4d114890b6d619e81140550c45d3611588c00f2baa1d6af9362907687ca1d
MD5 cecf867495e36613642fcdf4f385c888
BLAKE2b-256 ba4a68cc27925a231aeb68eac95b8cd7a18e0f6a997b51ecdabd5f42c5b1b78b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 77abcc8a9e04d33325b79d2130e1faf32a02069e63131c184802bb79fb5711d1
MD5 130a5c484e3bcd6931365242375b9470
BLAKE2b-256 0127844a8606bb9fa121b7392300bac9ca6e3623219b1dd1aff1805a107708b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 82e0eb07ab596908295d49f27e84799bff73638e13699496048d13051c8421a1
MD5 d9c3d6ad6cb643abd8467473cea62afc
BLAKE2b-256 1c5521ea153f3eb7c23e12cf13cb6d9af9120ada96fa236cb5191eeeb3ed5af6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2e9c15461ead5714fa70fb0179927410fcaeb39125ead575472a45d13973de32
MD5 d6253082748b079fc53e54cb38a6cdda
BLAKE2b-256 4d73eea9e518f95e9ed23d6edacaa54e4c0fc595c43c98181cb0f2d5594c38b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 32a231c52a5e8c0a5e62ffa2d25f14cfa5fe6bc8856093f5babe3f1e32d471d3
MD5 e506513f27977040890aaa356434898d
BLAKE2b-256 8f543cdfee4fce9237aa20d3886ed98b2e8c758d73826625ab56003fb92e1e22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8a8bcb9bbf7af0527ef77d86fa094b647d0e8cd377c5e31c1ad1a3d456b4a10b
MD5 dc4cac6c8b317040111eb9fe0f035b59
BLAKE2b-256 34f70bdf6205d8ecbbfc1d2a4611a0b19e75ce00f622d0cb23852c4c15fb8ce5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 6eb85cce56bf530664f7661c4bf2fe5d9d4de231c1cd2860c7563c517a6f56dc
MD5 539c9da4b1c48643f1e88962ebfad142
BLAKE2b-256 f15461ae4d9e1078c52047fa625cf39c8197517baa45599174e5d3ed91105b8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 aa04c207f6abb5d34de148e08b4d461544e808534000c4e5429eda08aa1204d6
MD5 8bdc5033cc39cf208a7dd8942aeaa3ae
BLAKE2b-256 dc36746daf471141227d9ffe9f31d198a5d8456e2d3c25e8c83de9395e6f2e41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 856ed81267a802eeaf925d7bf1a676c721f90c162c05ae906ab9c4646086c1a3
MD5 95e515059acddee5060c62b2ee801129
BLAKE2b-256 be96a72d0e8fe2379ac7a9ccf8b956a9b883f3ca1e38f731cf2682d862f00a66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.5-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a46b85bb42aeeab11f140587b8482d0f04d4b3db6f20f6668624bb0a822a28b0
MD5 dd4e447861ffdf93b554147f739d2f79
BLAKE2b-256 9279a2eae0ab0c715b73584d10d32918afd3edd5f4f4be16c53ec9c8e974bb8f

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