Skip to content

Remove Python 3.8/3.9 compatibility code#22

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/remove-python-compatibility-code
Closed

Remove Python 3.8/3.9 compatibility code#22
Copilot wants to merge 3 commits intomainfrom
copilot/remove-python-compatibility-code

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

Now that requires-python = ">=3.10", several compatibility shims are no longer needed.

Changes

  • conftest.py: Drop from __future__ import annotations — PEP 585/604 syntax works natively at runtime in 3.10+
  • jaraco/context/__init__.py:
    • Move TypeAlias from TYPE_CHECKING guard to regular typing imports — it was guarded to avoid ImportError on 3.8/3.9 where typing.TypeAlias didn't exist
    • Move ParamSpec from typing_extensionstyping (added to stdlib in 3.10); Self and Unpack remain in typing_extensions as they require 3.11+
# Before
from typing import (
    TYPE_CHECKING,
    Literal,
    TypeVar,
    cast,
)

if TYPE_CHECKING:
    from typing import TypeAlias
    from typing_extensions import ParamSpec, Self, Unpack

# After
from typing import (
    TYPE_CHECKING,
    Literal,
    TypeAlias,   # no longer needs TYPE_CHECKING guard
    TypeVar,
    cast,
)

if TYPE_CHECKING:
    from typing import ParamSpec  # moved from typing_extensions
    from typing_extensions import Self, Unpack  # still need 3.11+

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • http://pypi.org:80/
    • Triggering command: /usr/bin/python python -m pytest --doctest-modules jaraco/context/__init__.py -v (http block)
    • Triggering command: /usr/bin/python python -m pytest -v --uid-owner 0 -j ACCEPT (http block)
    • Triggering command: /usr/bin/python python -m pytest -v --tb=short unset --global p/bin/git user.email (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Remove Python 3.8 and 3.9 compatibility code</issue_title>
<issue_description>This project now relies on Python 3.10 and later. Remove any behaviors no longer required for older Pythons.</issue_description>

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI and others added 2 commits March 20, 2026 22:04
Co-authored-by: jaraco <308610+jaraco@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jaraco/jaraco.context/sessions/787e46ba-42f2-436c-8859-a61460a84854
Copilot AI changed the title [WIP] Remove Python 3.8 and 3.9 compatibility code Remove Python 3.8/3.9 compatibility code Mar 20, 2026
Copilot AI requested a review from jaraco March 20, 2026 22:07
@jaraco jaraco closed this Mar 20, 2026
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.

Remove Python 3.8 and 3.9 compatibility code

2 participants