From ecdbc0b100cc50adffb1262ab485837d5dd2f709 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 13 Apr 2021 10:46:37 +0300 Subject: feat: support Python projects --- src/project.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/project.rs') diff --git a/src/project.rs b/src/project.rs index 9f45363..e67fefc 100644 --- a/src/project.rs +++ b/src/project.rs @@ -1,11 +1,13 @@ use crate::debian::Debian; use crate::errors::BumperError; +use crate::python::Python; use crate::rust::Rust; use std::path::Path; pub enum ProjectKind { Rust(Rust), Debian(Debian), + Python(Python), } impl ProjectKind { @@ -21,6 +23,10 @@ impl ProjectKind { kinds.push(ProjectKind::Debian(p)); } + if let Ok(p) = Python::new(dirname) { + kinds.push(ProjectKind::Python(p)); + } + if kinds.is_empty() { Err(BumperError::UnknownProjectKind(dirname.to_path_buf())) } else { @@ -32,6 +38,7 @@ impl ProjectKind { match self { Self::Rust(ref mut rust) => rust.set_version(version)?, Self::Debian(ref mut debian) => debian.set_version(version)?, + Self::Python(ref mut python) => python.set_version(version)?, } Ok(()) } -- cgit v1.2.1