From a61364fe4bec6e73c3c77d0c7b0de56e4f727253 Mon Sep 17 00:00:00 2001 From: David O'Connor Date: Fri, 20 Sep 2019 13:38:31 +0000 Subject: [PATCH] 0.1.0 release --- CHANGELOG.md | 1 + src/py_versions.rs | 10 ++++++---- src/util.rs | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8cd9ec..82bdd9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## v0.1.0 - Installing Python binaries now works correctly on Windows, Ubuntu≥18.4, and Debian - Running `pyflow` with no arguments now runs a Python REPL +- Made error messages more detailed ## v0.0.4 - Renamed from `pypackage` to `pyflow` diff --git a/src/py_versions.rs b/src/py_versions.rs index f1ef8d0..31ecf53 100644 --- a/src/py_versions.rs +++ b/src/py_versions.rs @@ -21,16 +21,18 @@ enum PyVers { /// Reduces code repetition for error messages related to Python binaries we don't support. fn abort_helper(version: &str, os: &str) { util::abort(&format!( - "Installing Python {} on {} is currently unsupported. If you'd like\ - to use this version of Python, please install it directly.", + "Automatic installation of Python {} on {} is currently unsupported. If you'd like \ + to use this version of Python, please install it.", version, os )) } impl From<(Version, Os)> for PyVers { fn from(v_o: (Version, Os)) -> Self { + let unsupported = "Unsupported python version requested; only Python ≥ 3.4 is supported. \ + to fix this, edit the `python_version` line of `pyproject.toml`, or run `pyflow switch 3.7`"; if v_o.0.major != 3 { - util::abort("Unsupported python version requested; only Python ≥ 3.4 is supported"); + util::abort(unsupported); unreachable!() } // todo: Handle non Ubuntu/Debian @@ -71,7 +73,7 @@ impl From<(Version, Os)> for PyVers { } }, _ => { - util::abort("Unsupported python version requested; only Python >=3.4 is supported"); + util::abort(unsupported); unreachable!() } } diff --git a/src/util.rs b/src/util.rs index ac0a585..8d84747 100644 --- a/src/util.rs +++ b/src/util.rs @@ -353,6 +353,7 @@ pub fn extract_zip(file: &fs::File, out_path: &Path, rename: &Option<(String, St } pub fn unpack_tar_xz(archive_path: &Path, dest: &Path) { + println!("Path: {:?}, {:?}", archive_path, dest); let archive_bytes = fs::read(archive_path).expect("Problem reading archive as bytes"); let mut tar: Vec = Vec::new();