diff --git a/easy_annotate.py b/easy_annotate.py index 9fd97ca..5f389bd 100755 --- a/easy_annotate.py +++ b/easy_annotate.py @@ -252,14 +252,18 @@ def main(): parser.add_argument('easyconfig', nargs='?') args = parser.parse_args() + eb = None + args.lang = None if args.easyconfig: eb = FrameWork(args) - else: - print("provide a module nameModule with R-, or Python-") - sys.exit(1) - if eb.name == 'R': + args.lang = eb.lang + if eb.lang == 'Python': + args.pyver = eb.pyver + if eb.lang == 'R': + args.rver = eb.rver + if args.lang == 'R': R(eb, args.verbose) - elif eb.name == 'Python': + elif args.lang == 'Python': PythonExts(eb, args.verbose) else: print('easyanotate does not know how to process: {}'.format(eb.name)) diff --git a/easy_update.py b/easy_update.py index b707d1c..06be222 100755 --- a/easy_update.py +++ b/easy_update.py @@ -25,6 +25,9 @@ """ """ Release Notes +2.0.8.9 July 6, 2020 CNVkit, dependencies on both R and Python. fix bug so easy_update could + not determine language of exts_list. Fix base_path to find to of easyconfig + directory tree. Did not reconize R-bundel-Bioconductor as an R depenency, fixed. 2.0.8.8 June 9, 2020 fix R package dependency lookups. Support for "local_biocver" 2.0.8.7 Jan 26, 2020 Fix multi file dependency to support bundles 2.0.8.6 Oct 1, 2019 PR #17 merged from ccoulombe @@ -52,7 +55,7 @@ 2.0.8.2 Sept 20, 2019 - more bug fixes for --search. Fixed dependency issues when checking agaist easyconfigs with the search feature. - + 2.0.8.1 Sep 18, 2019 Bug fix - output_module was broken when framework was seperated from updateexts @@ -122,7 +125,7 @@ Release API: GET /pypi///json """ -__version__ = '2.0.8.8' +__version__ = '2.0.8.9' __maintainer__ = 'John Dey jfdey@fredhutch.org' diff --git a/framework.py b/framework.py index c4f5197..1004b6d 100755 --- a/framework.py +++ b/framework.py @@ -49,16 +49,16 @@ def __init__(self, args): self.modulename = None self.dep_exts = [] - full_path = os.path.dirname(args.easyconfig) - if full_path == '.' or full_path == '': - self.base_path = '.' - else: - (head, tail) = os.path.split(full_path) - while tail: - if 'easyconfig' in tail: - self.base_path = os.path.join(head, tail) - break - (head, tail) = os.path.split(head) + # find the top of the EasyConfig file structure + ECpath = os.path.dirname(args.easyconfig) + if ECpath == '.' or ECpath == '': + fullPath = os.path.join(os.getcwd(), args.easyconfig) + (head, tail) = os.path.split(fullPath) + while tail: + if 'easyconfig' in tail: + self.base_path = os.path.join(head, tail) + break + (head, tail) = os.path.split(head) # update EasyConfig exts_list or check single package if args.easyconfig: @@ -143,24 +143,23 @@ def parse_eb(self, file_name, primary): return eb def detect_language(self, eb): - """ R or Python? EasyConfig parameters: easyblock, name, versionsuffix + """ R or Python? EasyConfig parameters: easyblock or name + Test Case: CNVkit """ if eb.name == 'Python': self.lang = str(eb.name) self.interpolate['pyver'] = eb.version - return + if eb.easyblock == 'PythonPackage' or eb.easyblock == 'PythonBundle': + self.lang = 'Python' if eb.name == 'R': self.lang = str(eb.name) self.interpolate['rver'] = eb.version - return - if 'Python' in self.versionsuffix: - self.lang = 'Python' - return - if '-R' in self.versionsuffix: + if eb.easyblock == 'RPackage': self.lang = 'R' - return if self.defaultclass: self.lang = eb.exts_defaultclass.replace('Package', '') + if self.lang is None: + print('hmm, what languange?') def build_dep_filename(self, eb, dep): """build a filename from a dependencie object""" @@ -169,11 +168,8 @@ def build_dep_filename(self, eb, dep): dep_filename += dep[2] + '.eb' return dep_filename dep_filename += '-{}-{}'.format(eb.toolchain['name'],eb.toolchain['version']) - if self.pyver and len(dep) > 2: - versionsuffix = dep[2] % {'pyver': self.pyver} - dep_filename += '{}'.format(versionsuffix) - if self.rver and len(dep) > 2: - versionsuffix = dep[2] % {'rver': self.rver} + if len(dep) > 2: + versionsuffix = dep[2] % self.interpolate dep_filename += '{}'.format(versionsuffix) dep_filename += '.eb' return dep_filename @@ -203,14 +199,17 @@ def parse_dependencies(self, eb, lang): if dep[0] == 'Python': self.interpolate['pyver'] = dep[1] self.pyver = dep[1] + print('found Python {}'.format(self.pyver)) if dep[0] == 'R': self.interpolate['rver'] = dep[1] self.rver = dep[1] + print('found R-{}'.format(self.rver)) dep_filename = self.build_dep_filename(eb, dep) easyconfig = self.find_easyconfig(dep_filename) else: dep_filename = self.build_dep_filename(eb, dep) - if '-R-' in dep_filename or '-Python-' in dep_filename: + if 'R-' == dep_filename[0:2] or '-R-' in dep_filename or '-Python-' in dep_filename: + print('deubug - find Dep: {}'.format(dep_filename)) easyconfig = self.find_easyconfig(dep_filename) if easyconfig: sys.stderr.write(" - reading dependency: {}\n".format(