Skip to content

🐛 fix(create): let creator plugins handle Python older than 3.10 - #3792

Draft
Daemonratte wants to merge 1 commit into
pypa:mainfrom
Daemonratte:plugin-older-targets
Draft

Daemonratte wants to merge 1 commit into
pypa:mainfrom
Daemonratte:plugin-older-targets

Conversation

@Daemonratte

Copy link
Copy Markdown

virtualenv 21.16.0 raises for a target older than Python 3.10 before it asks the creator plugins (#3789). Up to 21.15 the plugins were asked, and the bundled seeder's error pointed to "a seeder that provides Python X wheels" for such a target. So a creator plugin that, together with its own seeder, creates environments for an interpreter virtualenv's own creators do not support stopped working with 21.16.0, without a deprecation.

This keeps the 3.10 floor for virtualenv's own creators. For an older target, the selection skips the creators that live in virtualenv, recognized by their module as the plugin loader already does for name collisions, and raises the same error when no creator plugin accepts the target. Without such a plugin, behavior and message are unchanged.

Tested:

  • test_creator_plugin_handles_python_39_target fails without the change; test_rejects_python_39_target still passes.

  • The unit suite passes on CPython 3.10, 3.13 and 3.15 on Linux, except for tests that fail on main here as well (test_copied_seed_is_writable_from_read_only_image with umask 002, and on 3.10 test_discovery_fallback_ok and test_absolute_path_does_not_exist).

  • With a real CPython 3.9, virtualenv still refuses, with and without --no-seed, and leaves no directory behind.

  • A third-party creator and seeder plugin for an older interpreter creates environments again, also through tox.

  • ran the linter to address style issues (the pre-commit hooks on the changed files)

  • wrote descriptive pull request text

  • ensured there are test(s) validating the fix

  • added a docs/changelog/+short-description.<type>.rst fragment for each user-facing change, or applied skip news

  • updated/extended the documentation

  • for changes to activation scripts, pyvenv.cfg, wheel downloads, app-data or release workflows: not applicable

  • ran tests on Python 3.10 and 3.15

  • linked upstream issues beside any temporary interpreter overrides: not applicable

  • kept the PR in draft until CI passes

21.16.0 raises for a target older than Python 3.10 before it asks the
creator plugins, so a plugin that creates environments for an
interpreter virtualenv's own creators do not support stopped working,
without a deprecation. Up to 21.15 the plugins were asked, and the
seeder's error pointed to a seeder that ships wheels for the target.

Skip virtualenv's own creators for such a target instead, recognized by
their module as the plugin loader does, and raise the same error when no
creator plugin accepts it. Without such a plugin nothing changes.

This branch has not been deployed

No deployments
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.

1 participant