Skip to content

Drop support for Python 3.8 and 3.9 - #622

Merged
mdickinson merged 2 commits into
mainfrom
drop-python-38-39
Aug 5, 2026
Merged

mdickinson merged 2 commits into
mainfrom
drop-python-38-39

Conversation

@mdickinson

Copy link
Copy Markdown
Member

Closes #616.

Envisage now requires Python 3.10 or later.

Changes

  • requires-python is bumped to >= 3.10, and the conditional
    importlib-resources dependency is dropped. importlib.resources has
    provided files and as_file since 3.9, so the five
    try/except ImportError import blocks become plain imports.
  • HTTPResourceProtocol.file closes the caught HTTPError
    unconditionally again. The exc.fp is not None guard added in Clean up warnings and log noise from the test suite #618 was
    needed only because close() raised KeyError: 'file' on 3.8 and 3.9
    when the error had no fp; on 3.10+ self.fp becomes an io.BytesIO
    and close() works.
  • The EDM runtime lists in etstool.py and the two EDM workflows lose
    3.8, leaving 3.11. The linux_runtime_platform mapping and the
    --platform flag it fed go with it: they existed only to select
    rh7_x86_64 for the 3.8 runtime, and 3.11 uses EDM's default
    rh8_x86_64. The macos-latest / 3.8 matrix exclusions go too.
  • The test-with-pypi matrix drops 3.8, leaving 3.10 through 3.14.
  • The stale comment explaining that PySide2 and PyQt5 are unavailable for
    EDM + Python 3.8 is removed.

The existing pkg_resources entry in CHANGES.rst described
importlib-resources as a backport for Python 3.8, which is no longer
true, so that parenthetical is edited out rather than left to contradict
the new entry.

Verification

  • pytest: 171 passed, 7 skipped (no toolkit installed) on both 3.15 and
    a clean 3.10 environment.
  • python -W default -m unittest discover -t . -s envisage: 178 tests OK,
    no new warnings.
  • test_resource_manager under -W error on 3.10, to confirm the
    unguarded exc.close() is safe there.
  • black --check, isort --check, flake8 clean.
  • python -m build plus twine check --strict pass; the wheel metadata
    reports Requires-Python: >=3.10 and no importlib-resources in
    Requires-Dist.

One point for review

The EDM matrices are now single-runtime, since 3.8 was the only other
entry. available_runtimes, supported_combinations and the --runtime
option are all still in place, so adding a runtime is a one-line change.
If EDM offers something newer than 3.11 it would be worth adding here,
rather than leaving the EDM jobs covering a single version.

🤖 Generated with Claude Code

mdickinson and others added 2 commits August 5, 2026 14:49
Envisage now requires Python 3.10 or later.

- `requires-python` is bumped to `>= 3.10`, and the conditional
  `importlib-resources` dependency is dropped: `importlib.resources`
  provides `files` and `as_file` from 3.9 onwards, so the five
  `try`/`except ImportError` import blocks become plain imports.
- `HTTPResourceProtocol.file` closes the caught `HTTPError`
  unconditionally again; the `exc.fp is not None` guard added in #618
  was only needed for 3.8 and 3.9.
- The EDM runtime lists in etstool.py and the two EDM workflows lose
  3.8, leaving 3.11. The `linux_runtime_platform` mapping goes with it:
  it existed only to select `rh7_x86_64` for the 3.8 runtime, and 3.11
  uses EDM's default `rh8_x86_64`. The macOS/3.8 matrix exclusions go
  too.
- The test-with-pypi matrix drops 3.8, leaving 3.10 through 3.14.

Closes #616

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
uv.lock is a generated local development artifact and has never been
tracked in this repository. It was picked up unintentionally when the
previous commit was staged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Envisage to require Python 3.10+ (dropping 3.8 and 3.9), simplifying resource imports now that importlib.resources is always available, and aligning CI/EDM tooling with the supported runtimes.

Changes:

  • Bump requires-python to >= 3.10 and remove the conditional importlib-resources dependency.
  • Replace try/except ImportError fallbacks with direct importlib.resources imports across code and tests; simplify HTTPResourceProtocol.file cleanup logic for 3.10+.
  • Update EDM tooling and GitHub Actions matrices to remove Python 3.8/3.9 coverage and adjust related workflow logic/docs.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
README.rst Updates documented supported Python version to 3.10+.
pyproject.toml Sets requires-python >= 3.10 and drops importlib-resources dependency.
etstool.py Removes 3.8 runtime/platform handling; defaults EDM runtime to 3.11.
envisage/ui/tasks/tests/test_tasks_application.py Simplifies importlib.resources import usage.
envisage/tests/test_core_plugin.py Simplifies importlib.resources imports for tests.
envisage/resource/tests/test_resource_manager.py Simplifies importlib.resources imports for tests.
envisage/resource/package_resource_protocol.py Removes backport fallback; uses importlib.resources directly.
envisage/resource/http_resource_protocol.py Unconditionally closes HTTPError (safe for 3.10+).
envisage/examples/_etsdemo_info.py Removes backport fallback; uses importlib.resources directly.
CHANGES.rst Records Python support drop and dependency removal in release notes.
.github/workflows/test-with-pypi.yml Drops 3.8 from PyPI test matrix.
.github/workflows/test-with-edm.yml Drops 3.8 runtime from EDM test matrix and related exclusions.
.github/workflows/ets-from-source.yml Drops 3.8 runtime from ETS-from-source EDM matrix and related exclusions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mdickinson
mdickinson merged commit ce488f6 into main Aug 5, 2026
15 checks passed
@mdickinson
mdickinson deleted the drop-python-38-39 branch August 5, 2026 14:03
mdickinson added a commit that referenced this pull request Aug 5, 2026
A review of the 8.0.0 changelog against `7.0.4..main`. 7.0.4 was tagged
directly on main — `0c02d0b` is both the tag commit and the merge-base —
so
that range is exact. It holds 30 non-merge commits: 11 touching the
library or
packaging, 19 CI and infrastructure.

## The library side was already complete

All eight substantive changes had entries, and both deprecations 7.0.0
promised
to remove in 8.0 (#540, #544) are removed and listed. No
`DeprecationWarning`
remains anywhere in the library, so nothing is left dangling for 9.0.

## References now point at PRs, not issues

The two `Fixes` entries for the `HTTPError` leak cited #615, whose title
is
"Clean up test noise from warnings and WARNING-level log messages". The
leak was
found *via* that cleanup, but a reader following the reference lands on
a
test-hygiene issue rather than a resource-leak fix.

Rather than fix those two in isolation, every reference in the section
now
points at the PR that made the change: #574→#613, #616→#622, #548→#599,
#547→#612, #614→#617, and #615→#618/#619/#621 as appropriate. This also
supplies
the reference the `pkg_resources` entry was missing — #600, the PR,
rather than
#515, the issue.

Two notes:

- The "no longer writes `WARNING`-level log messages" entry cites
**both** #618
and #621. #618 deliberately deferred the four `envisage.ui.tasks.tasks`
records from the `TasksApplication` tests to a follow-up, so the claim
only
  became true once #621 landed.
- Sections for 7.0.4 and earlier are untouched; they already cite PRs.

## CI and build work added

Nineteen PRs had no entry at all, in contrast with 7.0.4, which listed
its
action bumps and copyright-header updates under `Build`. Five new
entries cover
them, aggregated where the work was one theme:

| Entry | PRs |
| --- | --- |
| Trusted publishing (OIDC) and SHA-pinned actions | #604, #608 |
| Copyright end years, and the year-rollover fix to the style check |
#596, #597, #607 |
| GitHub Action bumps | #591, #592, #593, #594, #595, #602, #603, #605,
#606, #609, #610 |
| Pre-release Pythons in the CI matrix | #601, #624 |
| `AGENTS.md` | #598, #626 |

Trusted publishing changes how releases are authenticated, so it seemed
worth
naming rather than folding into the general CI churn.

## Judgment calls worth a second opinion

**The CI matrix entry names no versions.** It reads "now includes
pre-release
Python versions" rather than "3.14, and 3.15 pre-releases". Naming them
is more
informative, but in a section whose `Removals` entry deliberately gives
no
upper bound on supported Pythons, a `Build` line ending in "3.15"
invites
exactly the reading that bound was left out to avoid. Easy to change if
you'd
rather have the numbers.

**No upper bound on Python versions.** Considered and rejected: it means
churn
on every Python release, and forwards compatibility is the reasonable
default
expectation for a package that runs warning-free on the current version.

**Deliberate omissions.** #626's other cleanups — an `IServiceRegistry`
docstring, the legacy examples README, dead Traits<6.0 test code —
change
nothing for users. There's no `Documentation` section because the doc
edits in
#599 are just the egg-manager material going away with the classes,
already
covered by the `Removals` entry. And `CorePlugin` gaining its own
`stop()` to
unregister service offers is an implementation move; the #617 entry
already
notes that `PluginActivator` no longer calls
`register_services`/`unregister_services`, which is the part a
downstream
`Plugin` subclass would notice.

## Left to the release PR

The `Released:` date line, an introductory paragraph, a "Thanks to:"
list, and
the `version = '7.0.4'` still in `pyproject.toml`. The date isn't
settled yet.

## Verification

`CHANGES.rst` parses under docutils with no warnings at report level 2
or above,
and all lines stay within 79 characters. Changelog only — no code
touched.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

Drop support for Python 3.8 and 3.9

2 participants