Skip to content

added option use_pip_for_deps for pythonpackages#1366

Merged
boegel merged 3 commits intoeasybuilders:developfrom
pescobar:pip_install_deps
Feb 26, 2018
Merged

added option use_pip_for_deps for pythonpackages#1366
boegel merged 3 commits intoeasybuilders:developfrom
pescobar:pip_install_deps

Conversation

@pescobar
Copy link
Copy Markdown
Member

@pescobar pescobar commented Feb 23, 2018

with this option a easyconfig like this one can be installed. The only change is use_pip_for_deps = True

I know this is not the recommended approach and it doesn't help to reproduce the same installation in the future but in this specific example deeptools requires 41 different python libraries so creating a proper easyconfig with all the required libraries require quite some manual work. And this is a tool that probably only 1 or 2 of my users will need so it's not worth the time IMHO and for me it's ok to take the risk of not writting a fully complete easyconfig with the complete list of deps and rely on pip for the installation but save a lot of time of manual work

easyblock = 'PythonPackage'

name = 'deepTools'
version = '3.0.0'
versionsuffix = '-Python-%(pyver)s'

homepage = 'https://github.com/fidelram/deepTools'
description = """Tools to process and analyze deep sequencing data"""

toolchain = {'name': 'goolf', 'version': '1.7.20'}

source_urls = ['https://github.com/fidelram/deepTools/archive/']
sources = ['%(version)s.tar.gz']

dependencies = [
    ('Python', '2.7.11'),
    ('cURL', '7.40.0', '', True),
]

use_pip = True
use_pip_for_deps = True
unpack_sources = False

sanity_check_paths = {
    'files': [],
    'dirs': ['lib/python%(pyshortver)s/site-packages/deeptools'],
}

moduleclass = 'bio'

self.log.info("Using pip with --no-deps option")
self.cfg.update('installopts', '--no-deps')
else:
self.log.info("Using pip to also install the dependencies")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking == False is a bit weird @pescobar, since it's a boolean... Should be:

# don't auto-install dependencies with pip, unless use_pip_for_deps is enabled
if self.cfg.get('use_pip_for_deps'):
    self.log.info("Using pip to also install the dependencies")
else:
    self.log.info("Using pip with --no-deps option")
    self.cfg.update('installopts', '--no-deps')

'runtest': [True, "Run unit tests.", CUSTOM], # overrides default
'use_easy_install': [False, "Install using '%s' (deprecated)" % EASY_INSTALL_INSTALL_CMD, CUSTOM],
'use_pip': [False, "Install using '%s'" % PIP_INSTALL_CMD, CUSTOM],
'use_pip_for_dependencies': [False, "Install dependencies using '%s'" % PIP_INSTALL_CMD, CUSTOM],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pescobar I would rename this to use_pip_for_deps?

@boegel boegel added this to the 3.5.2 milestone Feb 26, 2018
@boegel boegel merged commit a1bc12e into easybuilders:develop Feb 26, 2018
@boegel boegel changed the title added option use_pip_for_dependencies for pythonpackages added option use_pip_for_deps for pythonpackages Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants