Skip to content

fix(core/exec): apply project virtualenv env to Python commands#564

Open
cbusillo wants to merge 1 commit intojust-every:mainfrom
cbusillo:code-python-runtime-exec
Open

fix(core/exec): apply project virtualenv env to Python commands#564
cbusillo wants to merge 1 commit intojust-every:mainfrom
cbusillo:code-python-runtime-exec

Conversation

@cbusillo
Copy link

Summary

  • detect Python-family commands before exec, including simple bash -lc and sh -c wrappers
  • prepend the nearest project .venv or venv to PATH and export VIRTUAL_ENV for those commands
  • add unit coverage for command detection and env injection

Why

The validator side was only half the story. Even with patch-harness fixes in place, direct exec commands could still miss the repo's virtualenv and fall back to whatever global Python tooling was installed on the machine. This makes python, pytest, mypy, pyright, and similar commands run in the project env when one is available.

Testing

  • ./build-fast.sh
  • cargo test -p code-core codex::exec::tests

@cbusillo cbusillo marked this pull request as ready for review March 17, 2026 01:59
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a839d645e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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