diff --git a/.github/workflows/cargo-ci.yml b/.github/workflows/cargo-ci.yml index 84be88b3..c94bbe84 100644 --- a/.github/workflows/cargo-ci.yml +++ b/.github/workflows/cargo-ci.yml @@ -100,6 +100,11 @@ jobs: profile: minimal toolchain: stable override: true + - name: Install tarpaulin dependencies + run: | + echo "deb http://security.ubuntu.com/ubuntu xenial-security main" | sudo tee -a /etc/apt/sources.list \ + && sudo apt-get update \ + && sudo apt-get install libssl1.0.0 - uses: actions-rs/tarpaulin@v0.1 with: version: '0.9.0' diff --git a/cli/Cargo.toml b/cli/Cargo.toml index c978c923..76b2b731 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "whale" -version = "2.1.0-b1" +version = "2.1.0" authors = ["Robert Yi "] edition = "2018" @@ -16,7 +16,4 @@ serde = { version = "1.0", features = ["derive"] } serde_yaml = "0.8" shellexpand = "2.0.0" skim = "0.8.2" -termion = "1.5.5" -tui = "0.12.0" -tuikit = "=0.3.3" yaml-rust = "0.4" diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 700d2014..7f676c64 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1,5 +1,3 @@ -mod tuievent; - #[macro_use] extern crate lazy_static; use clap::ArgMatches; @@ -175,7 +173,7 @@ Fetching and rebasing local changes from github."); let run_script_path = filesystem::get_run_script_filename(); let arguments = format!("{} {}", sql_file, warehouse_name); let full_command = format!( - "source {} && {} {} {}", + ". {} && {} {} {}", activate_path, python_alias, run_script_path, arguments ); let mut child = Command::new("sh").args(&["-c", &full_command]).spawn()?; diff --git a/cli/src/tuievent.rs b/cli/src/tuievent.rs deleted file mode 100644 index 0d03d224..00000000 --- a/cli/src/tuievent.rs +++ /dev/null @@ -1,96 +0,0 @@ -#![allow(dead_code)] -use std::io; -use std::sync::mpsc; -use std::sync::{ - atomic::{AtomicBool, Ordering}, - Arc, -}; -use std::thread; -use std::time::Duration; - -use termion::event::Key; -use termion::input::TermRead; - -pub enum Event { - Input(I), - Tick, -} - -/// A small event handler that wrap termion input and tick events. Each event -/// type is handled in its own thread and returned to a common `Receiver` -pub struct Events { - rx: mpsc::Receiver>, - input_handle: thread::JoinHandle<()>, - ignore_exit_key: Arc, - tick_handle: thread::JoinHandle<()>, -} - -#[derive(Debug, Clone, Copy)] -pub struct Config { - pub exit_key: Key, - pub tick_rate: Duration, -} - -impl Default for Config { - fn default() -> Config { - Config { - exit_key: Key::Char('q'), - tick_rate: Duration::from_millis(250), - } - } -} - -impl Events { - pub fn new() -> Events { - Events::with_config(Config::default()) - } - - pub fn with_config(config: Config) -> Events { - let (tx, rx) = mpsc::channel(); - let ignore_exit_key = Arc::new(AtomicBool::new(false)); - let input_handle = { - let tx = tx.clone(); - let ignore_exit_key = ignore_exit_key.clone(); - thread::spawn(move || { - let stdin = io::stdin(); - for evt in stdin.keys() { - if let Ok(key) = evt { - if let Err(err) = tx.send(Event::Input(key)) { - eprintln!("{}", err); - return; - } - if !ignore_exit_key.load(Ordering::Relaxed) && key == config.exit_key { - return; - } - } - } - }) - }; - let tick_handle = { - thread::spawn(move || loop { - if tx.send(Event::Tick).is_err() { - break; - } - thread::sleep(config.tick_rate); - }) - }; - Events { - rx, - ignore_exit_key, - input_handle, - tick_handle, - } - } - - pub fn next(&self) -> Result, mpsc::RecvError> { - self.rx.recv() - } - - pub fn disable_exit_key(&mut self) { - self.ignore_exit_key.store(true, Ordering::Relaxed); - } - - pub fn enable_exit_key(&mut self) { - self.ignore_exit_key.store(false, Ordering::Relaxed); - } -} diff --git a/pipelines/setup.py b/pipelines/setup.py index 5efc2fea..bbfe4e85 100644 --- a/pipelines/setup.py +++ b/pipelines/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name="whale-pipelines", - version="2.l.0b1", + version="2.l.0", author="Robert Yi", author_email="robert@ryi.me", description="A pared-down metadata scraper + SQL runner.",