DESIGN: virtualenv-only core + out-of-tree env backends - #1599
Draft
HaoZeke wants to merge 18 commits into
Draft
Conversation
Add asv.envmgmt (protocol, pure matrix helpers, identity fingerprints, facade, virtualenv adapter preview) and a development design note for separating matrix iteration from tool backends. Conf schema unchanged; production Environment path untouched. Focused tests only (no full env matrix suite). Draft-PR material for review—not for merge yet.
Assert plugin-free imports via AST rather than raw source substring so docstrings may mention legacy wiring without failing the suite.
Use Path.read_text so pytest 9 on Python 3.14 does not treat an unclosed open() as a failure via PytestUnraisableExceptionWarning.
Remove docs/source/development/environment_backend_extract.md from the spike branch; design lives in internal notes only. Code preview (asv.envmgmt + focused tests) remains for the draft PR.
Move former in-tree conda/rattler/uv backends into installable plugin packages under plugin_packages/. Teach PluginManager.import_plugin to import absolute module names so conf "plugins": ["asv_conda"] works. Add asv_mamba wrapper (prefers mamba CLI). Integration tests load all plugins alongside core virtualenv.
Singleton load_plugins was dropped during the virtualenv-only rewrite and broke conf plugins. Conftest conda lock monkeypatch targets asv_conda when installed. Failed plugin imports now raise instead of failing silently.
Document that conda remains the primary CLI/shell backend while libmamba/rattler/pixi (and future uv APIs) should be library-oriented. Add a non-functional asv_pixi package skeleton for environment_type pixi.
- asv_mamba: libmambapy only (no conda CLI fallback) - asv_rattler: py-rattler solve/install (unchanged API path) - asv_pixi: environment_type pixi on top of asv_rattler APIs (not pixi CLI) - asv_uv: stdlib venv + python -m pip (no uv CLI); CLI is not a stable API - asv_conda: remains the shell/CLI backend Registration tests updated for all plugin packages.
Remove plugin_packages/ from the ASV tree. Optional backends live in separate repositories (asv_env_conda, asv_env_mamba, asv_env_rattler, asv_env_uv, asv_env_pixi). Load entry points group asv.plugins when present; conf plugins still list module names like asv_env_conda.
Conf plugins and entry points use the shared asv_env_* package names from HaoZeke repos, not vendored asv_conda modules.
Resolve backends via ensure_environment_backend / ensure_conf_backends: conf plugins, asv.plugins entry points by type name, then conventional asv_env_<type> modules. Fail closed when a packaged backend is present but broken or does not register the expected tool_name. Command and library callers share the same path; no import-time swallowed EPs.
Rework the design branch toward the target architecture: resolve environment_type via asv.environment_backends entry points with fail-closed multi-provider errors, generic install hints (no personal org URLs), empty type defaulting to virtualenv, and legacy asv_env_* module import only when ASV_ENV_LEGACY_MODULE_FALLBACK is set. Restore optional in-tree conda/rattler/uv bootstrap (additive Stage 1) while keeping third-party packages discoverable through the same path.
Core keeps only virtualenv (and existing). Optional environment backends
resolve solely through asv.environment_backends entry points (asv_env_*
and third parties). Remove asv.plugins.{conda,rattler,uv} and re-point
tests/conftest accordingly.
Wire asv[conda|mamba|rattler|uv|pixi] to out-of-tree providers, document drop-in install, and add matrix_layers capability model for airspeed-velocity#1542/airspeed-velocity#1543/airspeed-velocity#1436.
Document pixi pip+ handling in env_backends docs with the extras bump.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Draft — not for merge until reviewed.
Core ASV keeps only
virtualenvandexisting. Optional environment backends are out-of-tree packages discovered via a single host API:asv.envmgmt.discover.ensure_environment_backend/get_environment_class_by_nameasv.environment_backends(EP name =tool_name)environment_type→virtualenvasv_env_<type>module import only ifASV_ENV_LEGACY_MODULE_FALLBACKis setThere is no in-tree
asv.plugins.{conda,rattler,uv}.Companion packages (providers)
environment_typecondarattleruvuv.find_uv_bin+uv venv/uv pipmambapixipixi.toml+ install){ "environment_type": "uv" }Test plan
asv.plugins.conda|rattler|uvmodulesasv_env_*), notasv.plugins.*Refs #1542, #1436, #1543