Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add custom easyblock for sympy to fix issue in test step when tmpdir is a symlink #2949

Merged
merged 5 commits into from
Aug 5, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions easybuild/easyblocks/s/sympy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
##
# Copyright 2009-2023 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (FWO) (http://www.fwo.be/en)
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
#
# https://github.com/easybuilders/easybuild
#
# EasyBuild is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation v2.
#
# EasyBuild is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>.
##
"""
EasyBuild support for sympy, implemented as an easyblock

@author: Caspar van Leeuwen (SURF)
"""

import os
import tempfile

from easybuild.easyblocks.generic.pythonpackage import PythonPackage


class EB_sympy(PythonPackage):
"""Build sympy"""

def test_step(self):
branfosj marked this conversation as resolved.
Show resolved Hide resolved
"""Test step for sympy"""
original_tmpdir = tempfile.gettempdir()
tempfile.tempdir = os.path.realpath(tempfile.gettempdir())
self.log.debug("Changing TMPDIR for test step to avoid easybuild-easyconfigs issue #17593.")
self.log.debug("Old TMPDIR %s. New TMPDIR %s.", original_tmpdir, tempfile.gettempdir())
super(EB_sympy, self).test_step(self)
tempfile.tempdir = original_tmpdir
self.log.debug("Restored TMPDIR to %s", tempfile.gettempdir())