Skip to content

Commit

Permalink
Add test for duplicate PYTHONPATH in modextrapaths
Browse files Browse the repository at this point in the history
And similar test for `sanity_check_paths`.

Intended to avoid issues fixed in easybuilders#13385
  • Loading branch information
Flamefire committed Apr 16, 2024
1 parent 764f5e6 commit 97c2a61
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/easyconfigs/easyconfigs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,24 @@ def test_pr_python_packages(self):
if not sanity_pip_check and not any(re.match(regex, ec_fn) for regex in whitelist_pip_check):
failing_checks.append("sanity_pip_check should be enabled in %s" % ec_fn)

# Avoid duplicated PYTHONPATH entries and checks (set by the easyblock)
if easyblock == 'PythonBundle' or easyblock.endswith('PythonPackage'):
extra_python_path = ec.get('modextrapaths', dict()).get('PYTHONPATH')
if extra_python_path == 'lib/python%(pyshortver)s/site-packages':
failing_checks.append("modextrapaths should not contain %s "
"(automatically added by easyblock)" % extra_python_path)
sanity_check_dirs = ec.get('sanity_check_paths', dict()).get('dirs') or []
default_dirs = (
'lib/python%(pyshortver)s/site-packages',
'lib/python%(pyshortver)s/site-packages/%(name)s',
'lib64/python%(pyshortver)s/site-packages',
'lib64/python%(pyshortver)s/site-packages/%(name)s',
)
for d in default_dirs:
if d in sanity_check_dirs:
failing_checks.append("sanity_check_paths['dirs'] should not contain %s"
"(automatically added by easyblock)" % d)

if failing_checks:
self.fail('\n'.join(failing_checks))

Expand Down

0 comments on commit 97c2a61

Please sign in to comment.