Skip to content

Commit

Permalink
progress on #248 MONAI
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrKralCZ committed Jan 26, 2024
1 parent 53a4385 commit c20d4a7
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions 248_MONAI/MONAI-1.3.0-foss-2023a.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
easyblock = 'PythonBundle'

name = 'MONAI'
version = '1.3.0'

homepage = 'https://monai.io/'
description = """
MONAI is a PyTorch-based, open-source framework for deep learning in healthcare
imaging, part of PyTorch Ecosystem.
"""

toolchain = {'name': 'foss', 'version': '2023a'}

github_account = 'Project-MONAI'

dependencies = [
('Python', '3.11.3'),
('PyTorch', '2.1.2'), # TODO 2.1.2
('PyTorch-Ignite', '0.4.12'), # TODO
('einops', '0.7.0'),
('ITK', '5.3.0'),
('NiBabel', '5.2.0'),
('scikit-image', '0.22.0'),
('tensorboard', '2.10.0'), # TODO
('torchvision', '0.13.1'), # TODO
('tqdm', '4.66.1'),
('Pillow', '10.0.0'),
('openslide-python', '1.3.1'),
('BeautifulSoup', '4.12.2'),
]

# install MONAI with list of 'extras', which require additional dependencies
local_pip_extras = "nibabel,skimage,pillow,tensorboard,gdown,ignite,torchvision,itk,tqdm,lmdb,psutil,openslide,fire"

# avoid using hatchling as build backend (since installing it for this old Python version is a nightmare)
local_preinstallopts_termcolor = ' '.join([
r"""sed -i -e 's/^build-backend = .*/build-backend = "setuptools.build_meta"/g' """,
r"""-e 's/^requires = \[/requires = \["setuptools"/g' """,
r"""-e '/"hatch/d' """,
# replace dynamic version with hardcoded version
r"""-e '/"version"/d' """,
r"""-e 's/^readme = .*/version = "%(version)s"/g' """,
r"pyproject.toml && ",
])

exts_list = [
('gdown', '4.7.1', {
'checksums': ['347f23769679aaf7efa73e5655270fcda8ca56be65eb84a4a21d143989541045'],
}),
('lmdb', '1.4.1', {
'checksums': ['1f4c76af24e907593487c904ef5eba1993beb38ed385af82adb25a858f2d658d'],
}),
('termcolor', '2.3.0', {
'checksums': ['b5b08f68937f138fe92f6c089b99f1e2da0ae56c52b78bf7075fd95420fd9a5a'],
'preinstallopts': local_preinstallopts_termcolor,
}),
('fire', '0.5.0', {
'checksums': ['a6b0d49e98c8963910021f92bba66f65ab440da2982b78eb1bbf95a0a34aacc6'],
}),
(name, version, {
'source_urls': ['https://github.com/%(github_account)s/%(name)s/archive'],
'sources': ['%(version)s.tar.gz'],
'checksums': ['67e0f55678faad4bd38b1ea69d5de94586b20b551b8ad745415623a8b6c1c5e2'],
'preinstallopts': "BUILD_MONAI=1",
'use_pip_extras': local_pip_extras,
}),
]

use_pip = True

sanity_pip_check = True

# 'pip check' does not verify whether all optional dependencies required to support 'extras'
# are actually available, so we do it here via an import check;
# Pillow is a special case, since there we need to use 'import PIL'
sanity_check_commands = [
"python -c 'import monai; monai.config.print_config()'",
"python -c 'import PIL'", # for Pillow required dependency
] + ["python -c 'import %s'" % x for x in local_pip_extras.split(',') if x != 'pillow']

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

moduleclass = 'vis'

0 comments on commit c20d4a7

Please sign in to comment.