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

Remove Python 3.6 support #326

Closed
wants to merge 1 commit into from
Closed

Remove Python 3.6 support #326

wants to merge 1 commit into from

Conversation

adamjstewart
Copy link
Collaborator

As of today, Python 3.6 is no longer supported. Other than dataclasses (which has a backport), we don't currently use any features that require Python 3.7+, but I see no reason to continue testing it, and if it isn't tested it will break eventually. So I think the best course of action is to remove support for it entirely.

@adamjstewart adamjstewart added this to the 0.2.0 milestone Dec 24, 2021
@calebrob6
Copy link
Member

This just explicitly breaks Python 3.6 right (because we are removing dataclasses support)? If so, I'm not huge fan as there is currently no cost of keeping Python 3.6 support.

@adamjstewart
Copy link
Collaborator Author

adamjstewart commented Dec 24, 2021

I'm fine with keeping Python 3.6 support if you want to. I took a look through the last few Python releases and these seem like the biggest features we use/care about:

  • 3.5: type hints, subprocess.run
  • 3.6: f-strings, variable annotations
  • 3.7: dataclasses, postponed evaluation of type annotations
  • 3.8: meh
  • 3.9: type hints using builtin types, dict union
  • 3.10: type union using pipe, match-case statements

The only other thing introduced in Python 3.7 that we might care about is postponed evaluation of type annotations. Basically, it lets you do something like:

from __future__ import annotations

class GeoDataset:
    def __and__(self, other: GeoDataset) -> IntersectionDataset:

Right now, we have to do:

class GeoDataset:
    def __and__(self, other: "GeoDataset") -> "IntersectionDataset":

because Python tries to evaluate these type hints while reading the class definition and they obviously aren't defined yet. See mypy docs for more details.

Python 3.9 and 3.10 make huge improvements to type annotations that allow you to do things like:

x: list[int | float]

instead of:

from typing import List, Union

x: List[Union[int, float]]

which is obviously more readable. But we obviously have a long time to wait before we can require 3.9 or 3.10+.

@calebrob6
Copy link
Member

Good to know! If you see any problems in the 6-month future of keeping 3.6 then I'm down to drop now, else would want to reevaluate in 6 months (I seem to remember seeing a 3.6 environment in an issue from someone's stack trace recently).

@adamjstewart adamjstewart deleted the support/python3.6 branch December 27, 2021 16:00
@adamjstewart adamjstewart removed this from the 0.2.0 milestone Jan 1, 2022
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.

None yet

2 participants