easyblock = 'Bundle'

name = 'Tensorflow'
version = '1.2.0'
versionsuffix = '-Python-%(pyver)s'

homepage = 'https://www.tensorflow.org/'
description = "An open-source software library for Machine Intelligence"

toolchain = {'name': 'intel', 'version': '2017a'}

pymaj = '3'
pymin = '6'
pyver = pymaj + pymin

# this is a bundle of Python packages
exts_defaultclass = 'PythonPackage'

dependencies = [
    ('Python', '%s.%s.1' % (pymaj, pymin)),
    ('protobuf-python', '3.3.0', versionsuffix),
]

exts_list = [
    ('backports.weakref', '1.0rc1', {
        'modulename': 'backports.weakref',
        'source_urls': ['https://pypi.python.org/packages/source/b/backports.weakref'],
    }),
    ('tensorflow', version, {
        'source_urls': ['https://pypi.python.org/packages/source/t/tensorflow'],
        'source_tmpl': 'tensorflow-%%(version)s-cp%(pyver)s-cp%(pyver)sm-manylinux1_x86_64.whl' % {'pyver': pyver},
        'checksums': ['a3835274cddd9c5b5a752e39b34c31a2d3d80e0ebcb5488e2dafaf3d614391d1'],
        'use_pip': True,
        'unpack_sources': False,
    }),
]

# specify that Bundle easyblock should run a full sanity check, rather than just trying to load the module
full_sanity_check = True

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

modextrapaths = {'PYTHONPATH': ['lib/python%(pyshortver)s/site-packages']}

moduleclass = 'lib'
