Skip to content

Skip installed inline dependencies#49

Merged
tobim merged 3 commits into
mainfrom
skip-installed-inline-deps
May 27, 2026
Merged

Skip installed inline dependencies#49
tobim merged 3 commits into
mainfrom
skip-installed-inline-deps

Conversation

@tobim
Copy link
Copy Markdown
Member

@tobim tobim commented May 26, 2026

🔍 Problem

  • Inline dependencies for Python tests and project fixtures are always installed with uv pip install.
  • Pre-provisioned environments, such as Nix checks, may already provide those packages through the active Python environment.
  • In those environments, attempting a runtime install can fail before fixture loading reaches test selection.
  • Some callers also need a hard opt-out when they manage dependency provisioning themselves.

🛠️ Solution

  • Treat bare inline dependency names as satisfied when importlib.metadata can find an installed distribution.
  • Add TENZIR_TEST_DISABLE_INLINE_DEPENDENCY_INSTALL to skip inline dependency installation entirely.
  • Delay the uv lookup until there are actual missing dependencies to install.
  • Preserve the existing behavior for versioned requirement strings by default, which still go through uv.
  • Add tests for the pre-installed bare dependency path, the explicit opt-out, and the versioned requirement path.
  • Document the behavior and add an unreleased changelog entry.

💬 Review

  • The installed-package check is intentionally conservative: only bare package names are skipped.
  • The environment variable is a caller-controlled escape hatch; fixture imports can still fail later if required packages are not actually present.
  • Requirement specifier handling remains delegated to uv unless installation is explicitly disabled.
📚 Docs PR: tenzir/docs#361

@tobim tobim requested a review from mavam May 26, 2026 19:24
Comment thread changelog/unreleased/installed-inline-fixture-dependencies.md Outdated
Inline dependency installation now treats bare package names that are already visible to the running Python environment as satisfied. This lets pre-provisioned environments such as Nix checks load fixture metadata without attempting network installs.

Set TENZIR_TEST_DISABLE_INLINE_DEPENDENCY_INSTALL to skip inline dependency installation entirely when the caller manages the environment itself. Versioned requirement strings still go through uv by default, so existing dependency resolution behavior is preserved.

Assisted-by: GPT-5 (Codex)
@tobim tobim force-pushed the skip-installed-inline-deps branch from 2116cdd to 201228c Compare May 27, 2026 07:22
@tobim tobim enabled auto-merge (squash) May 27, 2026 10:34
@mavam mavam disabled auto-merge May 27, 2026 10:35
@mavam mavam enabled auto-merge (squash) May 27, 2026 10:36
@mavam
Copy link
Copy Markdown
Member

mavam commented May 27, 2026

@tobim Why did you undo my addition of the changelog entry and the docs fix? Did you force-push accidentally?

@mavam mavam disabled auto-merge May 27, 2026 12:00
@tobim
Copy link
Copy Markdown
Member Author

tobim commented May 27, 2026

@tobim Why did you undo my addition of the changelog entry and the docs fix? Did you force-push accidentally?

My agent did without asking :(.

Copy link
Copy Markdown
Member

mavam commented May 27, 2026

Then please redo the changes yourself, I deleted my branch already.

Document how pre-provisioned environments interact with inline Python dependencies and add the unreleased changelog entry for the installation opt-out.

Assisted-by: GPT-5 (Codex)
Let tenzir-test disable runtime installation of inline Python dependencies from the CLI. The flag scopes the existing environment control to the current invocation and applies to regular and standalone fixture mode.

Assisted-by: GPT-5 (Codex)
@tobim tobim merged commit 2eb1198 into main May 27, 2026
5 checks passed
@tobim tobim deleted the skip-installed-inline-deps branch May 27, 2026 13:31
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.

2 participants