Skip to content

Commit

Permalink
v1.5.1 fix path script build-custom (#246)
Browse files Browse the repository at this point in the history
* v1.5.1 fix path script build-custom

* gu v0.6.1
  • Loading branch information
pirovc authored Apr 28, 2023
1 parent 6b264de commit 1d6be3b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
22 changes: 10 additions & 12 deletions src/ganon/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 1d6be3b

Please sign in to comment.