Skip to content

Commit

Permalink
Run tests from a subdirectory, to avoid attempted relative import of …
Browse files Browse the repository at this point in the history
…compiled extension
  • Loading branch information
tskisner committed Jan 1, 2025
1 parent 52db014 commit e13a38e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ jobs:
- name: Install Dependencies
run: |
source ~/conda/etc/profile.d/conda.sh \
&& conda activate base \
&& conda install --file packaging/conda_build_requirements.txt
&& conda create --yes -n test python==3.12 \
&& conda activate test \
&& conda install --yes --file packaging/conda_build_requirements.txt
- name: Install
run: |
Expand All @@ -96,11 +97,17 @@ jobs:
source ~/conda/etc/profile.d/conda.sh \
&& conda activate base \
&& export OMP_NUM_THREADS=2 \
&& python3 -c 'import flacarray.tests; flacarray.tests.run()'
&& mkdir -p test \
&& pushd test >/dev/null 2>&1 \
&& python3 -c 'import flacarray.tests; flacarray.tests.run()' \
&& popd >/dev/null 2>&1
- name: Run MPI Tests
run: |
source ~/conda/etc/profile.d/conda.sh \
&& conda activate base \
&& export OMP_NUM_THREADS=1 \
&& mpirun -np 2 python -c 'import flacarray.tests; flacarray.tests.run()'
&& mkdir -p test \
&& pushd test >/dev/null 2>&1 \
&& mpirun -np 2 python -c 'import flacarray.tests; flacarray.tests.run()' \
&& popd >/dev/null 2>&1
12 changes: 6 additions & 6 deletions flacarray/libflacarray/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ ext_sources = [
]

py.extension_module(
'libflacarray',
ext_sources,
dependencies: [openmp, libflac],
include_directories: [incdir_numpy],
install: true,
subdir: 'flacarray',
'libflacarray',
ext_sources,
dependencies: [openmp, libflac],
include_directories: [incdir_numpy],
install: true,
subdir: 'flacarray',
)
4 changes: 2 additions & 2 deletions packaging/wheels/install_deps_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ fi
export PREFIX="${prefix}"

# Make sure lib64 points to lib, so that our dependencies can be found
rm -rf "${prefix}/lib64"
ln -s "${prefix}/lib" "${prefix}/lib64"
sudo rm -rf "${prefix}/lib64"
sudo ln -s "${prefix}/lib" "${prefix}/lib64"

# Location of this script
pushd $(dirname $0) >/dev/null 2>&1
Expand Down
4 changes: 2 additions & 2 deletions packaging/wheels/install_deps_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ fi
export PREFIX="${prefix}"

# Make sure lib64 points to lib, so that our dependencies can be found
rm -rf "${prefix}/lib64"
ln -s "${PREFIX}/lib" "${PREFIX}/lib64"
sudo rm -rf "${prefix}/lib64"
sudo ln -s "${PREFIX}/lib" "${PREFIX}/lib64"

# If we are running on github CI, ensure that permissions
# are set on /usr/local. See:
Expand Down

0 comments on commit e13a38e

Please sign in to comment.