From 044be7bc69e931f39156971c184eed454a522898 Mon Sep 17 00:00:00 2001 From: Caitlin Adams <25995927+caitlinadams@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:59:49 +1100 Subject: [PATCH 1/7] Create run-pytest.yml --- .github/workflows/run-pytest.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/run-pytest.yml diff --git a/.github/workflows/run-pytest.yml b/.github/workflows/run-pytest.yml new file mode 100644 index 0000000..3029095 --- /dev/null +++ b/.github/workflows/run-pytest.yml @@ -0,0 +1,21 @@ +name: Run Tests with Pytest + +on: + pull_request: + branches: [main] + +jobs: + create-environment: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: mamba-org/setup-micromamba@v2.0.3 + with: + generate-run-shell: true + environment-name: test-env + create-args: >- + python=3.10 + pytest + - shell: micromamba-shell {0} + - run: | + pytest --version From e131e4c30508de4a8d0539a6b440fefcae95b13b Mon Sep 17 00:00:00 2001 From: Caitlin Adams <25995927+caitlinadams@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:03:37 +1100 Subject: [PATCH 2/7] change syntax of shell + run --- .github/workflows/run-pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-pytest.yml b/.github/workflows/run-pytest.yml index 3029095..a505774 100644 --- a/.github/workflows/run-pytest.yml +++ b/.github/workflows/run-pytest.yml @@ -17,5 +17,5 @@ jobs: python=3.10 pytest - shell: micromamba-shell {0} - - run: | + run: | pytest --version From e9632e5b52387ad4420edd32db198f4b8c21d0b8 Mon Sep 17 00:00:00 2001 From: Caitlin Adams <25995927+caitlinadams@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:50:32 +1100 Subject: [PATCH 3/7] Update workflow to use environment file --- .github/workflows/run-pytest.yml | 21 ++++++++++++++------- test_environment.yml | 10 ++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 test_environment.yml diff --git a/.github/workflows/run-pytest.yml b/.github/workflows/run-pytest.yml index a505774..57af321 100644 --- a/.github/workflows/run-pytest.yml +++ b/.github/workflows/run-pytest.yml @@ -5,17 +5,24 @@ on: branches: [main] jobs: - create-environment: + run-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: mamba-org/setup-micromamba@v2.0.3 + - name: Set up micromamba environment + uses: mamba-org/setup-micromamba@v2.0.3 with: generate-run-shell: true - environment-name: test-env - create-args: >- - python=3.10 - pytest - - shell: micromamba-shell {0} + environment-file: test_environment.yml + condarc: | + channels: + - conda-forge + - name: Check packages + shell: micromamba-shell {0} run: | + python --version pytest --version + - name: Run tests + shell: micromamba-shell {0} + run: | + pytest diff --git a/test_environment.yml b/test_environment.yml new file mode 100644 index 0000000..b4c4ac0 --- /dev/null +++ b/test_environment.yml @@ -0,0 +1,10 @@ +name: test-env +dependencies: + - python=3.10.16=he725a3c_1_cpython + - gdal=3.10.0=py310h79127d3_13 + - shapely=2.0.6=py310had3dfd6_2 + - pip=24.3.1=pyh8b19718_2 + - pip: + - click==8.1.8 + - pytest==8.3.4 + - . \ No newline at end of file From c1bcbf273d633aba43e364f2eeb8e0e88c39acf6 Mon Sep 17 00:00:00 2001 From: Caitlin Adams <25995927+caitlinadams@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:53:41 +1100 Subject: [PATCH 4/7] Fix formatting for condarc --- .github/workflows/run-pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-pytest.yml b/.github/workflows/run-pytest.yml index 57af321..2c98c86 100644 --- a/.github/workflows/run-pytest.yml +++ b/.github/workflows/run-pytest.yml @@ -15,8 +15,8 @@ jobs: generate-run-shell: true environment-file: test_environment.yml condarc: | - channels: - - conda-forge + channels: + - conda-forge - name: Check packages shell: micromamba-shell {0} run: | From c67ecde491a2493557f2207c8173bf9eab8fa4a7 Mon Sep 17 00:00:00 2001 From: Caitlin Adams <25995927+caitlinadams@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:30:26 +1100 Subject: [PATCH 5/7] Update environment.yml file --- environment.yml | 293 +++++++++---------------------------------- test_environment.yml | 10 -- 2 files changed, 60 insertions(+), 243 deletions(-) delete mode 100644 test_environment.yml diff --git a/environment.yml b/environment.yml index be4ad55..747e812 100644 --- a/environment.yml +++ b/environment.yml @@ -1,265 +1,92 @@ name: sar-antarctica channels: - conda-forge - - defaults dependencies: - - affine=2.4.0 - - appnope=0.1.4 - - argon2-cffi=23.1.0 - - argon2-cffi-bindings=21.2.0 - - arrow=1.3.0 - - asttokens=2.4.1 - - attrs=23.2.0 - - aws-c-auth=0.7.22 - - aws-c-cal=0.6.15 - - aws-c-common=0.9.19 - - aws-c-compression=0.2.18 - - aws-c-event-stream=0.4.2 - - aws-c-http=0.8.2 - - aws-c-io=0.14.9 - - aws-c-mqtt=0.10.4 - - aws-c-s3=0.5.10 - - aws-c-sdkutils=0.1.16 - - aws-checksums=0.1.18 - - aws-crt-cpp=0.26.12 - - aws-sdk-cpp=1.11.329 - - azure-core-cpp=1.12.0 - - azure-identity-cpp=1.8.0 - - azure-storage-blobs-cpp=12.11.0 - - azure-storage-common-cpp=12.6.0 - - babel=2.14.0 - - bcrypt=4.1.3 + - _libgcc_mutex=0.1 + - _openmp_mutex=4.5 + - aom=3.9.1 - blosc=1.21.6 - - brotli=1.1.0 - - brotli-bin=1.1.0 - - brotli-python=1.1.0 - bzip2=1.0.8 - - c-ares=1.28.1 - - ca-certificates=2024.6.2 - - cairo=1.18.0 - - certifi=2024.6.2 - - cffi=1.16.0 - - cfitsio=4.4.0 - - charset-normalizer=3.3.2 - - click=8.1.7 - - click-plugins=1.1.1 - - cligj=0.7.2 - - colour=0.1.5 - - comm=0.2.2 - - contourpy=1.2.1 - - cryptography=42.0.8 - - cycler=0.12.1 - - debugpy=1.8.1 - - decorator=5.1.1 - - dill=0.3.8 - - exceptiongroup=1.2.0 - - executing=2.0.1 - - expat=2.6.2 - - fmt=10.2.1 - - font-ttf-dejavu-sans-mono=2.37 - - font-ttf-inconsolata=3.000 - - font-ttf-source-code-pro=2.038 - - font-ttf-ubuntu=0.83 - - fontconfig=2.14.2 - - fonts-conda-ecosystem=1 - - fonts-conda-forge=1 - - fonttools=4.53.0 - - freetype=2.12.1 + - c-ares=1.34.4 + - ca-certificates=2024.12.14 + - dav1d=1.2.1 - freexl=2.0.0 - - furl=2.1.3 - - gdal=3.9.0 - - geoalchemy2=0.13.3 - - geos=3.12.1 + - gdal=3.10.0 + - geos=3.13.0 - geotiff=1.7.3 - giflib=5.2.2 - - greenlet=3.0.3 - - hdf4=4.2.15 - - hdf5=1.14.3 - - icu=73.2 - - idna=3.7 - - importlib-metadata=7.2.1 - - importlib_metadata=7.2.1 - - infinity=1.5 - - intervals=0.9.2 - - ipykernel=6.29.4 - - ipython=8.25.0 - - jedi=0.19.1 - - json-c=0.17 - - jupyter=1.1.1 - - jupyter_client=8.6.2 - - jupyter_core=5.7.2 - - kealib=1.5.3 - - kiwisolver=1.4.5 - - krb5=1.21.2 - - lcms2=2.16 + - icu=75.1 + - json-c=0.18 + - keyutils=1.6.1 + - krb5=1.21.3 + - ld_impl_linux-64=2.43 - lerc=4.0.0 - - libabseil=20240116.2 - - libaec=1.1.3 - - libarchive=3.7.4 + - libarchive=3.7.7 + - libavif16=1.1.1 - libblas=3.9.0 - - libboost-headers=1.85.0 - - libbrotlicommon=1.1.0 - - libbrotlidec=1.1.0 - - libbrotlienc=1.1.0 - libcblas=3.9.0 - - libcrc32c=1.1.2 - - libcurl=8.8.0 - - libcxx=17.0.6 - - libdeflate=1.20 - - libedit=3.1.20191231 + - libcurl=8.11.1 + - libde265=1.0.15 + - libdeflate=1.23 + - libedit=3.1.20240808 - libev=4.33 - - libexpat=2.6.2 + - libexpat=2.6.4 - libffi=3.4.2 - - libgdal=3.9.0 - - libgfortran5=13.2.0 - - libglib=2.80.2 - - libgoogle-cloud=2.25.0 - - libgoogle-cloud-storage=2.25.0 - - libgrpc=1.62.2 + - libgcc=14.2.0 + - libgcc-ng=14.2.0 + - libgdal-core=3.10.0 + - libgfortran=14.2.0 + - libgfortran5=14.2.0 + - libgomp=14.2.0 + - libheif=1.19.5 - libiconv=1.17 - libjpeg-turbo=3.0.0 - libkml=1.3.0 - liblapack=3.9.0 - - libnetcdf=4.9.2 - - libnghttp2=1.58.0 - - libopenblas=0.3.27 - - libpng=1.6.43 - - libpq=16.3 - - libprotobuf=4.25.3 - - libre2-11=2023.09.01 + - liblzma=5.6.3 + - libnghttp2=1.64.0 + - libnsl=2.0.1 + - libopenblas=0.3.28 + - libpng=1.6.45 - librttopo=1.1.0 - - libsodium=1.0.18 - libspatialite=5.1.0 - - libsqlite=3.46.0 - - libssh2=1.11.0 - - libtiff=4.6.0 - - libwebp-base=1.4.0 - - libxcb=1.16 - - libxml2=2.12.7 - - libxslt=1.1.39 - - libzip=1.10.1 + - libsqlite=3.47.2 + - libssh2=1.11.1 + - libstdcxx=14.2.0 + - libstdcxx-ng=14.2.0 + - libtiff=4.7.0 + - libuuid=2.38.1 + - libwebp-base=1.5.0 + - libxcrypt=4.4.36 + - libxml2=2.13.5 - libzlib=1.3.1 - - llvm-openmp=18.1.8 - - lxml=5.2.2 - - lz4-c=1.9.4 + - lz4-c=1.10.0 - lzo=2.10 - - matplotlib-base=3.8.4 - - matplotlib-inline=0.1.7 - minizip=4.0.7 - - multiprocess=0.70.16 - - munkres=1.1.4 - ncurses=6.5 - - nest-asyncio=1.6.0 - - nspr=4.35 - - nss=3.101 - - numpy=1.26.4 - - openjpeg=2.5.2 - - openssl=3.3.1 - - orderedmultidict=1.0.1 - - packaging=24.1 - - parso=0.8.4 - - passlib=1.7.4 - - pathos=0.3.2 - - pcre2=10.43 - - pendulum=3.0.0 - - pexpect=4.9.0 - - phonenumbers=8.13.39 - - pickleshare=0.7.5 - - pillow=10.3.0 - - pip=24.0 - - platformdirs=4.2.2 - - poppler=24.04.0 - - poppler-data=0.4.12 - - postgresql=16.3 - - pox=0.3.4 - - ppft=1.7.6.8 - - progressbar2=4.4.2 - - proj=9.4.1 - - prompt-toolkit=3.0.47 - - psutil=6.0.0 - - psycopg2=2.9.9 - - pthread-stubs=0.4 - - ptyprocess=0.7.0 - - pure_eval=0.2.2 - - pycparser=2.22 - - pygments=2.18.0 - - pyparsing=3.1.2 - - pyrosar=0.23.0 - - pysocks=1.7.1 - - python=3.10.14 - - python-dateutil=2.9.0 - - python-utils=3.8.2 + - numpy=2.2.1 + - openssl=3.4.0 + - pcre2=10.44 + - pip=24.3.1 + - proj=9.5.1 + - python=3.10.16 - python_abi=3.10 - - pytz=2024.1 - - pyyaml=6.0.1 - - pyzmq=26.0.3 - - rasterio=1.3.10 - - re2=2023.09.01 + - rav1e=0.6.6 - readline=8.2 - - requests=2.32.3 - - setuptools=70.1.0 - - setuptools-scm=8.1.0 - - setuptools_scm=8.1.0 - - six=1.16.0 - - snappy=1.2.0 - - snuggs=1.4.7 - - spatialist=0.13.1 - - spdlog=1.13.0 - - sqlalchemy=1.4.49 - - sqlalchemy-utils=0.41.2 - - sqlalchemy-utils-arrow=0.41.2 - - sqlalchemy-utils-babel=0.41.2 - - sqlalchemy-utils-base=0.41.2 - - sqlalchemy-utils-color=0.41.2 - - sqlalchemy-utils-encrypted=0.41.2 - - sqlalchemy-utils-intervals=0.41.2 - - sqlalchemy-utils-password=0.41.2 - - sqlalchemy-utils-pendulum=0.41.2 - - sqlalchemy-utils-phone=0.41.2 - - sqlalchemy-utils-timezone=0.41.2 - - sqlalchemy-utils-url=0.41.2 - - sqlite=3.46.0 - - stack_data=0.6.2 - - tblib=3.0.0 - - tiledb=2.24.1 - - time-machine=2.14.1 + - setuptools=75.6.0 + - shapely=2.0.6 + - snappy=1.2.1 + - sqlite=3.47.2 + - svt-av1=2.3.0 - tk=8.6.13 - - tomli=2.0.1 - - tornado=6.4.1 - - traitlets=5.14.3 - - types-python-dateutil=2.9.0.20240316 - - typing-extensions=4.12.2 - - typing_extensions=4.12.2 - - tzcode=2024a - - tzdata=2024a - - unicodedata2=15.1.0 + - tzdata=2024b - uriparser=0.9.8 - - urllib3=2.2.2 - - wcwidth=0.2.13 - - wheel=0.43.0 + - wheel=0.45.1 + - x265=3.5 - xerces-c=3.2.5 - - xorg-libxau=1.0.11 - - xorg-libxdmcp=1.1.3 - - xz=5.2.6 - - yaml=0.2.5 - - zeromq=4.3.5 - - zipp=3.19.2 - zlib=1.3.1 - zstd=1.5.6 - pip: - - asf-search==7.1.3 - - boto3==1.34.132 - - botocore==1.34.132 - - ciso8601==2.3.1 - - dateparser==1.2.0 - - git+https://github.com/abradley60/dem-stitcher.git@dem_fill - - jmespath==1.0.1 - - pyproj==3.6.1 - - regex==2024.5.15 - - s3transfer==0.10.2 - - scipy==1.14.0 - - sentineleof==0.9.5 - - shapely==2.0.4 - - tenacity==8.2.2 - - tzlocal==5.2 - \ No newline at end of file + - click==8.1.8 + - pytest==8.3.4 + - . \ No newline at end of file diff --git a/test_environment.yml b/test_environment.yml deleted file mode 100644 index b4c4ac0..0000000 --- a/test_environment.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: test-env -dependencies: - - python=3.10.16=he725a3c_1_cpython - - gdal=3.10.0=py310h79127d3_13 - - shapely=2.0.6=py310had3dfd6_2 - - pip=24.3.1=pyh8b19718_2 - - pip: - - click==8.1.8 - - pytest==8.3.4 - - . \ No newline at end of file From 1bdc673b87ea3aa21c6c3b805a5e90aa7c656a9a Mon Sep 17 00:00:00 2001 From: Caitlin Adams <25995927+caitlinadams@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:31:00 +1100 Subject: [PATCH 6/7] Point GitHub action to updated environment.yml file --- .github/workflows/run-pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-pytest.yml b/.github/workflows/run-pytest.yml index 2c98c86..93d8f1a 100644 --- a/.github/workflows/run-pytest.yml +++ b/.github/workflows/run-pytest.yml @@ -13,7 +13,7 @@ jobs: uses: mamba-org/setup-micromamba@v2.0.3 with: generate-run-shell: true - environment-file: test_environment.yml + environment-file: environment.yml condarc: | channels: - conda-forge From 7fa85548aed63abbaa6074d47f8a54ffcfe3c939 Mon Sep 17 00:00:00 2001 From: Caitlin Adams <25995927+caitlinadams@users.noreply.github.com> Date: Thu, 9 Jan 2025 13:03:48 +1100 Subject: [PATCH 7/7] Remove channels argument -- to be handled by Actions --- environment.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/environment.yml b/environment.yml index 747e812..416aada 100644 --- a/environment.yml +++ b/environment.yml @@ -1,6 +1,4 @@ name: sar-antarctica -channels: - - conda-forge dependencies: - _libgcc_mutex=0.1 - _openmp_mutex=4.5