From eca41bb3a61508949ac6f381c959996878a313d6 Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Tue, 17 Jun 2025 13:56:45 +0100 Subject: [PATCH 01/20] Update setup.py, build_package.yml ad verify_package.yml Add Python 11 and 12 to workflows and config file --- .github/workflows/build_package.yml | 2 +- .github/workflows/verify_package.yml | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml index ea003859..00a569bd 100644 --- a/.github/workflows/build_package.yml +++ b/.github/workflows/build_package.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.9', '3.10' ] + python-version: [ '3.9', '3.10', '3.11', '3.12' ] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/verify_package.yml b/.github/workflows/verify_package.yml index 76458826..58775495 100644 --- a/.github/workflows/verify_package.yml +++ b/.github/workflows/verify_package.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.9', '3.10' ] + python-version: [ '3.9', '3.10', '3.11', '3.12' ] steps: - uses: actions/checkout@v4 diff --git a/setup.py b/setup.py index 7c5d9b04..5f6e9dce 100644 --- a/setup.py +++ b/setup.py @@ -63,7 +63,7 @@ # "xesmf>=0.3.0", # Optional. Not part of main package # "esmpy>=8.0.0", # Optional. Not part of main package ], - "python_requires": ">3.8,<3.11", + "python_requires": ">3.8,<3.13", "packages": ["coast", "coast.data", "coast._utils", "coast.diagnostics"], "include_package_data": True, "github": "British-Oceanographic-Data-Centre", From 1ccba94fca7ee3befb4870ce1958282ce4a3f972 Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Fri, 20 Jun 2025 11:14:08 +0100 Subject: [PATCH 02/20] Update build.sh Update script to install hdf5 dependency --- build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.sh b/build.sh index 84f1c086..7c6bc556 100755 --- a/build.sh +++ b/build.sh @@ -8,5 +8,10 @@ echo "Cleaning up old versions..." rm -rf ./build/* ./dist/* ./Example_Python_Package.egg-info echo "Building package for distribution..." ./venv/bin/python ./setup.py sdist bdist_wheel +CONDA_BASE=$(conda info --base) +source "${CONDA_BASE}/etc/profile.d/conda.sh" +conda create -n coast-toolbox python=3.10 +conda activate coast-toolbox +conda install conda-forge::hdf5 echo "Done!" From 6f44f2da75241c106c2d5626682893c5ae23f793 Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Fri, 20 Jun 2025 12:02:38 +0100 Subject: [PATCH 03/20] Update setup_environment.sh Add conda command to clean unused packages and caches --- setup_environment.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup_environment.sh b/setup_environment.sh index d3d0ab60..41bb9939 100755 --- a/setup_environment.sh +++ b/setup_environment.sh @@ -11,6 +11,7 @@ echo "Installing required packages..." ./venv/bin/pip install setuptools wheel twine CONDA_BASE=$(conda info --base) source "${CONDA_BASE}/etc/profile.d/conda.sh" +conda clean --all conda env update --prune --file environment.yml conda activate coast From 203ad2aa445556eb560e30b4079292c6c3bf4369 Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Fri, 20 Jun 2025 13:15:40 +0100 Subject: [PATCH 04/20] Update setup_environment.sh Set conda output verbosity to level 3 --- setup_environment.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup_environment.sh b/setup_environment.sh index 41bb9939..246be967 100755 --- a/setup_environment.sh +++ b/setup_environment.sh @@ -12,6 +12,7 @@ echo "Installing required packages..." CONDA_BASE=$(conda info --base) source "${CONDA_BASE}/etc/profile.d/conda.sh" conda clean --all +conda config --set verbosity 3 --env conda env update --prune --file environment.yml conda activate coast From 8250aa17f0b46a769fc2c31e21badc0e58640dab Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Fri, 20 Jun 2025 13:32:38 +0100 Subject: [PATCH 05/20] Update setup_environment.sh Remove conda clean command --- setup_environment.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/setup_environment.sh b/setup_environment.sh index 246be967..9f8d09ea 100755 --- a/setup_environment.sh +++ b/setup_environment.sh @@ -11,7 +11,6 @@ echo "Installing required packages..." ./venv/bin/pip install setuptools wheel twine CONDA_BASE=$(conda info --base) source "${CONDA_BASE}/etc/profile.d/conda.sh" -conda clean --all conda config --set verbosity 3 --env conda env update --prune --file environment.yml conda activate coast From ea930e127fea759ffc599680106eadd5289341ce Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Fri, 20 Jun 2025 13:33:59 +0100 Subject: [PATCH 06/20] Update verify_package.yml Add conda clean to remove unused packages and caches. Also, add conda command to set conda output verbosity to level 3 --- .github/workflows/verify_package.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/verify_package.yml b/.github/workflows/verify_package.yml index 58775495..03846d71 100644 --- a/.github/workflows/verify_package.yml +++ b/.github/workflows/verify_package.yml @@ -34,6 +34,8 @@ jobs: run: | CONDA_BASE=$(conda info --base) source "${CONDA_BASE}/etc/profile.d/conda.sh" + conda clean --all + conda config --set verbosity 3 --env conda env update --prune --file environment.yml conda activate coast sudo apt-get update From fe2f20010cbe6c36ca83470ca4b19cc7eff538ce Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Fri, 20 Jun 2025 14:16:46 +0100 Subject: [PATCH 07/20] Update verify_package.yml Remove conda clean command --- .github/workflows/verify_package.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/verify_package.yml b/.github/workflows/verify_package.yml index 03846d71..9cc19313 100644 --- a/.github/workflows/verify_package.yml +++ b/.github/workflows/verify_package.yml @@ -34,7 +34,6 @@ jobs: run: | CONDA_BASE=$(conda info --base) source "${CONDA_BASE}/etc/profile.d/conda.sh" - conda clean --all conda config --set verbosity 3 --env conda env update --prune --file environment.yml conda activate coast From 182a0760a1ec07880c7c9e0c9f9f47d785568903 Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Fri, 20 Jun 2025 14:44:25 +0100 Subject: [PATCH 08/20] Update build.sh Remove conda commands to create conda environment and install hdf5 dependency --- build.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/build.sh b/build.sh index 7c6bc556..84f1c086 100755 --- a/build.sh +++ b/build.sh @@ -8,10 +8,5 @@ echo "Cleaning up old versions..." rm -rf ./build/* ./dist/* ./Example_Python_Package.egg-info echo "Building package for distribution..." ./venv/bin/python ./setup.py sdist bdist_wheel -CONDA_BASE=$(conda info --base) -source "${CONDA_BASE}/etc/profile.d/conda.sh" -conda create -n coast-toolbox python=3.10 -conda activate coast-toolbox -conda install conda-forge::hdf5 echo "Done!" From 19b7e8f89b02aae79915b5ca77a288581885b161 Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Tue, 24 Jun 2025 11:17:02 +0100 Subject: [PATCH 09/20] Update setup.py and environment.yml Update version to cython dependency --- environment.yml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index a21a943d..11906a7d 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ channels: - nodefaults dependencies: - python==3.10 - - cython==3.1.1 + - cython<3.0.0 - cartopy==0.23.0 - gsw==3.6.19 - xarray[complete]==2023.7.0 diff --git a/setup.py b/setup.py index 5f6e9dce..dac1bd73 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ "aiohttp==3.11.13", "tqdm==4.67.1", "pyproj==3.6.1", - "cython==3.1.1", + "cython<3.0.0", "cartopy==0.23.0", "h5py==3.6.0", "zarr==2.18.2", From 34f3caab953dd0bebc5e2bf48c6c57027dd95cda Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Tue, 24 Jun 2025 11:26:44 +0100 Subject: [PATCH 10/20] Update build.sh Add conda commands to install hdf5 dependency --- build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.sh b/build.sh index 84f1c086..7c6bc556 100755 --- a/build.sh +++ b/build.sh @@ -8,5 +8,10 @@ echo "Cleaning up old versions..." rm -rf ./build/* ./dist/* ./Example_Python_Package.egg-info echo "Building package for distribution..." ./venv/bin/python ./setup.py sdist bdist_wheel +CONDA_BASE=$(conda info --base) +source "${CONDA_BASE}/etc/profile.d/conda.sh" +conda create -n coast-toolbox python=3.10 +conda activate coast-toolbox +conda install conda-forge::hdf5 echo "Done!" From b6e20c06306cc5e340decfcd7191688a06e0a28e Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Tue, 24 Jun 2025 11:36:11 +0100 Subject: [PATCH 11/20] Update setup.py Move cython dependency to be installed before PyYAML dependency --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index dac1bd73..7493f9ad 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ "keywords": ["NEMO", "shallow water", "ocean assessment"], "project_urls": {"documentation": "https://british-oceanographic-data-centre.github.io/COAsT/"}, "install_requires": [ + "cython<3.0.0", "PyYAML==6.0", "oyaml==1.0", "pytest==7.1.1", @@ -53,7 +54,6 @@ "aiohttp==3.11.13", "tqdm==4.67.1", "pyproj==3.6.1", - "cython<3.0.0", "cartopy==0.23.0", "h5py==3.6.0", "zarr==2.18.2", From 6fbeb41aedbfd19c5c18610a991a765ba18cb424 Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Tue, 24 Jun 2025 12:08:04 +0100 Subject: [PATCH 12/20] Update build.sh Move conda commands to be run before installing the rest of dependencies --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 7c6bc556..46e01e49 100755 --- a/build.sh +++ b/build.sh @@ -7,11 +7,11 @@ mkdir -p build dist echo "Cleaning up old versions..." rm -rf ./build/* ./dist/* ./Example_Python_Package.egg-info echo "Building package for distribution..." -./venv/bin/python ./setup.py sdist bdist_wheel CONDA_BASE=$(conda info --base) source "${CONDA_BASE}/etc/profile.d/conda.sh" conda create -n coast-toolbox python=3.10 conda activate coast-toolbox conda install conda-forge::hdf5 +./venv/bin/python ./setup.py sdist bdist_wheel echo "Done!" From f713321e20918b6b78010e6fd38cf15556d1ad4c Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Tue, 24 Jun 2025 18:00:46 +0100 Subject: [PATCH 13/20] Update config files Update config files to install specific versions of cython and PyYAML depedencies. Also, activate conda environment in setup-environment, build-package and generate-conda-metadata steps --- build.sh | 10 +++------- environment.yml | 4 ++-- generate_conda_meta.sh | 2 +- setup.py | 4 ++-- setup_environment.sh | 10 ++-------- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/build.sh b/build.sh index 46e01e49..2f918362 100755 --- a/build.sh +++ b/build.sh @@ -7,11 +7,7 @@ mkdir -p build dist echo "Cleaning up old versions..." rm -rf ./build/* ./dist/* ./Example_Python_Package.egg-info echo "Building package for distribution..." -CONDA_BASE=$(conda info --base) -source "${CONDA_BASE}/etc/profile.d/conda.sh" -conda create -n coast-toolbox python=3.10 -conda activate coast-toolbox -conda install conda-forge::hdf5 -./venv/bin/python ./setup.py sdist bdist_wheel +conda activate coast +python ./setup.py sdist bdist_wheel -echo "Done!" +echo "Done!" \ No newline at end of file diff --git a/environment.yml b/environment.yml index 11906a7d..292d7f16 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ channels: - nodefaults dependencies: - python==3.10 - - cython<3.0.0 + - cython==0.29.37 - cartopy==0.23.0 - gsw==3.6.19 - xarray[complete]==2023.7.0 @@ -31,5 +31,5 @@ dependencies: - spyder==6.0.7 - jupyterlab==4.4.3 - aiohttp==3.11.13 - - PyYAML==6.0 + - PyYAML==5.4.1 - oyaml==1.0 \ No newline at end of file diff --git a/generate_conda_meta.sh b/generate_conda_meta.sh index 132034a9..1d35e4e0 100644 --- a/generate_conda_meta.sh +++ b/generate_conda_meta.sh @@ -1,3 +1,3 @@ #!/bin/bash - +conda activate coast python setup.py conda diff --git a/setup.py b/setup.py index 7493f9ad..e983a439 100644 --- a/setup.py +++ b/setup.py @@ -31,8 +31,8 @@ "keywords": ["NEMO", "shallow water", "ocean assessment"], "project_urls": {"documentation": "https://british-oceanographic-data-centre.github.io/COAsT/"}, "install_requires": [ - "cython<3.0.0", - "PyYAML==6.0", + "cython==0.29.37", + "PyYAML==5.4.1", "oyaml==1.0", "pytest==7.1.1", "pytest-mock==3.7.0", diff --git a/setup_environment.sh b/setup_environment.sh index 9f8d09ea..253546d8 100755 --- a/setup_environment.sh +++ b/setup_environment.sh @@ -5,14 +5,8 @@ cd "$(dirname "$0")" # Set working directory echo "Cleaning up any existing virtual environment..." rm -rf ./venv -echo "Creating new virtual environment..." -python3 -m virtualenv ./venv echo "Installing required packages..." -./venv/bin/pip install setuptools wheel twine -CONDA_BASE=$(conda info --base) -source "${CONDA_BASE}/etc/profile.d/conda.sh" -conda config --set verbosity 3 --env -conda env update --prune --file environment.yml conda activate coast +conda install conda-forge::setuptools conda-forge::wheel conda-forge::twine -echo "Done!" +echo "Done!" \ No newline at end of file From e82e6836aef490582315f92e7b68bf0ec83704b2 Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Tue, 24 Jun 2025 18:12:44 +0100 Subject: [PATCH 14/20] Update setup_environment.sh Update script to intialise conda in a shell session --- setup_environment.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup_environment.sh b/setup_environment.sh index 253546d8..6401915d 100755 --- a/setup_environment.sh +++ b/setup_environment.sh @@ -6,6 +6,8 @@ cd "$(dirname "$0")" # Set working directory echo "Cleaning up any existing virtual environment..." rm -rf ./venv echo "Installing required packages..." +CONDA_BASE=$(conda info --base) +source "${CONDA_BASE}/etc/profile.d/conda.sh" conda activate coast conda install conda-forge::setuptools conda-forge::wheel conda-forge::twine From 5c0428501525d0f1f866bd12052673dd886dfb5f Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Tue, 24 Jun 2025 18:17:51 +0100 Subject: [PATCH 15/20] Update build.sh and generate_conda_meta.sh Update scripts to initialise conda in shell session --- build.sh | 2 ++ generate_conda_meta.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/build.sh b/build.sh index 2f918362..cb1150a9 100755 --- a/build.sh +++ b/build.sh @@ -7,6 +7,8 @@ mkdir -p build dist echo "Cleaning up old versions..." rm -rf ./build/* ./dist/* ./Example_Python_Package.egg-info echo "Building package for distribution..." +CONDA_BASE=$(conda info --base) +source "${CONDA_BASE}/etc/profile.d/conda.sh" conda activate coast python ./setup.py sdist bdist_wheel diff --git a/generate_conda_meta.sh b/generate_conda_meta.sh index 1d35e4e0..8c2eb57b 100644 --- a/generate_conda_meta.sh +++ b/generate_conda_meta.sh @@ -1,3 +1,5 @@ #!/bin/bash +CONDA_BASE=$(conda info --base) +source "${CONDA_BASE}/etc/profile.d/conda.sh" conda activate coast python setup.py conda From 4c36ca7069853408123aaca5b64b828b2c644df1 Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Tue, 24 Jun 2025 19:37:01 +0100 Subject: [PATCH 16/20] Update pyproject.toml and setup_environment.sh Add setuptools, wheel, twine and Cython dependencies to pyproject.toml file to be installed in a temporary build environment before setup.py is executed for sdist or bdis_wheel. Also, remove conda command that installs setuptools, wheel and twine dependencies from setup_environment.sh --- pyproject.toml | 5 ++++- setup_environment.sh | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 43ad8d63..d7d22100 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,6 @@ +[build-system] +requires = ["setuptools", "wheel", "twine", "Cython"] +build-backend = "setuptools.build_meta" [tool.black] line-length = 120 -target-version = ['py38', 'py39', 'py310'] +target-version = ['py38', 'py39', 'py310'] \ No newline at end of file diff --git a/setup_environment.sh b/setup_environment.sh index 6401915d..23bb0187 100755 --- a/setup_environment.sh +++ b/setup_environment.sh @@ -9,6 +9,5 @@ echo "Installing required packages..." CONDA_BASE=$(conda info --base) source "${CONDA_BASE}/etc/profile.d/conda.sh" conda activate coast -conda install conda-forge::setuptools conda-forge::wheel conda-forge::twine echo "Done!" \ No newline at end of file From 81c7644df72e500371d4707db45a88ca5910829f Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Wed, 25 Jun 2025 09:01:59 +0100 Subject: [PATCH 17/20] Update pyproject.toml and setup_environment.sh Remove build-system section from pyproject.tml file. Add conda command to install cython, setuptools, wheel and twine dependencies to setup_environment.sh --- pyproject.toml | 3 --- setup_environment.sh | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d7d22100..facd982b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,3 @@ -[build-system] -requires = ["setuptools", "wheel", "twine", "Cython"] -build-backend = "setuptools.build_meta" [tool.black] line-length = 120 target-version = ['py38', 'py39', 'py310'] \ No newline at end of file diff --git a/setup_environment.sh b/setup_environment.sh index 23bb0187..d19c60bb 100755 --- a/setup_environment.sh +++ b/setup_environment.sh @@ -9,5 +9,6 @@ echo "Installing required packages..." CONDA_BASE=$(conda info --base) source "${CONDA_BASE}/etc/profile.d/conda.sh" conda activate coast +conda install -c conda-forge cython setuptools wheel twine echo "Done!" \ No newline at end of file From 4c446d9c80557b7bde9e4a4e44a2013831d98622 Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Wed, 25 Jun 2025 09:15:47 +0100 Subject: [PATCH 18/20] Update build_package.yml Add conda command to activate environment before installing COAsT package --- .github/workflows/build_package.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml index 00a569bd..4402e3a7 100644 --- a/.github/workflows/build_package.yml +++ b/.github/workflows/build_package.yml @@ -36,6 +36,9 @@ jobs: ./build.sh - name: Test Package Install run: | + CONDA_BASE=$(conda info --base) + source "${CONDA_BASE}/etc/profile.d/conda.sh" + conda activate coast python -m pip install dist/coast-*.tar.gz - name: Generate Conda Metadata run: | From 98fceafa7207c87574da9a04a8fdb3de5c2ec637 Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Wed, 25 Jun 2025 10:29:56 +0100 Subject: [PATCH 19/20] Update unit_test_contents.yml Swap pip-install command for conda commands to install dependencies --- .github/workflows/unit_test_contents.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit_test_contents.yml b/.github/workflows/unit_test_contents.yml index 1c5d830d..ae61752e 100644 --- a/.github/workflows/unit_test_contents.yml +++ b/.github/workflows/unit_test_contents.yml @@ -17,7 +17,10 @@ jobs: python-version: ${{ matrix.python-version }} - name: Generate contents. run: | - pip install . + CONDA_BASE=$(conda info --base) + source "${CONDA_BASE}/etc/profile.d/conda.sh" + conda env update --prune --file environment.yml + conda activate coast mkdir -p example_files sudo apt-get update sudo apt-get install -y libgeos-dev From 410ab3d069f1208f45e60274ded50ebd0f968a9e Mon Sep 17 00:00:00 2001 From: Magda Juarez Date: Wed, 25 Jun 2025 10:39:32 +0100 Subject: [PATCH 20/20] Update unit_test_contents.yml Add pip command to install COAsT package --- .github/workflows/unit_test_contents.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_test_contents.yml b/.github/workflows/unit_test_contents.yml index ae61752e..91829a35 100644 --- a/.github/workflows/unit_test_contents.yml +++ b/.github/workflows/unit_test_contents.yml @@ -19,8 +19,9 @@ jobs: run: | CONDA_BASE=$(conda info --base) source "${CONDA_BASE}/etc/profile.d/conda.sh" - conda env update --prune --file environment.yml - conda activate coast + conda env update --prune --file environment.yml + conda activate coast + pip install . mkdir -p example_files sudo apt-get update sudo apt-get install -y libgeos-dev