Skip to content

Commit

Permalink
feat(python): display warning message when trying to use an unsupport…
Browse files Browse the repository at this point in the history
…ed Python version

Closes astral-sh#2587.
  • Loading branch information
stegayet committed Apr 1, 2024
1 parent 9df6e33 commit 2a62dc1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/uv/src/commands/venv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use uv_resolver::{InMemoryIndex, OptionsBuilder};
use uv_types::{
BuildContext, BuildIsolation, ConfigSettings, InFlight, NoBinary, NoBuild, SetupPyStrategy,
};
use uv_warnings::warn_user;

use crate::commands::ExitStatus;
use crate::printer::Printer;
Expand Down Expand Up @@ -113,6 +114,13 @@ async fn venv_impl(
find_default_python(cache).into_diagnostic()?
};

if interpreter.python_tuple() < (3, 8) {
warn_user!(
"uv is only compatible with Python 3.8+, found Python {}.",
interpreter.python_version()
);
}

writeln!(
printer.stderr(),
"Using Python {} interpreter at: {}",
Expand Down

0 comments on commit 2a62dc1

Please sign in to comment.