cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | if a pep adds a mere 25-30 [C-API] functions or so, it's a drop in the ocean (cough) - Armin
Ai9zO5AP has quit [Remote host closed the connection]
Ai9zO5AP has joined #pypy
i9zO5AP has joined #pypy
Ai9zO5AP has quit [Ping timeout: 240 seconds]
oberstet has quit [Remote host closed the connection]
kipras has joined #pypy
jcea1 has joined #pypy
jcea has quit [Read error: Connection reset by peer]
jcea1 is now known as jcea
i9zO5AP has quit [Remote host closed the connection]
<mosasaur>
I'm currently trying sys.path.append('/usr/local/lib/python2.7/dist-packages/validators')
<wleslie>
validators is a package, sys.path does not contain packages but directories that contain packages, so that's not going to work
<wleslie>
what are you using it in? a web application, a library? are you using requirements.txt? setup.py?
<wleslie>
or just installing it manually?
<mosasaur>
just some script I made myself, to display logs
<wleslie>
prolly just be explicit about version at install time, or just vendor the package
<mosasaur>
oh wait, I'm just using that package to determine if a string is an url. I suppose I could hack that out of validators, or find some other thing that does that
<mosasaur>
kind of works :P I had to copy six.py from python2 , and url.py and utils.py from validators to my script directory, and changed some imports in my script and in url.py
<mosasaur>
oh :( I spoke too soon, it only works with python2 using those copied modules
<mosasaur>
well it works now, after also copying decorator.py
<LarstiQ>
mosasaur: considering that upstream doesn't seem to want to support python2 anymore, why not just install 0.14.2?
<mosasaur>
LarstiQ: yeah, actually I came here to get ideas about how to do this kind of thing
<mosasaur>
but, I got it working now in a similar way, by copying all kinds of files over to my script directory
<LarstiQ>
mosasaur: this is why wleslie was asking how you're using it. If it's manually in a virtualenv, you could just `pip install validators==0.14.2`
<mosasaur>
and, I suppose I could now also try and copy files over from the newer versions
<LarstiQ>
mosasaur: that sounds like it's amounting to maintaining a fork, which is another option
<mosasaur>
not a fork, just hacking out functionality I'm using
<LarstiQ>
not a public one, but functionally still a fork :)
<LarstiQ>
the point is, you'll have to keep maintaining this if you want to keep up with new releases
<LarstiQ>
effort scaling with the amount of divergence
<mosasaur>
I will consider this, once I figure out why github slows down my torbrowser when disabling javascript
<mosasaur>
oh got that one, something to do with running torbrowser via ssh
<mosasaur>
LarstiQ: I'm writing a script for personal use. How would forking be less trouble than just using 0.14.2
<mosasaur>
and, even more hacky, just grabbing what I need
<mosasaur>
I can understand if you meant something todo with community spirit, giving back, and stuff like that
jacob22 has quit [Quit: Konversation terminated!]
jacob22 has joined #pypy
<mosasaur>
by the way, running my script via pypy reduces cpu load by more than 2 times, but increases memory use 9 times
<mosasaur>
still a good deal for me :)
jcea has joined #pypy
<cfbolz>
mosasaur: nice
<cfbolz>
mosasaur: how high is the memory use?
<mosasaur>
cfbolz: for python2 14 mb, for pypy 139 mb
<cfbolz>
ouchy
mattip_ is now known as mattip
<mattip>
maybe a few strategic context managers could reduce buffered IO use
<mattip>
strategically placed
<arigato>
rjarry: re "lib.sr_connect(foo_p); foo = ffi.gc(foo_p[0], lib.sr_disconnect)"
<arigato>
one possible workaround would be to add your own C functions, inside ffi.set_source("""..."""), and then call