Skip to content

Commit

Permalink
Merge pull request #163 from neutrinoceros/test_python_311
Browse files Browse the repository at this point in the history
TST: test on Python 3.11
  • Loading branch information
neutrinoceros authored Jan 23, 2023
2 parents 70f7ff3 + 06a900e commit fac4420
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ commands:
echo 'export GOLD_STANDARD=HEAD' >> $BASH_ENV
echo 'export ROCKSTAR_DIR=$HOME/rockstar-galaxies' >> $BASH_ENV
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROCKSTAR_DIR' >> $BASH_ENV
echo 'export YT_DIR=$HOME/yt-git' >> $BASH_ENV
echo 'export YT_DATA=$HOME/yt_test' >> $BASH_ENV
echo 'export TEST_DIR=$HOME/test_results' >> $BASH_ENV
echo 'export TEST_NAME=astro_analysis' >> $BASH_ENV
Expand Down Expand Up @@ -46,24 +45,26 @@ commands:
pip install --upgrade pip
pip install mpi4py
export MAX_BUILD_CORES=2
# install yt from source
if [ ! -f $YT_DIR/README.md ]; then
git clone --branch=main https://github.com/yt-project/yt $YT_DIR
fi
pushd $YT_DIR
git pull origin main
git checkout main
pip install .
popd
python -m pip install git+https://github.com/yt-project/yt
export YT_ASTRO_DIR=$(pwd)
# install rockstar
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100
if [ ! -f $ROCKSTAR_DIR/VERSION ]; then
git clone https://bitbucket.org/pbehroozi/rockstar-galaxies $ROCKSTAR_DIR
pushd $ROCKSTAR_DIR
# apply patches necessary for compat with Ubuntu 22.04
git apply $YT_ASTRO_DIR/rockstar-patches/cflags.patch --whitespace=fix
make lib
popd
fi
echo $ROCKSTAR_DIR > rockstar.cfg
# never attempt to build h5py from source
pip install h5py --only-binary h5py
# install yt_astro_analysis with extra dev dependencies
pip install .[dev]
# configure yt
Expand Down Expand Up @@ -196,7 +197,7 @@ jobs:

run-tests-pytest:
# Run a subset of the test suite (yield-based tests are not supported by pytest)
# this is necessary to test in Python 3.10 because it's not compatible with nose
# this is necessary to test in Python 3.10+ because it's not compatible with nose
parameters:
tag:
type: string
Expand Down Expand Up @@ -299,6 +300,10 @@ workflows:
name: "Python 3.10 tests"
tag: "3.10.0"

- run-tests-pytest:
name: "Python 3.11 tests"
tag: "3.11.1"

- docs-test:
name: "Test docs build"
tag: "3.9.7"
Expand Down
24 changes: 24 additions & 0 deletions rockstar-patches/cflags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/Makefile b/Makefile
index 66f7e17..debd222 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
-CFLAGS=-m64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_SVID_SOURCE -D_DARWIN_C_SOURCE -Wall -fno-math-errno -fPIC
+CFLAGS=-m64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -D_DARWIN_C_SOURCE -Wall -fno-math-errno -fPIC -I/usr/include/tirpc
LDFLAGS=-shared
OFLAGS = -lm -O3 -std=c99
-DEBUGFLAGS = -lm -g -O3 -std=c99 #-Dinline=
+DEBUGFLAGS = -lm -g -O3 -std=c99 #-Dinline=
PROFFLAGS = -lm -g -pg -O2 -std=c99
CC = gcc
CFILES = rockstar.c check_syscalls.c fof.c groupies.c subhalo_metric.c potential.c nfw.c jacobi.c fun_times.c interleaving.c universe_time.c hubble.c integrate.c distance.c config_vars.c config.c bounds.c inthash.c io/read_config.c client.c server.c merger.c inet/socket.c inet/rsocket.c inet/address.c io/meta_io.c io/io_internal.c io/io_ascii.c io/stringparse.c io/io_gadget.c io/io_generic.c io/io_art.c io/io_nchilada.c io/io_tipsy.c io/io_bgc2.c io/io_util.c io/io_arepo.c io/io_hdf5.c io/io_enzo.c
diff --git a/examples/Makefile b/examples/Makefile
index caf2322..a192fe5 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -1,4 +1,4 @@
-CFLAGS=-m64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_SVID_SOURCE -D_DARWIN_C_SOURCE -lm -fno-math-errno -Wall
+CFLAGS=-m64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -D_DARWIN_C_SOURCE -lm -fno-math-errno -Wall
OFLAGS = -O3 -std=c99
DEBUGFLAGS = -g -O3 -std=c99
PROFFLAGS = -g -pg -O2 -std=c99

0 comments on commit fac4420

Please sign in to comment.