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]
i9zO5AP has joined #pypy
Orimendix has joined #pypy
jcea has quit [Quit: jcea]
jcea has joined #pypy
jcea has quit [Ping timeout: 260 seconds]
_whitelogger has joined #pypy
_whitelogger has joined #pypy
mosasaur has joined #pypy
<mosasaur> I'm currently using a python2 version of https://github.com/kvesteri/validators but I want to switch to pypy
<mosasaur> seems validators is not supported even for python2 anymore
<wleslie> it's easy enough to pin the version you're using; would that be easier?
<mosasaur> wleslie: the problem is I never installed the pypy version, only the python2 version
<mosasaur> oh here it says it removed py27 and pypy2 support on 0.14.3 (2020-02-04) https://github.com/kvesteri/validators/blob/master/CHANGES.rst
<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
<arigato> foo_p = ffi.gc(ffi.new("foo_t **"), lib.my_disconnect)
<arigato> lib.sr_connect(foo_p)
<arigato> void my_disconnect(foo_t **foo_p)
<arigato> {
<arigato> if (*foo_p != NULL)
<arigato> sr_disconnect(*foo_p);
<arigato> }
<arigato> (in this solution, you'd add only the one function my_disconnect() to ffi.set_source())
<arigato> it works also if you write my_disconnect() as a pure python function, though it's less signal-proof again
<LarstiQ> mosasaur: no indeed, just using 0.14.2 sounds like less work
jacob22 has quit [Read error: Connection reset by peer]
jacob22 has joined #pypy
lritter has joined #pypy
<mattip> the rpython differences between py3.6 are now only in the rpython/rlib/rsre/rpy files
<mattip> which are copies of the lib-python/2.7 ones. They were updated in the stdlib update
* mattip deleting the bad py3.7 run 7c7faeccf4d0 from the buildbot so we get a clearer picture of the status
bbot2 has quit [Quit: buildmaster reconfigured: bot disconnecting]
bbot2 has joined #pypy
lritter has quit [Ping timeout: 265 seconds]
mosasaur has quit [Remote host closed the connection]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5599 [mattip: force build, py3.7]
<bbot2> Exception: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7274 [mattip: force build, py3.7]
<bbot2> Exception: http://buildbot.pypy.org/builders/pypy-c-jit-macosx-x86-64/builds/5272 [mattip: force build, py3.7]
<bbot2> Exception: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5599 [mattip: force build, py3.7]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5600 [mattip: force build, py3.7]
jacob22 has quit [Read error: Connection reset by peer]
jacob22 has joined #pypy
infernix has quit [Quit: ZNC - http://znc.sourceforge.net]
<arigato> mattip: I guess I could give rsre a more serious look for py3.7, if nobody else is willing to
infernix has joined #pypy