diff --git a/src/plugins/core/python.rs b/src/plugins/core/python.rs index f7167f4bc..d716df138 100644 --- a/src/plugins/core/python.rs +++ b/src/plugins/core/python.rs @@ -45,6 +45,7 @@ impl PythonPlugin { .join("plugins/python-build/bin/python-build") } fn install_or_update_python_build(&self) -> eyre::Result<()> { + ensure_not_windows()?; if self.python_build_path().exists() { self.update_python_build() } else { @@ -139,11 +140,13 @@ impl PythonPlugin { Some((_, tag, filename)) => (tag, filename), None => { if cfg!(windows) || Settings::get().python_compile == Some(false) { - hint!( - "python_compile", - "To compile python from source, run", - "mise settings set python_compile 1" - ); + if !cfg!(windows) { + hint!( + "python_compile", + "To compile python from source, run", + "mise settings set python_compile 1" + ); + } bail!( "no precompiled python found for {} on {}-{}", ctx.tv.version, @@ -158,12 +161,14 @@ impl PythonPlugin { } }; - hint!( - "python_precompiled", - "installing precompiled python from indygreg/python-build-standalone\n\ - if you experience issues with this python (e.g.: running poetry), switch to python-build by running", - "mise settings set python_compile 1" - ); + if cfg!(unix) { + hint!( + "python_precompiled", + "installing precompiled python from indygreg/python-build-standalone\n\ + if you experience issues with this python (e.g.: running poetry), switch to python-build by running", + "mise settings set python_compile 1" + ); + } let url = format!( "https://github.com/indygreg/python-build-standalone/releases/download/{tag}/{filename}" @@ -433,3 +438,10 @@ fn python_arch(settings: &Settings) -> &str { built_info::CFG_TARGET_ARCH } } + +fn ensure_not_windows() -> eyre::Result<()> { + if cfg!(windows) { + bail!("python can not currently be compiled on windows"); + } + Ok(()) +}