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 edd00d0 commit b2e20d0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 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,10 @@ async fn venv_impl(
find_default_python(cache).into_diagnostic()?
};

if interpreter.python_tuple() < (3, 8) {
warn_user!("uv is not officially compatible with Python 3.7 or lower")
}

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

0 comments on commit b2e20d0

Please sign in to comment.