Skip to content

Commit

Permalink
Add test environment file; Add new GitHub action
Browse files Browse the repository at this point in the history
docs/environment_files/testing.yml
- Add this new environment file, based on the environment.yml file,
  but without pegged version numbers for most packages.

.github/workflows/build-test-environment.yml
- YAML config file to start a new GitHub action to build the mamba
  environment from "testing.yml"

.github/workflows/build-gcpy-environment.yml
- Updated names and comments
- Now read docs/environment_files/environment.yml

CHANGEKOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed Jan 25, 2024
1 parent 1e4a090 commit 1a67236
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 5 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build-gcpy-environment.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
#
# GitHub action to build the GCPy environment with micromamba
# GitHub action to build the GCPy production environment with micromamba
# See: https://github.com/marketplace/actions/setup-micromamba
#
name: build-gcpy-environment
Expand All @@ -21,12 +21,11 @@ jobs:
steps:
- name: Checkout the GCPy repository
uses: actions/checkout@v2
- name: Create the GCPy environment
- name: Create "gcpy_env" environment
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: 'latest'
environment-file: environment.yml
environment-name: gcpy-test-env
environment-file: docs/environment_files/environment.yml
init-shell: bash
cache-environment: true
generate-run-shell: true
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/build-test-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
#
# GitHub action to build the GCPy test environment with micromamba
# See: https://github.com/marketplace/actions/setup-micromamba
#
name: build-test-environment

on:
push:
branches: [ "main", "dev" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main", "dev" ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- name: Checkout the GCPy repository
uses: actions/checkout@v2
- name: Create "testing" environment
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: 'latest'
environment-file: docs/environment_files/testing.yml
init-shell: bash
cache-environment: true
generate-run-shell: true
post-cleanup: 'all'
- name: Test if "import gcpy" works
run: python -c "import gcpy"
shell: micromamba-shell {0}
- name: Test if we can create a plot
run: python -m gcpy.examples.plotting.create_test_plot
shell: micromamba-shell {0}
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased] - TBD
### Added
- Example script `create_test_plot.py`, which can be used to check that GCPy has been installed properly
- GitHub action `build-gcpy-environment` which tests installation of the mamba environment specified in in `docs/source/environment.yml`
- GitHub action `build-gcpy-environment` which tests installation of the mamba environment specified in in `docs/environment_files/environment.yml`
- YAML file`docs/environment_files/testing.yml` for building an environment without pegged package versions (for testing)
- GitHub action `build-test-environment` to test the environment specified in `testing.yml`

## [1.4.1] - 2023-12-08
### Fixed
Expand Down
49 changes: 49 additions & 0 deletions docs/environment_files/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
# ======================================================================
# GCPy testing environment file.
# Intended to be used by the GCST for testing purposes.
#
# GCPy users should build the environmet from "environment.yml",
# as this will specify package versions that are known to work.
# See: https://github.com/geoschem/gcpy/issues/284
# ======================================================================
name: testing
channels:
- conda-forge
- nodefaults
dependencies:
- awscli # Utilities for AWS cloud
- cartopy # Geospatial data processing
- cf_xarray # CF conventions for xarray
- dask # Parallel library; backend for xarray
- gridspec # Define Earth System Model grids
- ipython # Interactive Python (used by Jupyter)
- joblib # Parallelize python code
- jupyter # Jupyter Notebook
- matplotlib # Creates plots and visualizations
- netcdf4 # Python wrapper for netCDF
- netcdf-fortran # Python wrapper for netCDF-Fortran
- numpy # Optimized mathematical functions
- pandas # Tables/timeseries manipulation
- pip # Install packages from PyPi
- pylint # Python linter
- pyproj # Python map projections library
- python # Any python version prior to 3.10
- pypdf # PDF utilities (bookmarks, etc.)
- recommonmark # Dependency for Sphinx
- requests # HTTP library
- scipy # Scientific python package
- sparselt # Regridding earth system model data
- tabulate # Pretty-printing for column data
- tk # Tcl/tk library
- xarray # Read data from netCDF etc files
- esmf==8.1.1 # Earth system modeling framework
- esmpy==8.1.1 # Python wrapper for ESMF
- xesmf==0.5.1 # Universal regridder
- docutils # Convert text to other formats
- jinja2 # Dependency for Sphinx
- sphinx # Generate ReadTheDocs output
- sphinx-autoapi # Sphinx autodoc style documentation
- sphinx-autobuild # Build ReadTheDos live in browser
- sphinxcontrib-bibtex # ReadTheDocs bibliography style
- sphinx_rtd_theme # ReadTheDocs HTML theme files

0 comments on commit 1a67236

Please sign in to comment.