Python 3 readiness

551 views
Skip to first unread message

AnilG

unread,
Oct 4, 2010, 9:46:07 AM10/4/10
to gevent: coroutine-based Python network library, an...@users.sourceforge.net
Hi I am a python programmer looking at building a BSD kqueue libevent
non-threaded Python 3 ssl server and it seems gevent / greenlet is the
choice to make.
I would like to know where gevent is up to with Python 3. I'd be happy
to work on it, it'd be one way to start getting me familiar with it.

Denis Bilenko

unread,
Oct 4, 2010, 11:39:00 PM10/4/10
to gev...@googlegroups.com
Hi Anil,

Gevent is not Python3-compatible, but it would be a welcome
contribution if someone made it such.

Make sure you've seen this previous attempt:
http://groups.google.com/group/gevent/browse_thread/thread/c8abff976842bb71
http://bitbucket.org/jjonte/gevent/overview

Cheers,
Denis.

AnilG

unread,
Oct 6, 2010, 8:55:39 AM10/6/10
to gevent: coroutine-based Python network library
Ah, so how big is this? Presumably 'previous attempt' means 'failed'
or 'ran out of steam'? How many lines of code?
Is it all Python or are C changes also required?
Is it all in gevent (I see greenlet is already Python 3
'friendly' (not sure if that's totally concrete)) or are there
dependencies that need to be migrated first?

> Make sure you've seen this previous attempt:http://groups.google.com/group/gevent/browse_thread/thread/c8abff9768...http://bitbucket.org/jjonte/gevent/overview

Executier Godlike

unread,
Oct 6, 2010, 3:25:22 PM10/6/10
to gev...@googlegroups.com, anils...@gmail.com
This fork is working, but it's unsynced with a main repo for a long
time: https://bitbucket.org/jjonte/gevent

As I remember you have patch both *.py and *.c sources to get things
working.


--
Alexandre Kandalintsev

AnilG

unread,
Oct 10, 2010, 7:40:16 AM10/10/10
to gevent: coroutine-based Python network library
Thanks, Alexandre. I'm not too familiar with the environment / methods
but I'm going to jump in and see if I can get started.
I'm guessing I might end up posting again if I need some help. I might
start another thread if this one's a bit old by then.
Thanks.
Anil.
> --
> Alexandre Kandalintsev

AnilG

unread,
Oct 12, 2010, 8:36:41 AM10/12/10
to gevent: coroutine-based Python network library
I'm not sure what I'm doing is correct but I've started
https://bitbucket.org/gevent/py31 and presumably I'll be able to load
up what was in http://bitbucket.org/jjonte/gevent/ and then get
started...

Executier Godlike

unread,
Oct 12, 2010, 12:27:41 PM10/12/10
to gev...@googlegroups.com, anils...@gmail.com
Good. Ask questions here and I'll try to help.

> I'm not sure what I'm doing is correct but I've started
> https://bitbucket.org/gevent/py31 and presumably I'll be able to load
> up what was in http://bitbucket.org/jjonte/gevent/ and then get
> started...

--
Alexandre Kandalintsev

AnilG

unread,
Oct 24, 2010, 7:43:31 AM10/24/10
to gevent: coroutine-based Python network library
Thanks for the offer of help!
I wonder if you can respond to either of these?

1. Getting started:

I might be having some issues trying to run Python 2 (2.6 and 2.7) and
Python 3.1 on the same box.
I don't currently feel able to test gevent on Python 2.7 which I had
wanted to do as a start up exercise.
So I've dropped the exercises and started looking at the jjonte Python
3 fork of gevent.
I've got kqueue, libevent 2.0.7 and greenlet 0.3.1 (and libev 3.9 and
pyev) tested and working in Python 3.1 on FreeBSD 8.1.
But the jjonte Python 3 gevent fork seems to be a non starter at this
stage so I need to put more work into that.
I need to be able to tell whether I have to drop it and start again
from gevent 0.13.1 Python 2.7.

Looking at my clone from jjonte https://bitbucket.org/jjonte/gevent
there's not that much code.
If most of the business is inside gevent then there's only a few short
py files, 3 pxi files and the short core.pyx.
My trouble is that I've never dealt with this sort of build before.
I guess Cython is in use, so I can start Googling that, and I suppose
I'll have to work out how distutils works as well.

Based on my error messages I would start looking at building gevent/
core.c, starting with the cc command that setup.py fails with,
but I wonder if you can provide any direction on the gevent build in
particular?
I know the question is fairly non-specific! I guess a simple 'yes' to
gevent/core.c as a start point might be all I need.

I'm trying to see where the base is so that I can break the build up
and start at the bottom.
I think I'm just unfamiliar right now but I'm asking a question in
case I hear something in your response that may speed me up.
I will also ask Josh (Jonte) about his evaluation of the code as he
left it.

Thanks very much,
Anil.

2. Also, do you know if kqueue is broken?

The libev author claims 'kqueue is broken on most BSDs'. I am hoping
this is old; he also mentions 'Epoll is also notoriously buggy'.
I know there were problems with the original kqueue probably due to un-
necessary features like self monitoring recursion that may have since
been eliminated.
I have more or less decided kqueue on FreeBSD is my preferred platform
and I'd really like to know if it's broken!

On Oct 13, 3:27am, Executier Godlike <s...@messir.net> wrote:
> Good. Ask questions here and I'll try to help.
> Alexandre Kandalintsev

AnilG

unread,
Oct 29, 2010, 6:37:08 AM10/29/10
to gevent: coroutine-based Python network library
Ok, scratch question 1! I just needed to add the right switches to
setup.py.
I updated the setup.py to default to libevent 2 and ran as
python setup.py build -I/usr/local/include -L/usr/local/lib
It seems to have compiled, linked and installed.
I will continue to test.

On Oct 24, 10:43pm, AnilG <anilsgul...@gmail.com> wrote:
> Thanks for the offer of help!
> I wonder if you can respond to either of these?
>
> 1. Getting started:
> I might be having some issues ...

Denis Bilenko

unread,
Apr 26, 2011, 11:05:01 AM4/26/11
to Executier Godlike, AnilG, gev...@googlegroups.com
On Tue, Apr 26, 2011 at 9:51 PM, Executier Godlike <sp...@messir.net> wrote:
> 2Denis: what the folder libev is? :) A long time ago you said that you
> don't want to deal with libev. Have you changed your opinion? :)

I don't recall saying that, but yes, my opinion changed.

> Another question to Denis. I cloned https://bitbucket.org/denis/gevent
> and don't see for example 0.13.5 in "hg tags". Is it an actual repo?

0.13 is maintained here: https://bitbucket.org/denis/gevent-0.13

Almost all patches from it transplanted into https://bitbucket.org/denis/gevent
which is the main repo (version 0.14).
Tags require specific changeset and thus not transplanted.


> 2AnilG: I see in changelog about libev:
> "major change: use libev for an event loop, dns, http and wsgi modules
> currently don't work". Soo, now(or near feature) we'll be able to select
> between libevent and libev. However I don't expect visible changes :)

Only libev will be supported in 0.14. However, other than gevent.core
the interface of
gevent package is not changed, so transition should be smooth.

>> What's hanging me up immediately though is my unfamiliarity with the
>> build mechanisms.
>> I have actually (supposedly) built gevent but on import get: gevent/
>> core.so: Undefined symbol "ares_inet_net_pton"

Which OS?
If OS X, then try the patch from here:
http://code.google.com/p/gevent/issues/detail?id=76

AnilG

unread,
Apr 26, 2011, 9:32:15 PM4/26/11
to gevent: coroutine-based Python network library
I'm not sure what's going on here as I can't seem to see all responses
in this thread. I can see Denis' reply Apr 27, 1:05 so I have
something to reply to but I can't see my recent question or the
response from Executier Godlike which Denis is apparently also
replying to.

> >> I have actually (supposedly) built gevent but on import get: gevent/
> >> core.so: Undefined symbol "ares_inet_net_pton"
>
> Which OS?
> If OS X, then try the patch from here:http://code.google.com/p/gevent/issues/detail?id=76

Sorry if I didn't mention the OS Denis! I have a fresh FreeBSD 8.2
install but am thinking of moving to NetBSD 5.1 since libev author
says that kqueue is better on NetBSD.

If you can give me some basic direction on the build process I would
hope to debug this myself. If libev is being built I can't see how
setup.py starts that compilation, it looks like it's building
libevent. I am also trying to build pyev (python wrapper around libev)
and may have libev build problems there due to source code encodings
not being recognised. If libev build is being attempted by gevent
setup.py I may get progress looking at that.

Thanks
Anil

Executier Godlike

unread,
Apr 28, 2011, 6:57:24 AM4/28/11
to gev...@googlegroups.com, anils...@gmail.com
> I'm not sure what's going on here as I can't seem to see all responses
> in this thread.
Mmm, strange. I received all messages. But you see messages from
mailing lists. It's good :). (may be you have strange filtering rules
or messages were marked as spam...)

> If you can give me some basic direction on the build process

Could you please provide access to your repo? I'll try to reproduce the
problem.

Reply all
Reply to author
Forward
0 new messages