From b9a3072902bc7b4a9696b78f08fcaedc05af6acd Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 10:51:22 -0400 Subject: [PATCH 01/17] remove gnu99 compile arg --- gala/dynamics/setup_package.py | 83 ++++++++++----------- gala/integrate/setup_package.py | 3 - gala/potential/frame/setup_package.py | 47 +++++++----- gala/potential/hamiltonian/setup_package.py | 19 ++--- gala/potential/potential/setup_package.py | 18 +---- gala/potential/scf/setup_package.py | 71 +++++++++--------- gala/setup_package.py | 7 +- 7 files changed, 118 insertions(+), 130 deletions(-) diff --git a/gala/dynamics/setup_package.py b/gala/dynamics/setup_package.py index 0142e3c7d..bc3e84be5 100644 --- a/gala/dynamics/setup_package.py +++ b/gala/dynamics/setup_package.py @@ -11,57 +11,52 @@ def get_extensions(): mac_incl_path = "/usr/include/malloc" cfg = defaultdict(list) - cfg['include_dirs'].append(np.get_include()) - cfg['include_dirs'].append(mac_incl_path) - cfg['include_dirs'].append('gala/integrate/cyintegrators') - cfg['include_dirs'].append('gala/potential') - cfg['extra_compile_args'].append('--std=gnu99') - cfg['sources'].append('gala/potential/potential/src/cpotential.c') - cfg['sources'].append('gala/potential/hamiltonian/src/chamiltonian.c') - cfg['sources'].append('gala/integrate/cyintegrators/dopri/dop853.c') - cfg['sources'].append('gala/dynamics/lyapunov/dop853_lyapunov.pyx') - exts.append(Extension('gala.dynamics.lyapunov.dop853_lyapunov', **cfg)) + cfg["include_dirs"].append(np.get_include()) + cfg["include_dirs"].append(mac_incl_path) + cfg["include_dirs"].append("gala/integrate/cyintegrators") + cfg["include_dirs"].append("gala/potential") + cfg["sources"].append("gala/potential/potential/src/cpotential.c") + cfg["sources"].append("gala/potential/hamiltonian/src/chamiltonian.c") + cfg["sources"].append("gala/integrate/cyintegrators/dopri/dop853.c") + cfg["sources"].append("gala/dynamics/lyapunov/dop853_lyapunov.pyx") + exts.append(Extension("gala.dynamics.lyapunov.dop853_lyapunov", **cfg)) cfg = defaultdict(list) - cfg['include_dirs'].append(np.get_include()) - cfg['include_dirs'].append(mac_incl_path) - cfg['include_dirs'].append('gala/potential') - cfg['sources'].append('gala/dynamics/mockstream/_coord.pyx') - cfg['extra_compile_args'].append('--std=gnu99') - exts.append(Extension('gala.dynamics.mockstream._coord', **cfg)) + cfg["include_dirs"].append(np.get_include()) + cfg["include_dirs"].append(mac_incl_path) + cfg["include_dirs"].append("gala/potential") + cfg["sources"].append("gala/dynamics/mockstream/_coord.pyx") + exts.append(Extension("gala.dynamics.mockstream._coord", **cfg)) cfg = defaultdict(list) - cfg['include_dirs'].append(np.get_include()) - cfg['include_dirs'].append(mac_incl_path) - cfg['include_dirs'].append('gala/potential') - cfg['sources'].append('gala/dynamics/mockstream/df.pyx') - cfg['sources'].append('gala/potential/potential/src/cpotential.c') - cfg['extra_compile_args'].append('--std=gnu99') - exts.append(Extension('gala.dynamics.mockstream.df', **cfg)) + cfg["include_dirs"].append(np.get_include()) + cfg["include_dirs"].append(mac_incl_path) + cfg["include_dirs"].append("gala/potential") + cfg["sources"].append("gala/dynamics/mockstream/df.pyx") + cfg["sources"].append("gala/potential/potential/src/cpotential.c") + exts.append(Extension("gala.dynamics.mockstream.df", **cfg)) cfg = defaultdict(list) - cfg['include_dirs'].append(np.get_include()) - cfg['include_dirs'].append('gala/integrate/cyintegrators') - cfg['include_dirs'].append(mac_incl_path) - cfg['include_dirs'].append('gala/potential') - cfg['include_dirs'].append('gala/dynamics/nbody') - cfg['sources'].append('gala/potential/potential/src/cpotential.c') - cfg['sources'].append('gala/potential/hamiltonian/src/chamiltonian.c') - cfg['sources'].append('gala/dynamics/mockstream/mockstream.pyx') - cfg['sources'].append('gala/integrate/cyintegrators/dopri/dop853.c') - cfg['extra_compile_args'].append('--std=gnu99') - exts.append(Extension('gala.dynamics.mockstream._mockstream', **cfg)) + cfg["include_dirs"].append(np.get_include()) + cfg["include_dirs"].append("gala/integrate/cyintegrators") + cfg["include_dirs"].append(mac_incl_path) + cfg["include_dirs"].append("gala/potential") + cfg["include_dirs"].append("gala/dynamics/nbody") + cfg["sources"].append("gala/potential/potential/src/cpotential.c") + cfg["sources"].append("gala/potential/hamiltonian/src/chamiltonian.c") + cfg["sources"].append("gala/dynamics/mockstream/mockstream.pyx") + cfg["sources"].append("gala/integrate/cyintegrators/dopri/dop853.c") + exts.append(Extension("gala.dynamics.mockstream._mockstream", **cfg)) cfg = defaultdict(list) - cfg['include_dirs'].append(np.get_include()) - cfg['include_dirs'].append('gala/integrate/cyintegrators') - cfg['include_dirs'].append(mac_incl_path) - cfg['include_dirs'].append('gala/potential') - cfg['sources'].append('gala/potential/potential/src/cpotential.c') - cfg['sources'].append('gala/potential/hamiltonian/src/chamiltonian.c') - cfg['sources'].append('gala/integrate/cyintegrators/dopri/dop853.c') - cfg['sources'].append('gala/dynamics/nbody/nbody.pyx') - cfg['extra_compile_args'].append('--std=gnu99') - exts.append(Extension('gala.dynamics.nbody.nbody', **cfg)) + cfg["include_dirs"].append(np.get_include()) + cfg["include_dirs"].append("gala/integrate/cyintegrators") + cfg["include_dirs"].append(mac_incl_path) + cfg["include_dirs"].append("gala/potential") + cfg["sources"].append("gala/potential/potential/src/cpotential.c") + cfg["sources"].append("gala/potential/hamiltonian/src/chamiltonian.c") + cfg["sources"].append("gala/integrate/cyintegrators/dopri/dop853.c") + cfg["sources"].append("gala/dynamics/nbody/nbody.pyx") + exts.append(Extension("gala.dynamics.nbody.nbody", **cfg)) return exts diff --git a/gala/integrate/setup_package.py b/gala/integrate/setup_package.py index 00e71c497..72f702928 100644 --- a/gala/integrate/setup_package.py +++ b/gala/integrate/setup_package.py @@ -15,7 +15,6 @@ def get_extensions(): cfg["include_dirs"].append(mac_incl_path) cfg["include_dirs"].append("gala/potential") cfg["include_dirs"].append("gala/dynamics/nbody") - cfg["extra_compile_args"].append("--std=gnu99") cfg["sources"].append("gala/integrate/cyintegrators/leapfrog.pyx") cfg["sources"].append("gala/potential/potential/src/cpotential.c") exts.append(Extension("gala.integrate.cyintegrators.leapfrog", **cfg)) @@ -24,7 +23,6 @@ def get_extensions(): cfg["include_dirs"].append(np.get_include()) cfg["include_dirs"].append(mac_incl_path) cfg["include_dirs"].append("gala/potential") - cfg["extra_compile_args"].append("--std=gnu99") cfg["sources"].append("gala/potential/hamiltonian/src/chamiltonian.c") cfg["sources"].append("gala/potential/potential/src/cpotential.c") cfg["sources"].append("gala/integrate/cyintegrators/dop853.pyx") @@ -36,7 +34,6 @@ def get_extensions(): cfg["include_dirs"].append(mac_incl_path) cfg["include_dirs"].append("gala/potential") cfg["include_dirs"].append("gala/dynamics/nbody") - cfg["extra_compile_args"].append("--std=gnu99") cfg["sources"].append("gala/integrate/cyintegrators/ruth4.pyx") cfg["sources"].append("gala/potential/potential/src/cpotential.c") exts.append(Extension("gala.integrate.cyintegrators.ruth4", **cfg)) diff --git a/gala/potential/frame/setup_package.py b/gala/potential/frame/setup_package.py index a6600e415..e03543eaa 100644 --- a/gala/potential/frame/setup_package.py +++ b/gala/potential/frame/setup_package.py @@ -11,30 +11,37 @@ def get_extensions(): mac_incl_path = "/usr/include/malloc" cfg = defaultdict(list) - cfg['include_dirs'].append(np.get_include()) - cfg['include_dirs'].append(mac_incl_path) - cfg['include_dirs'].append('gala/potential') - cfg['extra_compile_args'].append('--std=gnu99') - cfg['sources'].append('gala/potential/frame/cframe.pyx') - cfg['sources'].append('gala/potential/frame/src/cframe.c') - exts.append(Extension('gala.potential.frame.cframe', **cfg)) + cfg["include_dirs"].append(np.get_include()) + cfg["include_dirs"].append(mac_incl_path) + cfg["include_dirs"].append("gala/potential") + cfg["sources"].append("gala/potential/frame/cframe.pyx") + cfg["sources"].append("gala/potential/frame/src/cframe.c") + exts.append(Extension("gala.potential.frame.cframe", **cfg)) cfg = defaultdict(list) - cfg['include_dirs'].append(np.get_include()) - cfg['include_dirs'].append(mac_incl_path) - cfg['include_dirs'].append('gala/potential') - cfg['extra_compile_args'].append('--std=gnu99') - cfg['sources'].append('gala/potential/frame/builtin/frames.pyx') - cfg['sources'].append('gala/potential/frame/builtin/builtin_frames.c') - cfg['sources'].append('gala/potential/frame/src/cframe.c') - exts.append(Extension('gala.potential.frame.builtin.frames', **cfg)) + cfg["include_dirs"].append(np.get_include()) + cfg["include_dirs"].append(mac_incl_path) + cfg["include_dirs"].append("gala/potential") + cfg["sources"].append("gala/potential/frame/builtin/frames.pyx") + cfg["sources"].append("gala/potential/frame/builtin/builtin_frames.c") + cfg["sources"].append("gala/potential/frame/src/cframe.c") + exts.append(Extension("gala.potential.frame.builtin.frames", **cfg)) return exts def get_package_data(): - return {'gala.potential.frame': - ['*.h', '*.pyx', '*.pxd', '*/*.pyx', '*/*.pxd', - 'builtin/*.h', 'src/*.h', - 'builtin/builtin_frames.c', 'src/*.c', - 'tests/*.yml']} + return { + "gala.potential.frame": [ + "*.h", + "*.pyx", + "*.pxd", + "*/*.pyx", + "*/*.pxd", + "builtin/*.h", + "src/*.h", + "builtin/builtin_frames.c", + "src/*.c", + "tests/*.yml", + ] + } diff --git a/gala/potential/hamiltonian/setup_package.py b/gala/potential/hamiltonian/setup_package.py index 75bf9dfac..472118a36 100644 --- a/gala/potential/hamiltonian/setup_package.py +++ b/gala/potential/hamiltonian/setup_package.py @@ -11,19 +11,16 @@ def get_extensions(): mac_incl_path = "/usr/include/malloc" cfg = defaultdict(list) - cfg['include_dirs'].append(np.get_include()) - cfg['include_dirs'].append(mac_incl_path) - cfg['include_dirs'].append('gala/potential') - cfg['extra_compile_args'].append('--std=gnu99') - cfg['sources'].append('gala/potential/hamiltonian/chamiltonian.pyx') - cfg['sources'].append('gala/potential/hamiltonian/src/chamiltonian.c') - cfg['sources'].append('gala/potential/potential/src/cpotential.c') - exts.append(Extension('gala.potential.hamiltonian.chamiltonian', **cfg)) + cfg["include_dirs"].append(np.get_include()) + cfg["include_dirs"].append(mac_incl_path) + cfg["include_dirs"].append("gala/potential") + cfg["sources"].append("gala/potential/hamiltonian/chamiltonian.pyx") + cfg["sources"].append("gala/potential/hamiltonian/src/chamiltonian.c") + cfg["sources"].append("gala/potential/potential/src/cpotential.c") + exts.append(Extension("gala.potential.hamiltonian.chamiltonian", **cfg)) return exts def get_package_data(): - - return {'gala.potential.hamiltonian': - ['src/*.h', 'src/*.c', '*.pyx', '*.pxd']} + return {"gala.potential.hamiltonian": ["src/*.h", "src/*.c", "*.pyx", "*.pxd"]} diff --git a/gala/potential/potential/setup_package.py b/gala/potential/potential/setup_package.py index c211d1b1b..79521252a 100644 --- a/gala/potential/potential/setup_package.py +++ b/gala/potential/potential/setup_package.py @@ -15,11 +15,8 @@ def get_extensions(): cfg["include_dirs"].append(mac_incl_path) cfg["include_dirs"].append("gala/potential") cfg["include_dirs"].append("gala") - cfg["extra_compile_args"].append("--std=gnu99") cfg["sources"].append("gala/potential/potential/cpotential.pyx") - cfg["sources"].append( - "gala/potential/potential/builtin/builtin_potentials.c" - ) + cfg["sources"].append("gala/potential/potential/builtin/builtin_potentials.c") cfg["sources"].append("gala/potential/potential/src/cpotential.c") exts.append(Extension("gala.potential.potential.cpotential", **cfg)) @@ -28,23 +25,17 @@ def get_extensions(): cfg["include_dirs"].append(mac_incl_path) cfg["include_dirs"].append("gala/potential") cfg["include_dirs"].append("gala") - cfg["extra_compile_args"].append("--std=gnu99") cfg["sources"].append("gala/potential/potential/ccompositepotential.pyx") cfg["sources"].append("gala/potential/potential/src/cpotential.c") - exts.append( - Extension("gala.potential.potential.ccompositepotential", **cfg) - ) + exts.append(Extension("gala.potential.potential.ccompositepotential", **cfg)) cfg = defaultdict(list) cfg["include_dirs"].append(np.get_include()) cfg["include_dirs"].append(mac_incl_path) cfg["include_dirs"].append("gala/potential") cfg["include_dirs"].append("gala") - cfg["extra_compile_args"].append("--std=gnu99") cfg["sources"].append("gala/potential/potential/builtin/cybuiltin.pyx") - cfg["sources"].append( - "gala/potential/potential/builtin/builtin_potentials.c" - ) + cfg["sources"].append("gala/potential/potential/builtin/builtin_potentials.c") cfg["sources"].append("gala/potential/potential/builtin/multipole.c") cfg["sources"].append("gala/potential/potential/src/cpotential.c") exts.append(Extension("gala.potential.potential.builtin.cybuiltin", **cfg)) @@ -53,7 +44,6 @@ def get_extensions(): def get_package_data(): - return { "gala.potential.potential": [ "*.h", @@ -67,6 +57,6 @@ def get_package_data(): "src/cpotential.c", "tests/*.yml", "tests/pot_disk_506151.pot", - "tests/agama_cylspline_test.fits" + "tests/agama_cylspline_test.fits", ] } diff --git a/gala/potential/scf/setup_package.py b/gala/potential/scf/setup_package.py index 7d59cc1e1..8f8b067d8 100644 --- a/gala/potential/scf/setup_package.py +++ b/gala/potential/scf/setup_package.py @@ -17,50 +17,53 @@ def get_extensions(): # Some READTHEDOCS hacks - see # https://github.com/pyFFTW/pyFFTW/pull/161/files # https://github.com/pyFFTW/pyFFTW/pull/162/files - include_dirs = [path.join(sys.prefix, 'include')] - library_dirs = [path.join(sys.prefix, 'lib')] + include_dirs = [path.join(sys.prefix, "include")] + library_dirs = [path.join(sys.prefix, "lib")] # all need these: - include_dirs.extend([np.get_include(), mac_incl_path, - 'gala', 'gala/potential']) + include_dirs.extend([np.get_include(), mac_incl_path, "gala", "gala/potential"]) cfg = defaultdict(list) - cfg['include_dirs'].extend(include_dirs) - cfg['library_dirs'].extend(library_dirs) - cfg['extra_compile_args'].append('--std=gnu99') - cfg['sources'].append('gala/potential/scf/computecoeff.pyx') - cfg['sources'].append('gala/potential/scf/src/bfe_helper.c') - cfg['sources'].append('gala/potential/scf/src/coeff_helper.c') - exts.append(Extension('gala.potential.scf._computecoeff', **cfg)) + cfg["include_dirs"].extend(include_dirs) + cfg["library_dirs"].extend(library_dirs) + cfg["sources"].append("gala/potential/scf/computecoeff.pyx") + cfg["sources"].append("gala/potential/scf/src/bfe_helper.c") + cfg["sources"].append("gala/potential/scf/src/coeff_helper.c") + exts.append(Extension("gala.potential.scf._computecoeff", **cfg)) cfg = defaultdict(list) - cfg['include_dirs'].extend(include_dirs) - cfg['library_dirs'].extend(library_dirs) - cfg['extra_compile_args'].append('--std=gnu99') - cfg['sources'].append('gala/potential/potential/src/cpotential.c') - cfg['sources'].append('gala/potential/potential/builtin/builtin_potentials.c') - cfg['sources'].append('gala/potential/scf/bfe.pyx') - cfg['sources'].append('gala/potential/scf/src/bfe.c') - cfg['sources'].append('gala/potential/scf/src/bfe_helper.c') - exts.append(Extension('gala.potential.scf._bfe', **cfg)) + cfg["include_dirs"].extend(include_dirs) + cfg["library_dirs"].extend(library_dirs) + cfg["sources"].append("gala/potential/potential/src/cpotential.c") + cfg["sources"].append("gala/potential/potential/builtin/builtin_potentials.c") + cfg["sources"].append("gala/potential/scf/bfe.pyx") + cfg["sources"].append("gala/potential/scf/src/bfe.c") + cfg["sources"].append("gala/potential/scf/src/bfe_helper.c") + exts.append(Extension("gala.potential.scf._bfe", **cfg)) cfg = defaultdict(list) - cfg['include_dirs'].extend(include_dirs) - cfg['library_dirs'].extend(library_dirs) - cfg['extra_compile_args'].append('--std=gnu99') - cfg['sources'].append('gala/potential/scf/bfe_class.pyx') - cfg['sources'].append('gala/potential/scf/src/bfe.c') - cfg['sources'].append('gala/potential/scf/src/bfe_helper.c') - exts.append(Extension('gala.potential.scf._bfe_class', **cfg)) + cfg["include_dirs"].extend(include_dirs) + cfg["library_dirs"].extend(library_dirs) + cfg["sources"].append("gala/potential/scf/bfe_class.pyx") + cfg["sources"].append("gala/potential/scf/src/bfe.c") + cfg["sources"].append("gala/potential/scf/src/bfe_helper.c") + exts.append(Extension("gala.potential.scf._bfe_class", **cfg)) return exts def get_package_data(): - return {'gala.potential.scf': ['*.pyx', - 'tests/data/*', - 'tests/data/*.csv', - 'tests/data/*.dat.gz', - 'tests/data/*.coeff', - '*.h', '*.pyx', '*.pxd', - 'src/*.c', 'src/*.h']} + return { + "gala.potential.scf": [ + "*.pyx", + "tests/data/*", + "tests/data/*.csv", + "tests/data/*.dat.gz", + "tests/data/*.coeff", + "*.h", + "*.pyx", + "*.pxd", + "src/*.c", + "src/*.h", + ] + } diff --git a/gala/setup_package.py b/gala/setup_package.py index 08d0ed753..786714d39 100644 --- a/gala/setup_package.py +++ b/gala/setup_package.py @@ -6,9 +6,8 @@ def get_extensions(): exts = [] cfg = defaultdict(list) - cfg['include_dirs'].append('gala') - cfg['extra_compile_args'].append('--std=gnu99') - cfg['sources'].append('gala/cconfig.pyx') - exts.append(Extension('gala._cconfig', **cfg)) + cfg["include_dirs"].append("gala") + cfg["sources"].append("gala/cconfig.pyx") + exts.append(Extension("gala._cconfig", **cfg)) return exts From 13722dd70a8f8af1fa84aa6d47095460cf3c9400 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 10:52:35 -0400 Subject: [PATCH 02/17] reenable windows test and disable others for testing --- .github/workflows/tests.yml | 84 ++++++++++++++++----------------- .github/workflows/tutorials.yml | 3 +- 2 files changed, 44 insertions(+), 43 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 637778469..1728c29d6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,54 +23,54 @@ jobs: python: 3.x toxenv: codestyle - - name: Python 3.10 with minimal dependencies and coverage - os: ubuntu-latest - python: '3.10' - toxenv: py310-test-cov + # - name: Python 3.10 with minimal dependencies and coverage + # os: ubuntu-latest + # python: '3.10' + # toxenv: py310-test-cov + + # - name: Python 3.9 + # os: ubuntu-latest + # python: '3.9' + # toxenv: py39-test - - name: Python 3.9 - os: ubuntu-latest - python: '3.9' - toxenv: py39-test + # - name: Python 3.10 + # os: ubuntu-latest + # python: '3.10' + # toxenv: py310-test + + # - name: Python 3.11 + # os: ubuntu-latest + # python: '3.11' + # toxenv: py311-test + + # # Has to happen on ubuntu because galpy is finnicky on macOS + # - name: Python 3.10 with all optional dependencies + # os: ubuntu-latest + # python: '3.10' + # toxenv: py310-test-extradeps + # toxposargs: --durations=50 + + # - name: Python 3.10 without GSL + # os: ubuntu-latest + # python: '3.10' + # toxenv: nogsl + + # - name: Python 3.9 with oldest supported version of all dependencies + # os: ubuntu-latest + # python: 3.9 + # toxenv: py39-test-oldestdeps - - name: Python 3.10 - os: ubuntu-latest - python: '3.10' - toxenv: py310-test + # # Mac and Windows: + # - name: Python 3.10 standard tests (macOS) + # os: macos-latest + # python: '3.10' + # toxenv: py310-test - - name: Python 3.11 - os: ubuntu-latest + - name: Python 3.11 standard tests (Windows) + os: windows-latest python: '3.11' toxenv: py311-test - # Has to happen on ubuntu because galpy is finnicky on macOS - - name: Python 3.10 with all optional dependencies - os: ubuntu-latest - python: '3.10' - toxenv: py310-test-extradeps - toxposargs: --durations=50 - - - name: Python 3.10 without GSL - os: ubuntu-latest - python: '3.10' - toxenv: nogsl - - - name: Python 3.9 with oldest supported version of all dependencies - os: ubuntu-latest - python: 3.9 - toxenv: py39-test-oldestdeps - - # Mac and Windows: - - name: Python 3.10 standard tests (macOS) - os: macos-latest - python: '3.10' - toxenv: py310-test - - # - name: Python 3.9 standard tests (Windows) - # os: windows-latest - # python: 3.9 - # toxenv: py39-test - steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/tutorials.yml b/.github/workflows/tutorials.yml index 43ef2a1ae..1435baa13 100644 --- a/.github/workflows/tutorials.yml +++ b/.github/workflows/tutorials.yml @@ -5,7 +5,8 @@ on: - main pull_request: branches: - - main + # - main + - DISABLED release: types: - published From ea94ab0e8434204bcb6763c316124b440a5c1d7c Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 11:16:16 -0400 Subject: [PATCH 03/17] disable wheels and try windows --- .github/workflows/tests.yml | 24 ++++++++++++++++++++++-- .github/workflows/wheels.yml | 3 ++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1728c29d6..eff917b53 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -126,13 +126,33 @@ jobs: sudo apt-get install gsl-bin libgsl0-dev build-essential sudo apt-get install libhdf5-serial-dev # TODO: remove when h5py has 3.11 wheels + # Windows: + # Install just the GSL using conda + - uses: mamba-org/setup-micromamba@v1 + if: ${{ startsWith(matrix.os, 'windows') }} + with: + environment-name: gsl + condarc: | + channels: + - conda-forge + create-args: gsl + + - name: Set GSL environment variables + if: ${{ startsWith(matrix.os, 'windows') }} + shell: bash -l {0} + run: | # necessary when we don't activate the environment + echo "INCLUDE=$CONDA_PREFIX\\Library\\include" >> $GITHUB_ENV + echo "LIB=$CONDA_PREFIX\\Library\\lib" >> $GITHUB_ENV + echo "LIBPATH=$CONDA_PREFIX\\Library\\lib" >> $GITHUB_ENV + echo "$CONDA_PREFIX\\Library\\bin" >> $GITHUB_PATH + # Any *nix: - name: Install Python dependencies - nix - if: ${{ !startsWith(matrix.os, 'windows') }} + # if: ${{ !startsWith(matrix.os, 'windows') }} run: python -m pip install --upgrade tox codecov - name: Run tests - nix - if: ${{ !startsWith(matrix.os, 'windows') }} + # if: ${{ !startsWith(matrix.os, 'windows') }} run: tox -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }} # Coverage: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d39dcb610..7e30e2643 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -6,7 +6,8 @@ on: - edited pull_request: branches: - - main + # - main + - DISABLED env: CIBW_BUILD: "cp39-* cp310-* cp311-*" From 57afccbd6706e751d16ad4e8ec7c43797043df41 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 11:39:40 -0400 Subject: [PATCH 04/17] force update some things --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eff917b53..2159fbfed 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -149,7 +149,7 @@ jobs: # Any *nix: - name: Install Python dependencies - nix # if: ${{ !startsWith(matrix.os, 'windows') }} - run: python -m pip install --upgrade tox codecov + run: python -m pip install --upgrade tox codecov pip wheel build - name: Run tests - nix # if: ${{ !startsWith(matrix.os, 'windows') }} From acea8abdec8d88fbb3ba6b6990d828fb9449a1f5 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 12:32:34 -0400 Subject: [PATCH 05/17] remove C99 var length array --- gala/potential/potential/src/cpotential.c | 28 +++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/gala/potential/potential/src/cpotential.c b/gala/potential/potential/src/cpotential.c index 55ae14d2f..311820bae 100644 --- a/gala/potential/potential/src/cpotential.c +++ b/gala/potential/potential/src/cpotential.c @@ -33,7 +33,7 @@ void apply_rotate(double *q_in, double *R, int n_dim, int transpose, void apply_shift_rotate(double *q_in, double *q0, double *R, int n_dim, int transpose, double *q_out) { - double tmp[n_dim]; + double *tmp = calloc(sizeof(double), n_dim); int j; // Shift to the specified origin @@ -43,13 +43,14 @@ void apply_shift_rotate(double *q_in, double *q0, double *R, int n_dim, // Apply rotation matrix apply_rotate(&tmp[0], R, n_dim, transpose, q_out); + free(tmp); } double c_potential(CPotential *p, double t, double *qp) { double v = 0; int i, j; - double qp_trans[p->n_dim]; + double *qp_trans = calloc(sizeof(double), p->n_dim); for (i=0; i < p->n_components; i++) { for (j=0; j < p->n_dim; j++) @@ -59,6 +60,8 @@ double c_potential(CPotential *p, double t, double *qp) { v = v + (p->value)[i](t, (p->parameters)[i], &qp_trans[0], p->n_dim); } + free(qp_trans); + return v; } @@ -66,7 +69,7 @@ double c_potential(CPotential *p, double t, double *qp) { double c_density(CPotential *p, double t, double *qp) { double v = 0; int i, j; - double qp_trans[p->n_dim]; + double *qp_trans = calloc(sizeof(double), p->n_dim); for (i=0; i < p->n_components; i++) { for (j=0; j < p->n_dim; j++) @@ -76,14 +79,16 @@ double c_density(CPotential *p, double t, double *qp) { v = v + (p->density)[i](t, (p->parameters)[i], &qp_trans[0], p->n_dim); } + free(qp_trans); + return v; } void c_gradient(CPotential *p, double t, double *qp, double *grad) { int i, j; - double qp_trans[p->n_dim]; - double tmp_grad[p->n_dim]; + double *qp_trans = calloc(sizeof(double), p->n_dim); + double *tmp_grad = calloc(sizeof(double), p->n_dim); for (i=0; i < p->n_dim; i++) { grad[i] = 0.; @@ -103,12 +108,15 @@ void c_gradient(CPotential *p, double t, double *qp, double *grad) { &tmp_grad[0]); apply_rotate(&tmp_grad[0], (p->R)[i], p->n_dim, 1, &grad[0]); } + + free(qp_trans); + free(tmp_grad); } void c_hessian(CPotential *p, double t, double *qp, double *hess) { int i; - double qp_trans[p->n_dim]; + double *qp_trans = calloc(sizeof(double), p->n_dim); for (i=0; i < pow(p->n_dim,2); i++) { hess[i] = 0.; @@ -125,7 +133,7 @@ void c_hessian(CPotential *p, double t, double *qp, double *hess) { // TODO: here - need to apply inverse rotation to the Hessian! // - Hessian calculation for potentials with rotations are disabled } - + free(qp_trans); } @@ -206,7 +214,7 @@ void c_nbody_acceleration(CPotential **pots, double t, double *qp, int i, j, k; CPotential *body_pot; int ps_ndim = 2 * ndim; // 6, for 3D position/velocity - double f2[ndim]; + double *f2 = calloc(sizeof(double), ndim); for (j=0; j < nbody; j++) { // the particles generating force body_pot = pots[j]; @@ -225,6 +233,7 @@ void c_nbody_acceleration(CPotential **pots, double t, double *qp, } } } + free(f2); } // TODO: this is a hack to get nbody leapfrog working @@ -235,7 +244,7 @@ void c_nbody_gradient_symplectic( ) { int i, j, k; CPotential *body_pot; - double f2[ndim]; + double *f2 = calloc(sizeof(double), ndim); for (j=0; j < nbody; j++) { // the particles generating force body_pot = pots[j]; @@ -251,4 +260,5 @@ void c_nbody_gradient_symplectic( for (k=0; k < ndim; k++) grad[k] += f2[k]; } + free(f2); } \ No newline at end of file From f8f30fdc5c24ea42c7d8f751d79b23c1e678e2db Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 12:32:43 -0400 Subject: [PATCH 06/17] try different glob for packaging --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5c6b72128..cc4945ea9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,7 +86,8 @@ build-backend = "setuptools.build_meta" [tool.setuptools.packages.find] where = ["."] -include = ["gala", "gala.*"] +# include = ["gala", "gala.*"] +include = ["gala*"] [tool.setuptools.package-data] "*" = ["*.c"] From be13ea6d94b31f0a2234b89e8649ca62d69e77f4 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 12:48:35 -0400 Subject: [PATCH 07/17] windows specific stuff --- gala/potential/potential/builtin/builtin_potentials.c | 3 +++ gala/potential/potential/src/cpotential.c | 1 + 2 files changed, 4 insertions(+) diff --git a/gala/potential/potential/builtin/builtin_potentials.c b/gala/potential/potential/builtin/builtin_potentials.c index d4140fbe5..74503b369 100644 --- a/gala/potential/potential/builtin/builtin_potentials.c +++ b/gala/potential/potential/builtin/builtin_potentials.c @@ -1,3 +1,6 @@ +// For Windows... +#define _USE_MATH_DEFINES + #include #include #include diff --git a/gala/potential/potential/src/cpotential.c b/gala/potential/potential/src/cpotential.c index 311820bae..e7ef18376 100644 --- a/gala/potential/potential/src/cpotential.c +++ b/gala/potential/potential/src/cpotential.c @@ -1,5 +1,6 @@ #include #include "cpotential.h" +#include void apply_rotate(double *q_in, double *R, int n_dim, int transpose, From 7db42a21c2309a4275ab026982e9a14579d2d937 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 20:27:46 -0400 Subject: [PATCH 08/17] add null definitions of functions for windows --- .../potential/potential/builtin/builtin_potentials.c | 8 ++++++++ gala/potential/potential/builtin/cybuiltin.pyx | 12 +++++++----- gala/potential/potential/builtin/multipole.c | 12 +++++++++++- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/gala/potential/potential/builtin/builtin_potentials.c b/gala/potential/potential/builtin/builtin_potentials.c index 74503b369..15a38f38d 100644 --- a/gala/potential/potential/builtin/builtin_potentials.c +++ b/gala/potential/potential/builtin/builtin_potentials.c @@ -669,6 +669,14 @@ void powerlawcutoff_hessian(double t, double *pars, double *q, int n_dim, double #endif +// NOTE: Only Windows needs the definitions here to link... not sure why +#if USE_GSL == 0 +double powerlaw_density(double t, double *pars, double *q, int n_dim) { return 0; } +double powerlaw_value(double t, double *pars, double *q, int n_dim) { return 0; } +void powerlaw_gradient(double t, double *pars, double *q, int n_dim, double *grad){} +void powerlaw_hessian(double t, double *pars, double *q, int n_dim, double *hess) {} +#endif + /* --------------------------------------------------------------------------- Stone-Ostriker potential from Stone & Ostriker (2015) */ diff --git a/gala/potential/potential/builtin/cybuiltin.pyx b/gala/potential/potential/builtin/cybuiltin.pyx index cf18aeebd..92fe55970 100644 --- a/gala/potential/potential/builtin/cybuiltin.pyx +++ b/gala/potential/potential/builtin/cybuiltin.pyx @@ -65,11 +65,6 @@ cdef extern from "potential/potential/builtin/builtin_potentials.h": double jaffe_density(double t, double *pars, double *q, int n_dim) nogil void jaffe_hessian(double t, double *pars, double *q, int n_dim, double *hess) nogil - double powerlawcutoff_value(double t, double *pars, double *q, int n_dim) nogil - void powerlawcutoff_gradient(double t, double *pars, double *q, int n_dim, double *grad) nogil - double powerlawcutoff_density(double t, double *pars, double *q, int n_dim) nogil - void powerlawcutoff_hessian(double t, double *pars, double *q, int n_dim, double *hess) nogil - double stone_value(double t, double *pars, double *q, int n_dim) nogil void stone_gradient(double t, double *pars, double *q, int n_dim, double *grad) nogil double stone_density(double t, double *pars, double *q, int n_dim) nogil @@ -121,6 +116,13 @@ cdef extern from "potential/potential/builtin/builtin_potentials.h": double longmuralibar_density(double t, double *pars, double *q, int n_dim) nogil void longmuralibar_hessian(double t, double *pars, double *q, int n_dim, double *hess) nogil +# NOTE: these should probably be conditionally included, but I couldn't get that to work +cdef extern from "potential/potential/builtin/builtin_potentials.h": + double powerlawcutoff_value(double t, double *pars, double *q, int n_dim) nogil + void powerlawcutoff_gradient(double t, double *pars, double *q, int n_dim, double *grad) nogil + double powerlawcutoff_density(double t, double *pars, double *q, int n_dim) nogil + void powerlawcutoff_hessian(double t, double *pars, double *q, int n_dim, double *hess) nogil + cdef extern from "potential/potential/builtin/multipole.h": double mp_potential(double t, double *pars, double *q, int n_dim) nogil void mp_gradient(double t, double *pars, double *q, int n_dim, double *grad) nogil diff --git a/gala/potential/potential/builtin/multipole.c b/gala/potential/potential/builtin/multipole.c index c67a4253d..7cdb33289 100644 --- a/gala/potential/potential/builtin/multipole.c +++ b/gala/potential/potential/builtin/multipole.c @@ -809,6 +809,16 @@ double axisym_cylspline_density(double t, double *pars, double *q, int n_dim) { return dens; } +#endif -#endif \ No newline at end of file +// NOTE: Only Windows needs the definitions here to link... not sure why +#if USE_GSL == 0 + double mp_potential(double t, double *pars, double *q, int n_dim) { return 0.; } + void mp_gradient(double t, double *pars, double *q, int n_dim, double *grad) {} + double mp_density(double t, double *pars, double *q, int n_dim) { return 0.; } + + double axisym_cylspline_value(double t, double *pars, double *q, int n_dim) { return 0.; } + void axisym_cylspline_gradient(double t, double *pars, double *q, int n_dim, double *grad) {} + double axisym_cylspline_density(double t, double *pars, double *q, int n_dim) { return 0.; } +#endif From 893f513dfa55153ac05bd4a41f57e156e6a08676 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 20:40:01 -0400 Subject: [PATCH 09/17] fix name of dummy funcs and use pytest not tox --- .github/workflows/tests.yml | 8 ++++++-- gala/potential/potential/builtin/builtin_potentials.c | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2159fbfed..9354c36e0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -149,12 +149,16 @@ jobs: # Any *nix: - name: Install Python dependencies - nix # if: ${{ !startsWith(matrix.os, 'windows') }} - run: python -m pip install --upgrade tox codecov pip wheel build + run: python -m pip install --upgrade tox codecov pip wheel build pytest - name: Run tests - nix - # if: ${{ !startsWith(matrix.os, 'windows') }} + if: ${{ !startsWith(matrix.os, 'windows') }} run: tox -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }} + - name: Run test - Windows + if: ${{ startsWith(matrix.os, 'windows') }} + run: pytest . + # Coverage: - name: Upload coverage report to codecov uses: codecov/codecov-action@v3.1.4 diff --git a/gala/potential/potential/builtin/builtin_potentials.c b/gala/potential/potential/builtin/builtin_potentials.c index 15a38f38d..05504b46b 100644 --- a/gala/potential/potential/builtin/builtin_potentials.c +++ b/gala/potential/potential/builtin/builtin_potentials.c @@ -671,10 +671,10 @@ void powerlawcutoff_hessian(double t, double *pars, double *q, int n_dim, double // NOTE: Only Windows needs the definitions here to link... not sure why #if USE_GSL == 0 -double powerlaw_density(double t, double *pars, double *q, int n_dim) { return 0; } -double powerlaw_value(double t, double *pars, double *q, int n_dim) { return 0; } -void powerlaw_gradient(double t, double *pars, double *q, int n_dim, double *grad){} -void powerlaw_hessian(double t, double *pars, double *q, int n_dim, double *hess) {} +double powerlawcutoff_density(double t, double *pars, double *q, int n_dim) { return 0; } +double powerlawcutoff_value(double t, double *pars, double *q, int n_dim) { return 0; } +void powerlawcutoff_gradient(double t, double *pars, double *q, int n_dim, double *grad){} +void powerlawcutoff_hessian(double t, double *pars, double *q, int n_dim, double *hess) {} #endif /* --------------------------------------------------------------------------- From 4ac289376a0d95bf3c41cdfcca73cee69fd9b3c2 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 20:47:31 -0400 Subject: [PATCH 10/17] have to install before pytest --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9354c36e0..f685fa6d8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -157,7 +157,9 @@ jobs: - name: Run test - Windows if: ${{ startsWith(matrix.os, 'windows') }} - run: pytest . + run: | + python -m pip install .[test] + pytest gala # Coverage: - name: Upload coverage report to codecov From c1ab46204d40a3b99876876f4954fc029095379f Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 20:47:49 -0400 Subject: [PATCH 11/17] bash --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f685fa6d8..e8e09f735 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -157,6 +157,7 @@ jobs: - name: Run test - Windows if: ${{ startsWith(matrix.os, 'windows') }} + shell: bash -l {0} run: | python -m pip install .[test] pytest gala From 758462eee5951cb8ca49d3850aa094041a08fd21 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 21:04:02 -0400 Subject: [PATCH 12/17] min version --- gala/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gala/__init__.py b/gala/__init__.py index 6daf7642b..1f602f386 100644 --- a/gala/__init__.py +++ b/gala/__init__.py @@ -4,20 +4,22 @@ import sys -__author__ = 'adrn ' +__author__ = "adrn " from ._astropy_init import * # Enforce Python version check during package import. # This is the same check as the one at the top of setup.py -__minimum_python_version__ = "3.7" +__minimum_python_version__ = "3.9" class UnsupportedPythonError(Exception): pass -if sys.version_info < tuple((int(val) - for val in __minimum_python_version__.split('.'))): +if sys.version_info < tuple( + (int(val) for val in __minimum_python_version__.split(".")) +): raise UnsupportedPythonError( - f"packagename does not support Python < {__minimum_python_version__}") + f"packagename does not support Python < {__minimum_python_version__}" + ) From 9355e4f5ecd35f31f8c7dab453c5b4053f8569c5 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Thu, 10 Aug 2023 21:04:17 -0400 Subject: [PATCH 13/17] more dummy functions --- gala/potential/scf/src/bfe.c | 25 +++++++++++++++++++++++++ gala/potential/scf/src/coeff_helper.c | 9 +++++++++ 2 files changed, 34 insertions(+) diff --git a/gala/potential/scf/src/bfe.c b/gala/potential/scf/src/bfe.c index 6d1b119f8..a929a2349 100644 --- a/gala/potential/scf/src/bfe.c +++ b/gala/potential/scf/src/bfe.c @@ -491,3 +491,28 @@ void scf_interp_gradient(double t, double *pars, double *q, int n_dim, } #endif + +// NOTE: Only Windows needs the definitions here to link... not sure why +#if USE_GSL == 1 +void scf_density_helper(double *xyz, int K, double M, double r_s, + double *Snlm, double *Tnlm, + int nmax, int lmax, double *dens) {} + +void scf_potential_helper(double *xyz, int K, + double G, double M, double r_s, + double *Snlm, double *Tnlm, + int nmax, int lmax, double *val) {} + +void scf_gradient_helper(double *xyz, int K, + double G, double M, double r_s, + double *Snlm, double *Tnlm, + int nmax, int lmax, double *grad) {} + +double scf_value(double t, double *pars, double *q, int n_dim) { return 0.; } +void scf_gradient(double t, double *pars, double *q, int n_dim, double *grad) {} +double scf_density(double t, double *pars, double *q, int n_dim) { return 0.; } + +double scf_interp_value(double t, double *pars, double *q, int n_dim) { return 0.; } +void scf_interp_gradient(double t, double *pars, double *q, int n_dim, double *grad) {} +double scf_interp_density(double t, double *pars, double *q, int n_dim) {return 0.; } +#endif \ No newline at end of file diff --git a/gala/potential/scf/src/coeff_helper.c b/gala/potential/scf/src/coeff_helper.c index 6ac4835a2..61c34270a 100644 --- a/gala/potential/scf/src/coeff_helper.c +++ b/gala/potential/scf/src/coeff_helper.c @@ -115,3 +115,12 @@ void c_STnlm_var_discrete(double *s, double *phi, double *X, double *m_k, int K, } } #endif + + +// NOTE: Only Windows needs the definitions here to link... not sure why +#if USE_GSL == 1 +double c_Snlm_integrand(double phi, double X, double xsi, double density, int n, int l, int m) { return 0.; } +double c_Tnlm_integrand(double phi, double X, double xsi, double density, int n, int l, int m) { return 0.; } +void c_STnlm_discrete(double *s, double *phi, double *X, double *m_k, int K, int n, int l, int m, double *ST) {} +void c_STnlm_var_discrete(double *s, double *phi, double *X, double *m_k, int K, int n, int l, int m, double *ST_var) {} +#endif \ No newline at end of file From 7ee371b298a086efc60fdac07a5054b5616293a2 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Fri, 11 Aug 2023 07:13:31 -0400 Subject: [PATCH 14/17] oops should be 0 --- gala/potential/scf/src/bfe.c | 2 +- gala/potential/scf/src/coeff_helper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gala/potential/scf/src/bfe.c b/gala/potential/scf/src/bfe.c index a929a2349..4bb9dd5df 100644 --- a/gala/potential/scf/src/bfe.c +++ b/gala/potential/scf/src/bfe.c @@ -493,7 +493,7 @@ void scf_interp_gradient(double t, double *pars, double *q, int n_dim, #endif // NOTE: Only Windows needs the definitions here to link... not sure why -#if USE_GSL == 1 +#if USE_GSL == 0 void scf_density_helper(double *xyz, int K, double M, double r_s, double *Snlm, double *Tnlm, int nmax, int lmax, double *dens) {} diff --git a/gala/potential/scf/src/coeff_helper.c b/gala/potential/scf/src/coeff_helper.c index 61c34270a..1dcbab97f 100644 --- a/gala/potential/scf/src/coeff_helper.c +++ b/gala/potential/scf/src/coeff_helper.c @@ -118,7 +118,7 @@ void c_STnlm_var_discrete(double *s, double *phi, double *X, double *m_k, int K, // NOTE: Only Windows needs the definitions here to link... not sure why -#if USE_GSL == 1 +#if USE_GSL == 0 double c_Snlm_integrand(double phi, double X, double xsi, double density, int n, int l, int m) { return 0.; } double c_Tnlm_integrand(double phi, double X, double xsi, double density, int n, int l, int m) { return 0.; } void c_STnlm_discrete(double *s, double *phi, double *X, double *m_k, int K, int n, int l, int m, double *ST) {} From 58148dcb634736fb91ff294829b8af545e50c2fb Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Fri, 11 Aug 2023 08:01:36 -0400 Subject: [PATCH 15/17] try to get GSL working --- .github/workflows/tests.yml | 60 +++++++++++++------------------------ 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e8e09f735..bc8c7f570 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -91,27 +91,6 @@ jobs: with: python-version: ${{ matrix.python }} - # Windows: - # - uses: conda-incubator/setup-miniconda@v2 - # if: startsWith(matrix.os, 'windows') - # with: - # auto-update-conda: true - # python-version: ${{ matrix.python-version }} - - # - name: Install Python dependencies - Windows - # if: startsWith(matrix.os, 'windows') - # shell: bash -l {0} - # run: | - # conda install -c conda-forge -q gsl python=3.9 libpython - # python -m pip install -e .[test] - # python -m pip install tox - - # - name: Run tests - Windows - # if: startsWith(matrix.os, 'windows') - # shell: bash -l {0} - # run: | - # tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} ${{ matrix.toxposargs }} - # Mac: - name: Setup Mac - GSL if: startsWith(matrix.os, 'mac') @@ -126,41 +105,42 @@ jobs: sudo apt-get install gsl-bin libgsl0-dev build-essential sudo apt-get install libhdf5-serial-dev # TODO: remove when h5py has 3.11 wheels + - name: Install CI Python dependencies (e.g., tox) + if: ${{ !startsWith(matrix.os, 'windows') }} + run: python -m pip install --upgrade tox codecov + + - name: Run tests - Linux and Mac + if: ${{ !startsWith(matrix.os, 'windows') }} + run: tox -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }} + # Windows: # Install just the GSL using conda - uses: mamba-org/setup-micromamba@v1 if: ${{ startsWith(matrix.os, 'windows') }} with: environment-name: gsl + create-args: >- + python=${{ matrix.python }} + gsl condarc: | channels: - conda-forge - create-args: gsl + init-shell: bash powershell - - name: Set GSL environment variables + - name: Setup CI environment - Windows if: ${{ startsWith(matrix.os, 'windows') }} shell: bash -l {0} - run: | # necessary when we don't activate the environment - echo "INCLUDE=$CONDA_PREFIX\\Library\\include" >> $GITHUB_ENV - echo "LIB=$CONDA_PREFIX\\Library\\lib" >> $GITHUB_ENV - echo "LIBPATH=$CONDA_PREFIX\\Library\\lib" >> $GITHUB_ENV - echo "$CONDA_PREFIX\\Library\\bin" >> $GITHUB_PATH - - # Any *nix: - - name: Install Python dependencies - nix - # if: ${{ !startsWith(matrix.os, 'windows') }} - run: python -m pip install --upgrade tox codecov pip wheel build pytest - - - name: Run tests - nix - if: ${{ !startsWith(matrix.os, 'windows') }} - run: tox -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }} + run: | + conda activate gsl + python -m pip install --upgrade tox codecov + micromamba info - - name: Run test - Windows + - name: Run tests - Windows if: ${{ startsWith(matrix.os, 'windows') }} shell: bash -l {0} run: | - python -m pip install .[test] - pytest gala + micromamba info + tox -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }} # Coverage: - name: Upload coverage report to codecov From 692f3fe32378f90f55605077a16ed634c254d202 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Fri, 11 Aug 2023 08:27:35 -0400 Subject: [PATCH 16/17] remove comment --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cc4945ea9..32b91f53d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,7 +86,6 @@ build-backend = "setuptools.build_meta" [tool.setuptools.packages.find] where = ["."] -# include = ["gala", "gala.*"] include = ["gala*"] [tool.setuptools.package-data] From 4dbd40d977822a35ed6ccd5e6317ab7712343953 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Fri, 11 Aug 2023 08:27:46 -0400 Subject: [PATCH 17/17] add temporary step to pip install pkg --- .github/workflows/tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bc8c7f570..09457aa5e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -135,6 +135,12 @@ jobs: python -m pip install --upgrade tox codecov micromamba info + - name: TEMP - install gala + if: ${{ startsWith(matrix.os, 'windows') }} + shell: bash -l {0} + run: | + python -m pip install . -v + - name: Run tests - Windows if: ${{ startsWith(matrix.os, 'windows') }} shell: bash -l {0}