Skip to content

Commit

Permalink
Testing prior to next tag (#805)
Browse files Browse the repository at this point in the history
* Include python-3.13 in test matrix.  Bump release version.

* conda-build is no longer needed

* Check wheel tests.

* Use tomlkit instead of toml, to avoid bringing in a new, trivial dependency.

* Another place where toml was used instead of tomlkit

* Arrays are not compatible with toml table

* Restore normal testing
  • Loading branch information
tskisner authored Jan 24, 2025
1 parent ed0d01b commit 10d5056
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 65 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ jobs:
arch: x86_64
python: 312
builder: manylinux
- os: ubuntu-latest
arch: x86_64
python: 313
builder: manylinux

# MacOS x86_64. The macos-13 runner is the last
# Intel-based runner version. At some point we'll
Expand All @@ -61,6 +65,11 @@ jobs:
python: 312
builder: macosx
deploy: 13.0
- os: macos-13
arch: x86_64
python: 313
builder: macosx
deploy: 13.0

# MacOS arm64
- os: macos-latest
Expand All @@ -78,6 +87,11 @@ jobs:
python: 312
builder: macosx
deploy: 14.0
- os: macos-latest
arch: arm64
python: 313
builder: macosx
deploy: 14.0
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.builder }}2014
Expand Down Expand Up @@ -117,11 +131,11 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
python-version: '3.12'

- name: Install cibuildwheel
run: |
python -m pip install twine cibuildwheel==2.20.0
python -m pip install twine cibuildwheel==2.22.0
- name: Build wheel
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@ jobs:
arch: Linux-x86_64
ompdisable: 0
- os: ubuntu-latest
python: "3.10"
python: "3.12"
arch: Linux-x86_64
ompdisable: 0
- os: ubuntu-latest
python: "3.12"
python: "3.13"
arch: Linux-x86_64
ompdisable: 0
- os: macos-latest
python: "3.10"
arch: MacOSX-x86_64
ompdisable: 1
- os: macos-latest
python: "3.12"
python: "3.13"
arch: MacOSX-x86_64
ompdisable: 1
- os: macos-latest
python: "3.10"
arch: MacOSX-arm64
ompdisable: 1
- os: macos-latest
python: "3.12"
python: "3.13"
arch: MacOSX-arm64
ompdisable: 1
steps:
Expand Down
40 changes: 27 additions & 13 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

name: Test Binary Wheels

on: workflow_dispatch
# FIXME: Remove these lines once this workflow merged
# to main branch.
# on:
# push:
# branches:
# - master
# pull_request:
# branches:
# - master
# - toast3
on:
workflow_dispatch:
# FIXME: Remove these lines once this workflow merged
# to main branch.
# push:
# branches:
# - master
# pull_request:
# branches:
# - master
# - toast3

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -44,6 +44,10 @@ jobs:
arch: x86_64
python: 312
builder: manylinux
- os: ubuntu-latest
arch: x86_64
python: 313
builder: manylinux

# MacOS x86_64. The macos-13 runner is the last
# Intel-based runner version. At some point we'll
Expand All @@ -63,6 +67,11 @@ jobs:
python: 312
builder: macosx
deploy: 13.0
- os: macos-13
arch: x86_64
python: 313
builder: macosx
deploy: 13.0

# MacOS arm64
- os: macos-latest
Expand All @@ -80,6 +89,11 @@ jobs:
python: 312
builder: macosx
deploy: 14.0
- os: macos-latest
arch: arm64
python: 313
builder: macosx
deploy: 14.0
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.builder }}2014
Expand Down Expand Up @@ -128,11 +142,11 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
python-version: '3.12'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.20.0
python -m pip install cibuildwheel==2.22.0
- name: Build wheel
run: |
Expand Down
4 changes: 2 additions & 2 deletions packaging/conda/install_deps_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ envname=$1
# Explicit python version to use
pyversion=$2
if [ "x${pyversion}" = "x" ]; then
pyversion=3.10
pyversion=3.12
fi

# Install optional dependencies if desired
Expand Down Expand Up @@ -62,7 +62,7 @@ for pfile in ${pkgfiles}; do
plist=$(cat "${pfile}" | xargs -I % echo -n '"%" ')
pkglist="${pkglist} ${plist}"
done
pkglist="python=${pyversion} ${pkglist} compilers conda-build"
pkglist="python=${pyversion} ${pkglist} compilers"
echo "Installing conda packages: ${pkglist}"
conda install --yes --update-all ${pkglist}
# The "cc" symlink breaks Crays...
Expand Down
2 changes: 1 addition & 1 deletion packaging/conda/install_deps_conda_external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ envname=$1
# Explicit python version to use
pyversion=$2
if [ "x${pyversion}" = "x" ]; then
pyversion=3.10
pyversion=3.12
fi

# Install optional dependencies if desired
Expand Down
2 changes: 1 addition & 1 deletion packaging/deps/cfitsio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# - STATIC (yes/no)
# - CLEANUP (yes/no)

cfitsio_version=4.3.0
cfitsio_version=4.5.0
cfitsio_dir=cfitsio-${cfitsio_version}
cfitsio_pkg=${cfitsio_dir}.tar.gz

Expand Down
19 changes: 1 addition & 18 deletions packaging/wheels/install_deps_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,10 @@ pip install --upgrade pip
# Install a couple of base packages that are always required
pip install -v cmake wheel

# In order to maximize ABI compatibility with numpy, build with the newest numpy
# version containing the oldest ABI version compatible with the python we are using.
# NOTE: for now, we build with numpy 2.0.x, which is backwards compatible with
# numpy-1.x and forward compatible with numpy-2.x.
pyver=$(python3 --version 2>&1 | awk '{print $2}' | sed -e "s#\(.*\)\.\(.*\)\..*#\1.\2#")
# if [ ${pyver} == "3.8" ]; then
# numpy_ver="1.20"
# fi
# if [ ${pyver} == "3.9" ]; then
# numpy_ver="1.20"
# fi
# if [ ${pyver} == "3.10" ]; then
# numpy_ver="1.22"
# fi
# if [ ${pyver} == "3.11" ]; then
# numpy_ver="1.24"
# fi
numpy_ver="2.0.1"

# Install build requirements.
CC="${CC}" CFLAGS="${CFLAGS}" pip install -v -r "${scriptdir}/build_requirements.txt" "numpy==${numpy_ver}"
CC="${CC}" CFLAGS="${CFLAGS}" pip install -v -r "${scriptdir}/build_requirements.txt" numpy

# Build compiled dependencies

Expand Down
19 changes: 1 addition & 18 deletions packaging/wheels/install_deps_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,10 @@ pip install --upgrade pip
# Install a couple of base packages that are always required
pip install -v wheel

# In order to maximize ABI compatibility with numpy, build with the newest numpy
# version containing the oldest ABI version compatible with the python we are using.
# NOTE: for now, we build with numpy 2.0.x, which is backwards compatible with
# numpy-1.x and forward compatible with numpy-2.x.
pyver=$(python3 --version 2>&1 | awk '{print $2}' | sed -e "s#\(.*\)\.\(.*\)\..*#\1.\2#")
# if [ ${pyver} == "3.8" ]; then
# numpy_ver="1.20"
# fi
# if [ ${pyver} == "3.9" ]; then
# numpy_ver="1.24"
# fi
# if [ ${pyver} == "3.10" ]; then
# numpy_ver="1.24"
# fi
# if [ ${pyver} == "3.11" ]; then
# numpy_ver="1.24"
# fi
numpy_ver="2.0.1"

# Install build requirements.
CC="${CC}" CFLAGS="${CFLAGS}" pip install -v -r "${scriptdir}/build_requirements.txt" "numpy==${numpy_ver}"
CC="${CC}" CFLAGS="${CFLAGS}" pip install -v -r "${scriptdir}/build_requirements.txt" numpy

# Build compiled dependencies

Expand Down
2 changes: 1 addition & 1 deletion src/toast/RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0a28
3.0.0a29
6 changes: 3 additions & 3 deletions src/toast/ops/sim_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import h5py
import healpy as hp
import numpy as np
import toml
import tomlkit
import traitlets
from astropy.stats import gaussian_fwhm_to_sigma
from astropy import units as u
Expand Down Expand Up @@ -194,7 +194,7 @@ def _load_catalog(self):
log = Logger.get()
# Load the TOML into a dictionary
with open(self.catalog_file, "r") as f:
self.catalog = toml.loads(f.read())
self.catalog = tomlkit.parse(f.read())
# Check that the necessary keys are defined for every source
for source_name, source_dict in self.catalog.items():
for key in ["ra_deg", "dec_deg", "freqs_ghz"]:
Expand Down Expand Up @@ -233,7 +233,7 @@ def _load_catalog(self):
for source_name, source_dict in self.catalog.items():
lon = source_dict["ra_deg"]
lat = source_dict["dec_deg"]
source_dict["vec"] = hp.dir2vec(lon, lat, lonlat=True)
source_dict["vec"] = hp.dir2vec(lon, lat, lonlat=True).tolist()
return

def __init__(self, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions src/toast/tests/ops_sim_tod_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import os

import toml
import tomlkit
import healpy as hp
import numpy as np
from astropy import units as u
Expand Down Expand Up @@ -78,7 +78,7 @@ def setUp(self):
}

with open(self.catalog_file, "w") as f:
f.write(toml.dumps(catalog))
f.write(tomlkit.dumps(catalog))

if self.comm is not None:
self.comm.barrier()
Expand Down

0 comments on commit 10d5056

Please sign in to comment.