remove import check for django in setup (#27)

unneeded now since the agent imports and sets up Django as part of it's
initial serving
This commit is contained in:
Josh Thomas 2024-12-12 20:03:48 -06:00 committed by GitHub
parent 9bbc2c2c3a
commit b13d19a4bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 21 additions and 104 deletions

View file

@ -1,7 +1,6 @@
mod packaging;
mod python;
pub use crate::packaging::ImportCheck;
pub use crate::packaging::PackagingError;
pub use crate::python::Python;
pub use crate::python::PythonError;

View file

@ -1,5 +1,5 @@
use djls_ipc::v1::*;
use djls_ipc::{ProcessError, PythonProcess, TransportError};
use djls_ipc::{ProcessError, TransportError};
use serde::Deserialize;
use std::collections::HashMap;
use std::fmt;
@ -69,40 +69,6 @@ impl fmt::Display for Packages {
}
}
#[derive(Debug, Deserialize)]
pub struct ImportCheck {
can_import: bool,
}
impl ImportCheck {
pub fn can_import(&self) -> bool {
self.can_import
}
pub fn check(
python: &mut PythonProcess,
_modules: Option<Vec<String>>,
) -> Result<bool, PackagingError> {
let request = messages::Request {
command: Some(messages::request::Command::CheckDjangoAvailable(
check::DjangoAvailableRequest {},
)),
};
let response = python
.send(request)
.map_err(|e| PackagingError::Transport(e))?;
match response.result {
Some(messages::response::Result::CheckDjangoAvailable(response)) => Ok(response.passed),
Some(messages::response::Result::Error(e)) => {
Err(PackagingError::Process(ProcessError::Health(e.message)))
}
_ => Err(PackagingError::Process(ProcessError::Response)),
}
}
}
#[derive(Debug, thiserror::Error)]
pub enum PackagingError {
#[error("IO error: {0}")]