Skip to content

Drop 2to3 in setup.py #400

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

Merged
merged 4 commits into from
Apr 27, 2018
Merged

Drop 2to3 in setup.py #400

merged 4 commits into from
Apr 27, 2018

Conversation

ocefpaf
Copy link
Contributor

@ocefpaf ocefpaf commented Apr 26, 2018

@efiring I'm not sure of the tests are comprehensive enough to give us 100% confidence on this PR but it was actually quite simple and not a lot of code change to eliminate 2to3.

Closes #399

@@ -4325,17 +4330,17 @@ def wmsimage(self,server,\
# ypixels not given, find by scaling xpixels by the map aspect ratio.
if ypixels is None:
ypixels = int(self.aspect*xpixels)
if verbose: print server
if verbose: print(server)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a from __future__ import print_function to the top

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually inclined to add

from __future__ import (absolute_import, division, print_function)

at the top of all .py files. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably wouldn't hurt. Don't forget about the examples in the docs. They can also be used as a form of unit test (mostly, somewhat, kinda...).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably wouldn't hurt.

👍

Don't forget about the examples in the docs. They can also be used as a form of unit test (mostly, somewhat, kinda...).

Working on that in a separate PR b/c most of the issues there are not Python 3 compat code but services that are down and API changes in modern numpy and matplotlib. See https://github.com/ocefpaf/basemap/tree/update_examples for my progress so far. (PR soon...)

@@ -4347,7 +4352,7 @@ def wmsimage(self,server,\
return self.imshow(imread(io.BytesIO(img.read()),
format=format),origin='upper',alpha=alpha,ax=ax)
# this works for png, but not jpeg
#return self.imshow(imread(urllib2.urlopen(img.url),format=format),origin='upper')
#return self.imshow(imread(urlopen(img.url),format=format),origin='upper')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just get rid of these lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@ocefpaf ocefpaf mentioned this pull request Apr 26, 2018
@ocefpaf
Copy link
Contributor Author

ocefpaf commented Apr 26, 2018

@WeatherGod anything left to do here? I sent #401 to update the example, following this one, and I have another PR to update setup.py a little bit.

@ocefpaf ocefpaf mentioned this pull request Apr 27, 2018
@WeatherGod WeatherGod merged commit 2024d05 into matplotlib:master Apr 27, 2018
@ocefpaf ocefpaf deleted the drop_2to3 branch April 27, 2018 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants