fix(poetry): skip if not installed with official script (#989)

* fix(poetry): skip if not installed with official script

* feat(poetry): add poetry_force_self_update config option

* docs: give this config a more detailed explanation

---------

Co-authored-by: Steve Lau <stevelauc@outlook.com>
This commit is contained in:
Andre Toerien
2024-12-07 09:09:52 +02:00
committed by GitHub
parent 4f4dcbb643
commit 305a5fbcae
3 changed files with 97 additions and 1 deletions

View File

@@ -229,6 +229,7 @@ pub struct Python {
enable_pip_review_local: Option<bool>,
enable_pipupgrade: Option<bool>,
pipupgrade_arguments: Option<String>,
poetry_force_self_update: Option<bool>,
}
#[derive(Deserialize, Default, Debug, Merge)]
@@ -1627,6 +1628,13 @@ impl Config {
.and_then(|python| python.enable_pip_review_local)
.unwrap_or(false)
}
pub fn poetry_force_self_update(&self) -> bool {
self.config_file
.python
.as_ref()
.and_then(|python| python.poetry_force_self_update)
.unwrap_or(false)
}
pub fn display_time(&self) -> bool {
self.config_file