Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta update for 2-3 conversion #654

Closed
sjsrey opened this issue Jul 9, 2015 · 7 comments
Closed

meta update for 2-3 conversion #654

sjsrey opened this issue Jul 9, 2015 · 7 comments
Assignees
Milestone

Comments

@sjsrey
Copy link
Member

sjsrey commented Jul 9, 2015

swap out urllib2 for and use requests or httplib

@sjsrey sjsrey self-assigned this Jul 9, 2015
@sjsrey sjsrey added this to the Release + 1 milestone Jul 9, 2015
@ljwolf
Copy link
Member

ljwolf commented Jul 9, 2015

Or try to futureproof requests stuff.

@pastephens
Copy link
Member

I'm curious about the motivation for this.

pstephen@happyendings ~/D/pysal> grep -r urllib2 .
./distribute_setup.py: from urllib2 import urlopen
./pysal/init.py:import urllib2, json
./pysal/init.py: request = urllib2.urlopen(url)
Binary file ./pysal/init.pyc matches
./pysal/contrib/opendata/google.py:import urllib2
./pysal/contrib/opendata/google.py: rsp = urllib2.urlopen(url)
./pysal/meta/wmd.py:import urllib2 as urllib
./pysal/weights/weights_from_geojson.ipynb: "import urllib2 as urllib"
./tools/github_stats.py:from urllib2 import urlopen

@jlaura
Copy link
Member

jlaura commented Jul 14, 2015

In PySAL-REST we have been using requests and that package has been significantly more pleasant to use than url lib. It looks like 99% of the url lib stuff is in either contrib or pseudo-experimental code. Is that the case? If so, and assuming we are pegging to anaconda/canopy then I would +1 the requests module.

@ljwolf
Copy link
Member

ljwolf commented Jul 24, 2015

There's also an idiom in six that may be easier than reimplementation in Requests, especially if requests doesn't support arbitrary chomp sizes.

@ljwolf
Copy link
Member

ljwolf commented Jul 26, 2015

I've tried a mutually-compatible version using six.moves.urllib over here.

I'll be running the doctests to check. If there are meta tests in the works, it'd be great to know.

@ljwolf
Copy link
Member

ljwolf commented Jul 26, 2015

2 of the 4 builtin reading tests are failing without any modification. I'm not going to worry about this for the 2to3 conversion until this codebase settles down.

screen shot 2015-07-25 at 9 23 56 pm

@ljwolf
Copy link
Member

ljwolf commented May 23, 2016

I'd like to close this, but currently meta isn't even importable from PySAL:

>>> import pysal as ps
>>> from pysal import meta as m
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-4-22096d9ee5b5> in <module>()
----> 1 from pysal import meta as m

ImportError: cannot import name 'meta'
>>> ps.version
'1.11.2'

@ljwolf ljwolf closed this as completed Jul 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants