Skip to content

Conversation

@max-sixty
Copy link
Collaborator

@max-sixty
Copy link
Collaborator Author

max-sixty commented Mar 20, 2019

TBC, I don't think this would allow 3.5.2 to work from PyPI even if we did a point release - 3.5.2 would still run 0.12.0

@max-sixty max-sixty changed the title Bump minimum python version to 3.5.3 Enable python 3.5.0-3.5.2 Mar 20, 2019
Copy link
Member

@shoyer shoyer left a comment

Choose a reason for hiding this comment

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

Thanks Max!

@max-sixty
Copy link
Collaborator Author

From #2830:

Probably the simplest thing to do would be to guard the import in a typing.TYPE_CHECKING block

Unfortunately that's only supported from 3.5.2!

I'll add a version check. I think there are only two places, and it won't last long

@max-sixty
Copy link
Collaborator Author

I added a fix; it may have some mistakes which I'll correct

Is the approach OK? It's not pretty

from .times import format_cftime_datetime

if USE_TYPING:
if typing.TYPE_CHECKING:
Copy link
Member

Choose a reason for hiding this comment

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

Can mypy interpret this if we it this on one line? e.g., if USE_TYPING and typing.TYPE_CHECKING ?

@pep8speaks
Copy link

pep8speaks commented Mar 21, 2019

Hello @max-sixty! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-03-22 02:38:08 UTC

@max-sixty
Copy link
Collaborator Author

Green! Good idea re the single line, thanks @shoyer

@max-sixty
Copy link
Collaborator Author

Please could someone else take a final check and merge? @shoyer reviewed but not since some changes. Thanks!

@shoyer
Copy link
Member

shoyer commented Mar 22, 2019

This looks good to me. I tested it locally and it works with mypy.

I pushed a small change to put a single TYPE_CHECKING variable in pycompat, so we can simply the check that we put in each file.

@max-sixty
Copy link
Collaborator Author

I pushed a small change to put a single TYPE_CHECKING variable in pycompat, so we can simply the check that we put in each file.

Much nicer!

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.

3 participants