Skip to content

feat: add venv-path input for custom virtual environment location - #736

Closed
seemethere wants to merge 2 commits into
astral-sh:mainfrom
seemethere:seemethere/add_custom_venv_path
Closed

seemethere wants to merge 2 commits into
astral-sh:mainfrom
seemethere:seemethere/add_custom_venv_path

Conversation

@seemethere

@seemethere seemethere commented Jan 20, 2026 •

Copy link
Copy Markdown

Allow users to specify a custom path for the virtual environment when using activate-environment. This is useful for CI workflows that need to create isolated venvs outside the working directory (e.g., in $RUNNER_TEMP) to avoid conflicts with project-level configurations.

When venv-path is not specified, the default behavior remains unchanged (.venv in the working directory).

Also adds a CI test for this

Allow users to specify a custom path for the virtual environment when
using activate-environment. This is useful for CI workflows that need
to create isolated venvs outside the working directory (e.g., in
$RUNNER_TEMP) to avoid conflicts with project-level configurations.

When venv-path is not specified, the default behavior remains unchanged
(.venv in the working directory).
@seemethere
seemethere force-pushed the seemethere/add_custom_venv_path branch from 9b64ecf to c193917 Compare January 20, 2026 21:20
Comment thread src/setup-uv.ts Outdated
core.info("Activating python venv...");
await exec.exec("uv", execArgs);
// Use custom venv path if provided, otherwise default to .venv in working directory
const venvPath =

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's move that to getVenvPath to encapsulate all logic there

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed!

Signed-off-by: Eli Uriegas <[email protected]>
Comment thread src/setup-uv.ts
}
}

function getVenvPath(): string {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a reason I am not seeing why the logic of this function cannot fully move to inputs.ts?

eifinger added a commit that referenced this pull request Feb 4, 2026
Allow customizing the venv location while preserving working-directory
semantics via --directory.

Supersedes: #736
@eifinger eifinger closed this Feb 4, 2026
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