Skip to content

Commit

Permalink
fix(knime): specify package version per Knime version #8
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-gricourt committed Oct 21, 2022
1 parent 5728dfc commit b3a9ae2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ __pycache__
package.json
package-lock.json
node_modules
.coverage
.coverage
build
*.egg-info
9 changes: 9 additions & 0 deletions retropath2_wrapper/Args.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
DEFAULT_TIMEOUT = 60 # minutes
DEFAULT_KNIME_VERSION = '4.5.0'
DEFAULT_RP2_VERSION = 'r20220104'
KNIME_PACKAGE = {
'4.5.0': {
'org.knime.features.chem.types.feature.group': '4.5.0.v202107011901',
'org.knime.features.datageneration.feature.group': '4.5.0.v202107011901',
'org.knime.features.python.feature.group': '4.5.2.v202203041212',
'org.rdkit.knime.feature.feature.group': '4.5.0.v202207051536',
},
}
RETCODES = {
'OK': 0,
'NoError': 0,
Expand Down Expand Up @@ -96,6 +104,7 @@ def _add_arguments(parser):
parser.add_argument(
'--kver',
type=str,
choices=list(KNIME_PACKAGE.keys()),
default=DEFAULT_KNIME_VERSION,
help='version of KNIME (mandatory if --kexec is passed).',
)
Expand Down
26 changes: 12 additions & 14 deletions retropath2_wrapper/RetroPath2.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
DEFAULT_TIMEOUT,
DEFAULT_KNIME_VERSION,
DEFAULT_RP2_VERSION,
RETCODES
KNIME_PACKAGE,
RETCODES,
)

here = os_path.dirname(os_path.realpath(__file__))
Expand Down Expand Up @@ -577,21 +578,18 @@ def install_knime_pkgs(
logger.debug(f' + kpkg_install: {kpkg_install}')
logger.debug(f' + kver: {kver}')

args = \
' -application org.eclipse.equinox.p2.director' \
+ ' -nosplash -consolelog' \
+ ' -r http://update.knime.org/community-contributions/trunk,' \
args = [kexec]
args += ['-application', 'org.eclipse.equinox.p2.director']
args += ['-nosplash']
args += ['-consolelog']
args += ['-r', 'http://update.knime.org/community-contributions/trunk,' \
+ 'http://update.knime.com/community-contributions/trusted/'+kver[:3]+',' \
+ 'http://update.knime.com/analytics-platform/'+kver[:3] \
+ ' -i org.knime.features.chem.types.feature.group,' \
+ 'org.knime.features.datageneration.feature.group,' \
+ 'org.knime.features.python.feature.group,' \
+ 'org.rdkit.knime.feature.feature.group' \
+ ' -bundlepool ' + kpkg_install + ' -d ' + kpkg_install
+ 'http://update.knime.com/analytics-platform/'+kver[:3]]
args += ['-i', ','.join([x + '/' + y for x, y in KNIME_PACKAGE[kver].items()])]
args += ['-bundlepool', kpkg_install]
args += ['-d', kpkg_install]

cmd = f'{kexec} {args}'

returncode = subprocess_call(cmd, logger=logger)
returncode = subprocess_call(" ".join(args), logger=logger)
StreamHandler.terminator = "\n"
logger.info(' OK')
return returncode
Expand Down

0 comments on commit b3a9ae2

Please sign in to comment.