From 1d6be3bc05b2acdf42486b43864d8b18d8b25541 Mon Sep 17 00:00:00 2001 From: pirovc <4673375+pirovc@users.noreply.github.com> Date: Fri, 28 Apr 2023 15:54:56 +0200 Subject: [PATCH] v1.5.1 fix path script build-custom (#246) * v1.5.1 fix path script build-custom * gu v0.6.1 --- CMakeLists.txt | 2 +- libs/genome_updater | 2 +- setup.py | 2 +- src/ganon/config.py | 22 ++++++++++------------ 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 078ae5fa..a41ee0ff 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ # ============================================================================= cmake_minimum_required( VERSION 3.10 FATAL_ERROR ) -project( ganon VERSION 1.5.0 LANGUAGES CXX ) +project( ganon VERSION 1.5.1 LANGUAGES CXX ) # ----------------------------------------------------------------------------- # build setup diff --git a/libs/genome_updater b/libs/genome_updater index a512fae6..077e4aee 160000 --- a/libs/genome_updater +++ b/libs/genome_updater @@ -1 +1 @@ -Subproject commit a512fae629fb0732d1b9e9c4837968dcbcd23f3d +Subproject commit 077e4aee4dc9e2019477e4a8bbd41227d52f92db diff --git a/setup.py b/setup.py index d28b1b4e..483d8570 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def read(filename): setup( name="ganon", - version="1.5.0", + version="1.5.1", url="https://www.github.com/pirovc/ganon", license='MIT', author="Vitor C. Piro", diff --git a/src/ganon/config.py b/src/ganon/config.py index 440b6c1b..4a59a16e 100644 --- a/src/ganon/config.py +++ b/src/ganon/config.py @@ -8,7 +8,7 @@ class Config: - version = "1.5.0" + version = "1.5.1" path_exec = {"build": "", "classify": "", "get_seq_info": "", "genome_updater": ""} empty = False @@ -463,15 +463,8 @@ def validate(self): def set_paths(self): missing_path = False self.ganon_path = self.ganon_path + "/" if self.ganon_path else "" - if self.which in ["build", "update"]: - ganon_get_seq_info_paths = [self.ganon_path, self.ganon_path+"scripts/", self.ganon_path+"../scripts/"] if self.ganon_path else [None, "scripts/"] - for p in ganon_get_seq_info_paths: - self.path_exec["get_seq_info"] = shutil.which("ganon-get-seq-info.sh", path=p) - if self.path_exec["get_seq_info"] is not None: break - if self.path_exec["get_seq_info"] is None: - print_log("ganon-get-seq-info.sh script was not found. Please inform a specific path with --ganon-path") - missing_path = True + if self.which in ["build", "update", "build-custom"]: ganon_genome_updater_paths = [self.ganon_path, self.ganon_path+"libs/genome_updater/", self.ganon_path+"../libs/genome_updater/"] if self.ganon_path else [None, "libs/genome_updater/"] for p in ganon_genome_updater_paths: self.path_exec["genome_updater"] = shutil.which("genome_updater.sh", path=p) @@ -480,8 +473,14 @@ def set_paths(self): print_log("genome_updater.sh was not found. Please inform a specific path with --ganon-path") missing_path = True + ganon_get_seq_info_paths = [self.ganon_path, self.ganon_path+"scripts/", self.ganon_path+"../scripts/"] if self.ganon_path else [None, "scripts/"] + for p in ganon_get_seq_info_paths: + self.path_exec["get_seq_info"] = shutil.which("ganon-get-seq-info.sh", path=p) + if self.path_exec["get_seq_info"] is not None: break + if self.path_exec["get_seq_info"] is None: + print_log("ganon-get-seq-info.sh script was not found. Please inform a specific path with --ganon-path") + missing_path = True - if self.which in ["build-custom"]: # if path is given, look for binaries only there ganon_build_paths = [self.ganon_path, self.ganon_path+"build/"] if self.ganon_path else [None, "build/"] for p in ganon_build_paths: @@ -491,7 +490,7 @@ def set_paths(self): print_log("ganon-build binary was not found. Please inform a specific path with --ganon-path") missing_path = True - if self.hibf: + if hasattr(self, 'hibf') and self.hibf: self.raptor_path = self.raptor_path + "/" if self.raptor_path else "" raptor_paths = [self.raptor_path, self.raptor_path+"build/bin/"] if self.raptor_path else [None, "build/"] for p in raptor_paths: @@ -501,7 +500,6 @@ def set_paths(self): print_log("raptor binary was not found. Please inform a specific path with --raptor-path") missing_path = True - if self.which in ["classify"]: ganon_classify_paths = [self.ganon_path, self.ganon_path+"build/"] if self.ganon_path else [None, "build/"] for p in ganon_classify_paths: