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. 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.

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.2.post0.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.2.post0-pp260-pypy_41-macosx_10_13_x86_64.whl (691.1 kB view details)

Uploaded PyPymacOS 10.13+ x86-64

gevent-1.3.2.post0-pp259-pypy_41-win32.whl (666.1 kB view details)

Uploaded PyPyWindows x86

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

Uploaded CPython 3.7mmacOS 10.9+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4mWindows x86

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

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7mWindows x86

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

Uploaded CPython 2.7m

gevent-1.3.2.post0-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.2.post0.tar.gz.

File metadata

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

File hashes

Hashes for gevent-1.3.2.post0.tar.gz
Algorithm Hash digest
SHA256 5eeec334778cbad059b54fc468b0690db6794fe12a1dada7b70924d1c9ffbeac
MD5 7136a0272d66dbd8f804d010603005a1
BLAKE2b-256 a45b12d4fb2e48634b34537ae250e958de426811f876fbacb2a2041f2af147d8

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-pp260-pypy_41-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-pp260-pypy_41-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 a853c64e05dafdf9ff241c7bf62d711b16031a19fd5849d1e7474c6a0b7dbf6f
MD5 3b64377b8504e1a7d177059c05036bf4
BLAKE2b-256 c4c01883bde5aa45c20e650686fc7f498a0bfc6a9e38778e74de02c01200bda5

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-pp259-pypy_41-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-pp259-pypy_41-win32.whl
Algorithm Hash digest
SHA256 475373fefd8d6855b834a86ed57498c4f859591b62c59f990ab50021c7795c25
MD5 6059e700ccc879d13697fe45d939c557
BLAKE2b-256 939a0cdb016a11a633beea73c3195ab758c02750407b06cdae92c3902a1ebbd7

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 382b8646f5969d411a80acab4f7d7711a8d88e57b6ff5f798e25dcb0ab596f5e
MD5 866d75e573fe3c8e82e9ec8cfdcd57f3
BLAKE2b-256 2b9a57a1ef8c2f9ce406d2d2ceffda3cacc80eea64ade2b74159fbd988753c71

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 d3c7c49db608c86cd6d09ea6d581ce14a236d55169cc2d6bab94f14b5fe2f1c3
MD5 d8b31629d145aaaf2f8f26ff51c21b46
BLAKE2b-256 da236988d2cdcc8ff240a781bd35c2dc3abd03d38eae7ac782c26e3935680fec

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 15fc5c51a78b50330003741f5c54a77290e8929e3975ba6c3db68eb07fc2f563
MD5 7629d0fc46773f1cc1d7f4f6e965df2e
BLAKE2b-256 5fd73384c116ca8b68fc21336ec6fe30a34a2aeba552ee408a9cb7800617db5a

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 81247b662aa497f766c3ba09f8164220fa4fbb1e9e589b581eaa57a0a1d566d0
MD5 17f18daec1a38d44890952706fcf0f2b
BLAKE2b-256 378744d9da17f4ca38ae13fa8bf2854585cd1e9fcddb6e67023cc874ed162f3b

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp36-cp36m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 189fa61ef3951cf56292e1830c124850e3bb1ac43b071115645bd35b1a5dc211
MD5 e14cab5e1ec6689954bc94fa32dfd5aa
BLAKE2b-256 16df9593212da1a1ec942aef83dc8fb4b979ebab3bc995afc17d3782bcdc1264

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 8b5fb3ec430edb6850b87f0f94bd67c8292b639f273bd449ac10ed86abb2d9bd
MD5 ff6faba71834f399cfcadefc04fff856
BLAKE2b-256 cc40b9dcd27eb6e8291c4ab654bce8964e7ab566d10623fed42494235baef7e7

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 4229ba23b3d401720a56b950fd075afecbc2303109cf68158a98e76a674964f4
MD5 8cd0654498a6a401521af72f7d25b19c
BLAKE2b-256 8c13d6932d7689868bd39b32ecad2b05f08f567d6439f0844d7cf870b3911cc9

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d87a66f5ab6784096d66ba1eeaa9758cb1c243114c78915fb64ede73d7cd5ab4
MD5 cdbea946c79b4bd3b28e1eed35b72a5b
BLAKE2b-256 b8f1b6d0672cf23ce8969c601d7b337761ac9f37c48d2c87878877320403135d

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 48705fdfa6a7feb242c9c8aeb188e26cb7c037cba5099b91ad979f844131a3a2
MD5 08c496ed850121335b272569478e96fe
BLAKE2b-256 d27c545a78e6eda54392b0fcd87d3a22e5228a82916712e9fbd3695143e01a9d

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 d575a049468a90bd7a14944301e327ae8473746f6898e65ee186a79d5c77a621
MD5 b97818cea53dcd2a32beb061908e9767
BLAKE2b-256 2a7c055ac6e130e21becbae7bab490b76f385aa38bcfd25973031c48d46faa35

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 256aa2a24625a4442450760fe20ff69bb5b1cf76166860878f1d947df1bab5f1
MD5 7743d879e9ecb496476a40bae6ea2d40
BLAKE2b-256 fc3a9433fce145f7c18f73b2c6ae760fec25e16c5a83c910f4e2402b906a4d6d

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 03fe0f67ff90bbece0b1b606cc55eabc3b8db3d3461cd01266fcabc574c6a4dc
MD5 1ad123023b68ded6c7cac7fcd6e26b73
BLAKE2b-256 caf00b0c652e9f6cfeaa961677625b0072215093005396b4bcf5de340584610a

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp34-cp34m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 09773f14be61e784adbffdd892e564fdf879dbc486a906b2cc5053992152ec3c
MD5 42544db2a0111de7ef0489c2048893e7
BLAKE2b-256 b5f4e750b66562bdde6221f9b80885eebc914d515b92ffb4cea7626ecd896180

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6f1a5288397308a7459abadd67650fc659ab269e38c67dceefb28971284ad9e6
MD5 d8cd3d884145ba003ac409bb0a3c4a34
BLAKE2b-256 9b358159c09729919d46c56e94f6ef111c5448bfcb56273bf9ad7c68f667e695

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 4307d0c3de114501c975151d0c77a76ad8e08e364b378a10d8aa089bac805f6b
MD5 c335b9637facb5f96b4195e391ba1d01
BLAKE2b-256 615ff75b8a2d7657b5c7d2474c8b2ae8bebb8ce202d58f01bc2240d334e767d4

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 22edd02365fc8ff3cd69d76074ccddb458775c6d4b312f989715cd18576f2cf3
MD5 5c0c8d17fddc19f69a102defa080a514
BLAKE2b-256 7429279ff6e0b95bc8f926d3d8ff9a22596bf62a7d6b8ee6bf80cd220eb4de9a

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 588cad33325a6d19cfeef694b91734d329e4c82712266549805dc3adeedfa55c
MD5 77c61487310c8385b435f88d11792582
BLAKE2b-256 0b8b929bf9d245b884c9330d31849f0a9636d06ee6f6a4cf3e0b2e1218812da0

See more details on using hashes here.

File details

Details for the file gevent-1.3.2.post0-cp27-cp27m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2.post0-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c4fcd4aaee73f5ea2c13bac4304165fd9fd11e7dfde2ef4e8435fd30931aab69
MD5 7f2a902836b1348d2c00b54a3df3c47d
BLAKE2b-256 ebb265bbdea54333b97eb8f9225dfae65649a847503c1ebb7dc6875a62e13516

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