Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: better warning when venv auto create is skipped #3573

Merged
merged 1 commit into from
Dec 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/config/env_directive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,18 @@ impl EnvResults {
.into_iter()
.chain(env::split_paths(&env_vars[&*PATH_KEY]))
.collect::<Vec<_>>();
if ts
let missing = ts
.list_missing_versions()
.iter()
.any(|tv| tv.ba().tool_name == "python")
{
debug!("python not installed, skipping venv creation");
.any(|tv| tv.ba().tool_name == "python");
if missing {
warn!(
"no venv found at: {p}\n\n\
mise will automatically create the venv once all requested python versions are installed.\n\
To install the missing python versions and create the venv, please run:\n\
mise install",
p = display_path(&venv)
);
} else {
let has_uv_bin =
ts.which("uv").is_some() || which_non_pristine("uv").is_some();
Expand Down Expand Up @@ -355,7 +361,8 @@ impl EnvResults {
"VIRTUAL_ENV".into(),
(venv.to_string_lossy().to_string(), Some(source.clone())),
);
} else {
} else if !create {
// The create "no venv found" warning is handled elsewhere
warn!(
"no venv found at: {p}\n\n\
To create a virtualenv manually, run:\n\
Expand Down
Loading