diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml index ea003859..4402e3a7 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 @@ -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: | diff --git a/.github/workflows/unit_test_contents.yml b/.github/workflows/unit_test_contents.yml index 1c5d830d..91829a35 100644 --- a/.github/workflows/unit_test_contents.yml +++ b/.github/workflows/unit_test_contents.yml @@ -17,7 +17,11 @@ 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 + pip install . mkdir -p example_files sudo apt-get update sudo apt-get install -y libgeos-dev diff --git a/.github/workflows/verify_package.yml b/.github/workflows/verify_package.yml index 76458826..9cc19313 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 @@ -34,6 +34,7 @@ jobs: run: | 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 sudo apt-get update diff --git a/build.sh b/build.sh index 84f1c086..cb1150a9 100755 --- a/build.sh +++ b/build.sh @@ -7,6 +7,9 @@ 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 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 a21a943d..292d7f16 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ channels: - nodefaults dependencies: - python==3.10 - - cython==3.1.1 + - 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..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 diff --git a/pyproject.toml b/pyproject.toml index 43ad8d63..facd982b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [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.py b/setup.py index 7c5d9b04..e983a439 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,8 @@ "keywords": ["NEMO", "shallow water", "ocean assessment"], "project_urls": {"documentation": "https://british-oceanographic-data-centre.github.io/COAsT/"}, "install_requires": [ - "PyYAML==6.0", + "cython==0.29.37", + "PyYAML==5.4.1", "oyaml==1.0", "pytest==7.1.1", "pytest-mock==3.7.0", @@ -53,7 +54,6 @@ "aiohttp==3.11.13", "tqdm==4.67.1", "pyproj==3.6.1", - "cython==3.1.1", "cartopy==0.23.0", "h5py==3.6.0", "zarr==2.18.2", @@ -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", diff --git a/setup_environment.sh b/setup_environment.sh index d3d0ab60..d19c60bb 100755 --- a/setup_environment.sh +++ b/setup_environment.sh @@ -5,13 +5,10 @@ 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 env update --prune --file environment.yml conda activate coast +conda install -c conda-forge cython setuptools wheel twine -echo "Done!" +echo "Done!" \ No newline at end of file