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

Drop support for Python 2.7! #1163

Merged
merged 16 commits into from Oct 24, 2019
Merged

Drop support for Python 2.7! #1163

merged 16 commits into from Oct 24, 2019

Conversation

zbruick
Copy link
Contributor

@zbruick zbruick commented Sep 13, 2019

Description Of Changes

What do you do when it's a Friday afternoon? Drop 2.7!

In all seriousness, according to our docs, we're dropping 2.7 in "Fall 2019". Given that meteorological (real) fall is here and astronomical fall is 8 days away, this is likely for sure going in 0.12. (Not sure when 0.11 will get out the door, but not sure if we should include this in that or not).

I'm sure I missed some stuff, so feel free to push commits to this, or review and comment if you have small items to address. There is one open item on #801 that I didn't fix yet, as the comment was vague and I didn't have time to look into it yet.

Whenever 2.7 is dropped, celebration is in order!

Checklist

@zbruick zbruick added Area: Infrastructure Pertains to project infrastructure (e.g. CI, linting) Type: Maintenance Updates and clean ups (but not wrong) labels Sep 13, 2019
metpy/__init__.py Outdated Show resolved Hide resolved
metpy/cbook.py Outdated Show resolved Hide resolved
metpy/io/_tools.py Outdated Show resolved Hide resolved
@zbruick zbruick force-pushed the drop27 branch 2 times, most recently from ed7c385 to cacc2e8 Compare September 25, 2019 14:47
@dopplershift
Copy link
Member

One good one to do to modernize the code base is to convert all uses of super to just super().

@dopplershift
Copy link
Member

Actually, before doing that, it might be good to see what we can do about having flake8 catch that, and other modernizations, that we make.

@dopplershift
Copy link
Member

Another one to add is updating setup.cfg to remove dependencies (I'm sure you had before I rewrote the build system) as well as remove the bdist_wheel section to no longer say we build universal wheels.

@dopplershift
Copy link
Member

Other things coming to mind:

  • In several places we have code that does some hacking around the crappy function signature support on Python 2.7. We can clean that up.
  • A lot of places using kwargs.pop should probably be changed to use kw-only arguments

@dopplershift dopplershift added this to the 0.12 milestone Oct 2, 2019
@zbruick
Copy link
Contributor Author

zbruick commented Oct 9, 2019

Actually, before doing that, it might be good to see what we can do about having flake8 catch that, and other modernizations, that we make.

Have been looking for any plugins and haven't seen anything useful yet. Lots of py2 to py 2/3 support online. Doesn't really look like there are any good linters for conversion of py2/3 to py3. Looking at astropy, they suggested running coverage just with py2 and py3 separately to see what was only covered in either to remove dead code. Is that something that can easily be done here?

@zbruick
Copy link
Contributor Author

zbruick commented Oct 9, 2019

Ok I've cleaned up setup.cfg and removed uses of kwargs.pop wherever possible (only remaining ones are within the plot module).

@zbruick
Copy link
Contributor Author

zbruick commented Oct 9, 2019

  • In several places we have code that does some hacking around the crappy function signature support on Python 2.7. We can clean that up.

Clarification on where these hacks exist (or what they look like) would be great

@dopplershift
Copy link
Member

I’ll look at the signature stuff. We should be able to look at codecov and see what it says about new uncovered lines with this PR to find other blocks of unneeded code (assuming it’s working).

@zbruick
Copy link
Contributor Author

zbruick commented Oct 10, 2019

Found one thing in units.py that could be removed. I believe the only things that were mentioned that haven't been done is to update super() and clean up hacks.

@lgtm-com
Copy link

lgtm-com bot commented Oct 17, 2019

This pull request fixes 1 alert when merging c12386a into 7e506b8 - view on LGTM.com

fixed alerts:

  • 1 for Inconsistent equality and hashing

@zbruick
Copy link
Contributor Author

zbruick commented Oct 18, 2019

Fixed imports in grid.py and tools.py.

Added errors to setup.py and init.py if Python 2 is detected to either fail to install or fail to import. Verified that the error message in setup.py is returned in pip install -e. is executed in a Py2 environment.

@zbruick zbruick force-pushed the drop27 branch 2 times, most recently from 4a55a03 to 5fe6f23 Compare October 21, 2019 19:39
@lgtm-com
Copy link

lgtm-com bot commented Oct 21, 2019

This pull request fixes 1 alert when merging 5fe6f23 into d39ddc3 - view on LGTM.com

fixed alerts:

  • 1 for Inconsistent equality and hashing

@zbruick zbruick force-pushed the drop27 branch 2 times, most recently from 3ab9df1 to ae563df Compare October 21, 2019 20:59
@lgtm-com
Copy link

lgtm-com bot commented Oct 21, 2019

This pull request fixes 1 alert when merging ae563df into d39ddc3 - view on LGTM.com

fixed alerts:

  • 1 for Inconsistent equality and hashing

@dopplershift
Copy link
Member

Power-cycling to hopefully get codecov to actually track results--really want to see if there are any newly uncovered lines after this.

@zbruick zbruick closed this Oct 22, 2019
@zbruick zbruick reopened this Oct 22, 2019
@lgtm-com
Copy link

lgtm-com bot commented Oct 24, 2019

This pull request fixes 1 alert when merging 602d30f into d39ddc3 - view on LGTM.com

fixed alerts:

  • 1 for Inconsistent equality and hashing

@lgtm-com
Copy link

lgtm-com bot commented Oct 24, 2019

This pull request fixes 1 alert when merging 4ccb2c9 into d39ddc3 - view on LGTM.com

fixed alerts:

  • 1 for Inconsistent equality and hashing

@dopplershift dopplershift merged commit 1547ed1 into Unidata:master Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Infrastructure Pertains to project infrastructure (e.g. CI, linting) Type: Maintenance Updates and clean ups (but not wrong)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dropping support for Python 2.7
2 participants