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.1.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.1-pp260-pypy_41-macosx_10_13_x86_64.whl (690.8 kB view details)

Uploaded PyPymacOS 10.13+ x86-64

gevent-1.3.1-pp259-pypy_41-win32.whl (665.9 kB view details)

Uploaded PyPyWindows x86

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

Uploaded CPython 3.7mmacOS 10.9+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

gevent-1.3.1-cp35-cp35m-manylinux1_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.5m

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4mWindows x86

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

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7mWindows x86

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

Uploaded CPython 2.7m

gevent-1.3.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for gevent-1.3.1.tar.gz
Algorithm Hash digest
SHA256 600d02a31c08936fe4a5181756009a4a3663403b41bc122df039dae0aa3e3831
MD5 7ff51d0803e5b5e08e69aa22e1a3e4c5
BLAKE2b-256 cfc6aa3ac939ec1028b7e0998c4ed88d9cd18782ca458e834f0faaad2823af3a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-pp260-pypy_41-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 0771afe671926e1a15656385c7bc50ce8696182f37fed4762eb2aeb4b9fe3e52
MD5 48ebaffb0ba9d842cc883ef0e4c5566f
BLAKE2b-256 1edd3fd24a4ad1577ead19d1c1546f96272ef3a500491945d2f5364e87bec0cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-pp259-pypy_41-win32.whl
Algorithm Hash digest
SHA256 a756c5483315c4166ea01a52e256ad05e9229b01f1f6aa6e88c50194fa29253b
MD5 4892f04aa777c049d55860f9e5cffed8
BLAKE2b-256 eb082ff05cdb577a9a6233dbdc4891600f62e97e5ba40b9c378874a42a8a95ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8b8b1337c701649f5701f8ba53aa2488b407de9df2a96a2d42b11b0624f7125e
MD5 98a8a76f83c6a42e3bc002c8c6cf04e5
BLAKE2b-256 93643ddd4946304d60aae6a7c0e2c356a6b8afa3c59a30cc7cd342802a9ac434

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 0c01b64a555b125b768a488a65170ce9b10d7eb1438ec15dd3a0ba243fa12c6f
MD5 d1dd18c8c3f6b8785ed5e90a303d59e0
BLAKE2b-256 50ab03cd8502a5979a58563f1a2f4c444969b1eb56a21c7c6db867782d6c1567

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 cddb2c56805e2dd9bd2f808ca98814b000744411869aad1ae3f93c0510dc0b26
MD5 47a12aab8aabe77ec395b7e9710472cc
BLAKE2b-256 252591feb40c01749d5a5124d30f5dbda9525451e1642616ee4a54cd1a2c02d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 87c151b225b8df3a2466a017ce03cbbdfa96ec8083105a85e1afc8532809ca5e
MD5 4840a1bd04e478ebfbde8194efad6c0e
BLAKE2b-256 92a3827edd16c2d3557eb3168789d6d4e484b334a21da45c55fedf06e85df8ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 d17f3c777bbc3a61c5f32f9e925849c876d0251d0fbb44b5f71b0f99002c1f5b
MD5 5104e589617dfa59213a3370c2295dee
BLAKE2b-256 1836e6cf3c3750c30fdf16c368a222e4e046fb1814a73ae7a5c310d1c46e6db7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 575f45163cd9874e1274b90311b0d5da30b838bd8be583602d64a4d12cf7228e
MD5 c4744162b29e7e8f52cadee670dab8fa
BLAKE2b-256 e7302b6d311960a041ca7d48914c0513e104d353a2d041965b808db1a7d4dd76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 8aa6775b5c6fd758ff1fd0dac17678a3199e04e9a6951c0d68bb8aa0312ceb6d
MD5 61cead2106f950b995737ec099ff1cf1
BLAKE2b-256 bced930b2c5e5a6254080768555220f3dec7993bb84511b9992f6c1b7de67116

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 814fd9ade11ee1b5d8abf013eef9f8488d2cabbc2c69671aee276aea3b678a47
MD5 8f425fde4a973cfd4f6129c64c678af0
BLAKE2b-256 4cf4aabc87f96c527a4e5f96544c6f97301bc072d423ff8e3e2c08941f13e276

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 d0227d11b873452064cd23b6e533dfc4c3cb5095990e4119a55a77b5df4ec03a
MD5 143eaaad5960447996bddfd3b219ae8e
BLAKE2b-256 1af1ea88e1b15c7e42cc200964c49c1a19ae7c34e8f78326058cd31f3077e9fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 9a6046c8f7e228e7aa0d579868dd1c0949e6085b08a637601d0c3aa7b1d05e1a
MD5 4062ccd6b34819fe6732b3bac57f9c64
BLAKE2b-256 df70510781cc716b7ef1d26c390d664696ed765abd924f997f0def868c99658f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 225a44f359acced7467f5eeafeae55aceb19ca77167f0c23ae205df9f95ff7d3
MD5 548fa707a646d033dbda9241fa417c91
BLAKE2b-256 3a917f368e3223bb520371898bf8c9b79f6852f6a9b5cdb564415b0344059b92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5b1ceef3234e8fce16f06bf2e73e3e5bee895fd82c1574a15305db6596078d0e
MD5 94e7d30ae67576caeb6304c1e32fbbe0
BLAKE2b-256 c2030acf8bc7644a1c37042c5c6743c13773c6d3c139ddfba813e68a0eb8b795

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 a1aa86f7ad04fcd11425e7e1548ef6d45cd9764baa655a07e06c060e54022e77
MD5 231ddd04829ceaeb0f3714131f0428e9
BLAKE2b-256 a05f8caccad10af4696dcbc922248d3944ba225996ab6a2b42a78b8125fbd95f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 30ca4e7b4e88766d80ae2197f6d29e483449ca48786f36dc3caa2c4a3488935f
MD5 1faa31ea9a114ecb517d761fdca783ba
BLAKE2b-256 d77b6db8a8c4ee80ef334f6d053ff320ae3c599db1d69f86bb61be45338569c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 a378b2e509463af583a45f030e17c53c05c8a160f49c9cb89c66d8b08d2f3bff
MD5 f5884ba5c120eaed1b56e8d0a74a871f
BLAKE2b-256 e19736411cb3af43ef1eae8b3e5fc19a52f3e104a5514c2101195bcf923af6c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 378a0cfddb8c734a8c2003513e49edbbcbb0a72ce0800a0250f2d27d471a3cb1
MD5 3a9787c6556b307c3de80dba0aaf9cc3
BLAKE2b-256 247d748f82a86fcfa24e3b80c8045908f934b3106337bd68fe91dba27f9d059a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b9a47a1553ff55d8dbc2cbd037e03654dbdbfa746784600b800db8d787a06e22
MD5 f368a86a78d550a192b14b8e910d18f5
BLAKE2b-256 7625fec15faa2fbdf3e864c548147a23b751c128aebd7f99c6c2d9d8440d91ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gevent-1.3.1-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a8f040c132654735422cfe5e3d720963b606e6a27f0e5abfd1ca20189dcad6d5
MD5 c5d9c003b6ffb3205604bb2b9ac7f9f1
BLAKE2b-256 aecafae399793fe206587cbb00c48cb5d43412a7630fdc0a72e65c0ae48fa036

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