I'm happy to announce the first beta release of gevent 1.0.
Changes compared to 1.0a3:
- Removed "link to greenlet" feature of Greenlet.
- Added thread pool: gevent.threadpool.ThreadPool.
- Added thread pool-based resolver. Enable with GEVENT_RESOLVER=thread.
- Added UDP server: gevent.server.DatagramServer
- A "configure" is now run on libev. This fixes a problem of 'kqueue'
not being available on Mac OS X.
- Gevent recognizes some environment variables now:
- GEVENT_BACKEND allows passing argument to loop, e.g.
"GEVENT_BACKEND=select" for force select backend
- GEVENT_RESOLVER allows choosing resolver class.
- GEVENT_THREADPOOL allows choosing thread pool class.
- Added new examples: portforwarder, psycopg2_pool.py, threadpool.py,
udp_server.py
- Fixed non-embedding build. To build against system libev, remove or
rename 'libev' directory. To build against system c-ares, remove or
rename 'c-ares'.
- Fixed a number of issues in pywsgi, core, socket
See the full changelog here:
https://bitbucket.org/denis/gevent/raw/tip/changelog.rst
In the issue tracker:
http://code.google.com/p/gevent/issues/list?can=1&q=Milestone%3DRelease1.0b1
Download the release tarballs and windows installers from
http://code.google.com/p/gevent/downloads/list
Thanks to Ralf Schmitt who is co-maintaining gevent with me.
Thanks to Örjan Persson, Shaun Lindsay, Shaun Cutts, David
LaBissoniere, tck420 for sending in patches.
(If I forgot you please let me know.)
Cheers,
Denis.
Really nice list of features! What about the compatibility with py3
right now? Are there anything still needed for that ? Where ?
- benoît
>
> Really nice list of features! What about the compatibility with py3
> right now? Are there anything still needed for that ? Where ?
>
It's currently not compatible with python 3. I've started working on
that. The current code already ships with six as gevent.six
(http://pypi.python.org/pypi/six). Some of the modules have already been
ported (or at least the tests do pass). If time permits I will continue
to work on py 3 compatibility bit by bit.
I didn't use any of the forks that add python 3 compatibility. Some of
them did use 2to3, which we don't want to use. Some of them were
branched from rather old versions of gevent (at least at the time I did
look at them). If you think I'm missing some important work, please
speak up!
I'm doing my work in https://github.com/schmir/gevent/commits/wip-py3
and when I consider a module finished, I commit to the main branch in
the bitbucket repo. We decided not to use a dedicated branch for that
work.
Help would be appreciated!
--
Cheers
Ralf
Thanks, I will have a closer look on it during the week. For gunicorn
this is a must-have feature and would allow us to ship it for py3 with
async support. Like on py2.7 . I'm following the same path anyway,
there won't be a special branch or repo for py3 in gunicorn.
Thanks for your work anyway,
- benoît
At least socket module doesn't work a few weaks ago :(.
>>> import gevent.socket
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "gevent/socket.py", line 233, in <module>
class socket(object):
File "gevent/socket.py", line 546, in socket
for _m in set(__socket__._socketmethods) - set(locals()):
AttributeError: 'module' object has no attribute '_socketmethods'
I tried to fix this and other "trivial" errors, but didn't succeed.
--
Alexandre
You probably have a file called socket.py[c] lying in your PYTHONPATH somewhere.
find / -iname 'socket.py*'
And you're not using 1.0b1 (line numbers don't match).
There is no stalled socket.py*.
> Hi.
>
> I'm happy to announce the first beta release of gevent 1.0.
>
> Changes compared to 1.0a3:
>
> - Removed "link to greenlet" feature of Greenlet.
If you have been using this feature, please add an assert to make your
life easier, like in:
https://github.com/schmir/gevent/commit/4f2fce96feaefd84bd498b30d957b65e606bd054
I'll do that later on the bitbucket repo with some extra fixes to the testsuite
from https://github.com/schmir/gevent/tree/wip-fixes
--
Cheers
Ralf
No, we still on 1.0a3, but plan on upgrading soon.
> We'll start running a service on this new beta this week (lot18.com).
On Wed, Jan 11, 2012 at 9:16 AM, Ralf Schmitt <ra...@systemexit.de> wrote:
> If you have been using this feature, please add an assert to make your
> life easier, like in:
> https://github.com/schmir/gevent/commit/4f2fce96feaefd84bd498b30d957b65e606bd054
I agree, we should check for that. Only let's raise TypeError and
let's do hasattr(..., '__call__') instead of callable() to be
future-compatible with python3.
> I agree, we should check for that. Only let's raise TypeError and
> let's do hasattr(..., '__call__') instead of callable() to be
> future-compatible with python3.
callable is back in 3.2, if we care about 3.0 or 3.1 we should use
gevent.six.callable. I plan to commit the changes today.
Should we care about 3.0 and 3.1?
Also any idea why is callable() in six defined as
def callable(obj):
return any("__call__" in klass.__dict__ for klass in type(obj).__mro__)
instead of
def callable(obj):
return hasattr(obj, '__call__')
Also I think gevent/six.py will be removed or trimmed eventually,
since we seem to need only a small fraction of it. So far, we've used
this in gevent package:
- integer_types
- string_types
- callable (not really, since it's back in 3.2)
- _meth_self
- xrange
- PY3
That is, it's OK to use it while porting is in progress, but I don't
want gevent users to depend on it too, since I don't want to maintain
it beyond what's needed for gevent.
>> Should we care about 3.0 and 3.1?
I think supporting only 3.2 and up would be fine.
>>
>> Also any idea why is callable() in six defined as
>>
>> def callable(obj):
>> return any("__call__" in klass.__dict__ for klass in type(obj).__mro__)
>>
>> instead of
>>
>> def callable(obj):
>> return hasattr(obj, '__call__')
I don't know.
>
> Also I think gevent/six.py will be removed or trimmed eventually,
> since we seem to need only a small fraction of it. So far, we've used
> this in gevent package:
>
> - integer_types
> - string_types
> - callable (not really, since it's back in 3.2)
> - _meth_self
> - xrange
> - PY3
>
> That is, it's OK to use it while porting is in progress, but I don't
> want gevent users to depend on it too, since I don't want to maintain
> it beyond what's needed for gevent.
[six.exec_ and six.advance_iterator in the tests]
why not make it a dependency then? gevent already depends on the
greenlet module and a pure python dependency doesn't hurt IMHO.
trimming unused functionality from the six module is what makes you
maintain it; it's a bad idea IMHO. if you don't do that, you only need
to upgrade it once in a while and forget about it. it's only 350 lines
of code.
Also remember that porting has just begun; at the end a larger fraction
of functionality might be in use.
btw is there any reason we don't add the greenlet module to the
dependencies and let easy_install/pip take care of it?
--
Cheers
Ralf
OK.
> [six.exec_ and six.advance_iterator in the tests]
Yeah, I noticed. Tests can have dependencies that gevent itself does
not have. It's not critical there.
> why not make it a dependency then? gevent already depends on the
> greenlet module and a pure python dependency doesn't hurt IMHO.
Might create more work for packagers.
> trimming unused functionality from the six module is what makes you
> maintain it; it's a bad idea IMHO. if you don't do that, you only need
> to upgrade it once in a while and forget about it. it's only 350 lines
> of code.
Every line counts. If you keep it there, people might start depending
on it and that's when it becomes painful to remove so you end up
maintaining it.
> Also remember that porting has just begun; at the end a larger fraction
> of functionality might be in use.
OK, let's keep it for now until it's obvious what we need exactly.
> btw is there any reason we don't add the greenlet module to the
> dependencies and let easy_install/pip take care of it?
I thought we do that:
https://bitbucket.org/denis/gevent/src/b045e5f368f4/setup.py#cl-261
or did you mean something else?
Cheers,
Denis.
>> btw is there any reason we don't add the greenlet module to the
>> dependencies and let easy_install/pip take care of it?
>
> I thought we do that:
> https://bitbucket.org/denis/gevent/src/b045e5f368f4/setup.py#cl-261
>
> or did you mean something else?
That's exactly what I meant. Seems like I need more sleep!
--
Cheers
Ralf
Actually, packagers (the ones creating GNU/Linux distributions)
generally frown more on bundling packages as that is what creates
extra work for them. They don't like bundling since it means they
need to fix lots of things instead of just one place. A dependency is
much nicer for them.
Direct users however are a different matter, but most probably use pip
by now. Not to say bundling isn't tempting for this scenario. Maybe
ideally setup.py detect if it's available and only uses the bundled
version if it's not available?
Regards,
Floris
--
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org
Somehow you still seem to be using old core.so (from 1.0a2). Not sure
how it happened, but I'm pretty sure that wiping out gevent completely
and the doing fresh install of 1.0b1 would solve the issue.
>>
>> def callable(obj):
>> return any("__call__" in klass.__dict__ for klass in type(obj).__mro__)
>>
>> instead of
>>
>> def callable(obj):
>> return hasattr(obj, '__call__')I don't know.
Fantix King <fanti...@gmail.com> writes:
> One thing to mention is that, with Cython built with Python 3, sometimesthat's rather strange, you should probably report that to the cython
> Gevent doesn't compile correctly. I had to force using Cython built with
> Python 2.
developers.
btw, your code seems to live in the issue38 branch (see
https://github.com/fantix/gevent/commits/issue38).
The very first commit on that branch is rather large, and has a rather
short log message!