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 3.8 after October 2024 #265

Open
JonathonReinhart opened this issue Jan 2, 2024 · 0 comments
Open

Drop support for Python 3.8 after October 2024 #265

JonathonReinhart opened this issue Jan 2, 2024 · 0 comments

Comments

@JonathonReinhart
Copy link
Owner

Python 3.8 reaches end-of-life in October 2024 1 2.

Drop support for Python 3.8 after this date:

  • Remove from CI
  • Allow use of language and standard library features from Python >= 3.9

(Copied from JonathonReinhart/scuba#243)

Footnotes

  1. https://en.wikipedia.org/wiki/History_of_Python#Table_of_versions

  2. https://peps.python.org/pep-0569/

JonathonReinhart added a commit that referenced this issue Jan 14, 2024
pkg_resources is deprecated:
https://setuptools.pypa.io/en/latest/pkg_resources.html

This prefers importlib.metadata (introduced in Python 3.8) and uses the
backport importlib_metadata for Python 3.7 (to be removed in #264).

This instead uses importlib.resources.files() (introduced in Python 3.9)
and uses the backport importlib_resources for Python 3.7-3.8 (to be
removed in #264, #265).

This was chosen over the alternative of using the deprecated (as of
Python 3.11) function importlib.resources.open_binary() (introduced in
Python 3.7), as it seems simpler.
JonathonReinhart added a commit that referenced this issue Jan 14, 2024
pkg_resources is deprecated:
https://setuptools.pypa.io/en/latest/pkg_resources.html

This instead uses importlib.resources.files() (introduced in Python 3.9)
and uses the backport importlib_resources for Python 3.7-3.8 (to be
removed in #264, #265).

This was chosen over the alternative of using the deprecated (as of
Python 3.11) function importlib.resources.open_binary() (introduced in
Python 3.7), since we already have techdebt to remove a related
backport, which is preferable to upgrading from the deprecated API.
JonathonReinhart added a commit that referenced this issue Jan 14, 2024
pkg_resources is deprecated:
https://setuptools.pypa.io/en/latest/pkg_resources.html

This instead uses importlib.resources.files() (introduced in Python 3.9)
and uses the backport importlib_resources for Python 3.7-3.8 (to be
removed in #264, #265).

This was chosen over the alternative of using the deprecated (as of
Python 3.11) function importlib.resources.open_binary() (introduced in
Python 3.7), since we already have techdebt to remove a related
backport, which is preferable to upgrading from the deprecated API.
JonathonReinhart added a commit that referenced this issue Jan 14, 2024
…274)

pkg_resources is deprecated:
https://setuptools.pypa.io/en/latest/pkg_resources.html

This instead uses importlib.resources.files() (introduced in Python 3.9)
and uses the backport importlib_resources for Python 3.7-3.8 (to be
removed in #264, #265).

This was chosen over the alternative of using the deprecated (as of
Python 3.11) function importlib.resources.open_binary() (introduced in
Python 3.7), since we already have techdebt to remove a related
backport, which is preferable to upgrading from the deprecated API.
JonathonReinhart added a commit that referenced this issue Jan 14, 2024
This also updates the single() implementation, replacing the use of
_SENTINEL as a nothing-to-return marker with a separate bool variable.

Note that we need to use both collections.abc.Iterable (for isinstance()) and
typing.Iterable (for type annotation) until Python 3.9 (#265). If we
attempt to use the former for type annotation in Python < 3.9, we get
the following error:

    TypeError: 'ABCMeta' object is not subscriptable

This also simplifies coerce_sequence() to always return a list, removing
the return-type argument.
JonathonReinhart added a commit that referenced this issue Jan 16, 2024
This also updates the single() implementation, replacing the use of
_SENTINEL as a nothing-to-return marker with a separate bool variable.

Note that we need to use both collections.abc.Iterable (for isinstance()) and
typing.Iterable (for type annotation) until Python 3.9 (#265). If we
attempt to use the former for type annotation in Python < 3.9, we get
the following error:

    TypeError: 'ABCMeta' object is not subscriptable

This also simplifies coerce_sequence() to always return a list, removing
the return-type argument.
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

No branches or pull requests

1 participant