Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-sans-paille committed Oct 15, 2023
1 parent f072fba commit 1d78daa
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions pythran/tests/test_distutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,26 @@ def test_setup_bdist_install2(self):
def test_setup_build3(self):
check_call([python, 'setup.py', 'build'],
cwd=os.path.join(cwd, 'test_distutils_numpy'))
check_call([python, 'setup.py', 'install', '--prefix=demo_install3'],
cwd=os.path.join(cwd, 'test_distutils_numpy'))

base = os.path.join(cwd, 'test_distutils_numpy', 'demo_install3',)
libdir = os.path.join(base, 'lib')
if not os.path.isdir(libdir):
libdir = os.path.join(base, 'lib64')
lib64dir = os.path.join(base, 'lib64')

demo_dir_candidates = glob.glob(os.path.join(libdir, python_version,
'site-packages',
'demo3*'))
demo_dir = [d for d in demo_dir_candidates if os.path.isdir(d)][0]
local_env = os.environ.copy()
local_env['PYTHONPATH'] = os.pathsep.join((
os.path.join(lib64dir, python_version,
'site-packages'),
os.path.join(libdir, python_version,
'site-packages'),
local_env.get('PYTHONPATH', ''),
))

check_call([python, 'setup.py', 'install', '--prefix=demo_install3'],
cwd=os.path.join(cwd, 'test_distutils_numpy'),
env=local_env)

check_call([python, '-c', 'import a'],
cwd=demo_dir)
check_call([python, '-c', 'import demo3.a'],
cwd=cwd, env=local_env)
check_call([python, 'setup.py', 'clean'],
cwd=os.path.join(cwd, 'test_distutils_numpy'))
shutil.rmtree(os.path.join(cwd, 'test_distutils_numpy', 'demo_install3'))
Expand Down

0 comments on commit 1d78daa

Please sign in to comment.