Skip to content

Commit

Permalink
CI updates and add Python 3.11 remove Python 3.7 and 3.8 (#213)
Browse files Browse the repository at this point in the history
* add Python 3.11

* update CI and add back in nightly testing

* add dependabot

* add macOS M1 build to CI and remove numpy version exclude

* fix typo

* fix conda for M1

* clean up CI conda envs

* update environment files and references in contributing guidelines

* add Windows to CI

* try the another Windows build script

* try the another Windows build script

* try using old windows env

* fix typo

* fix typo

* remove windows from CI
  • Loading branch information
kafitzgerald authored Feb 2, 2024
1 parent 79dda83 commit 1f3d23d
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 45 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
# Check for updates once a week
interval: 'weekly'
35 changes: 17 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ on:
push:
pull_request:
workflow_dispatch:
# schedule:
# - cron: '0 0 * * *' # Daily “At 00:00”
schedule:
- cron: '0 0 * * *' # Daily “At 00:00”

jobs:
test:
# if: |
# github.repository == 'NCAR/wrf-python'
name: Python (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
Expand All @@ -19,32 +17,33 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "macos-latest"]
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
os: [ "ubuntu-latest", "macos-latest", "macos-14" ]
python-version: [ "3.9", "3.10", "3.11" ]

steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
token: ${{ github.token }}
- name: Conda setup
uses: conda-incubator/setup-miniconda@v2
if: matrix.os != 'macos-14'
with:
activate-environment: wrf_python_build
python-version: ${{ matrix.python-version }}
channels: conda-forge, ncar
- name: Conda install (Darwin)
if: matrix.os == 'macos-latest'
run: |
conda env update --file build_envs/Darwin.yml --prune
- name: Conda install (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
conda env update --file build_envs/Linux.yml --prune
channels: conda-forge
environment-file: build_envs/environment.yml
- name: Conda setup (macOS M1)
uses: conda-incubator/setup-miniconda@v2
if: matrix.os == 'macos-14'
with:
installer-url: https://github.com/conda-forge/miniforge/releases/download/23.11.0-0/Mambaforge-23.11.0-0-MacOSX-arm64.sh
python-version: ${{ matrix.python-version }}
channels: conda-forge
environment-file: build_envs/environment.yml
- name: Build WRF-Python
run: |
cd build_scripts
Expand Down
21 changes: 21 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: "ubuntu-20.04"
tools:
python: "mambaforge-4.10"
jobs:
post_create_environment:
- python -m pip install --no-cache-dir .

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/source/conf.py

conda:
environment: build_envs/environment.yml
20 changes: 20 additions & 0 deletions build_envs/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Create full conda environment for development, including some useful tools
name: wrf_python_build
channels:
- conda-forge
dependencies:
- python>=3.9, <3.12
- compilers
- basemap
- cartopy
- jupyter
- matplotlib
- netcdf4
- numpy
- pycodestyle
- setuptools
- sphinx
- sphinx_rtd_theme
- wrapt
- xarray

3 changes: 3 additions & 0 deletions build_envs/platform-specific/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
These platform specific environment files are included here for reference only and not actively tested or maintained.

We have moved to a single environment file (../environment.yml) for all platforms.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: wrf_python_build
channels:
- conda-forge
dependencies:
- python=3
- python<3.12
- basemap
- cartopy
- gcc_linux-64
- gfortran_linux-64
- jupyter
- matplotlib
- netcdf4
- numpy!=1.24.3
- numpy
- pycodestyle
- setuptools
- sphinx
Expand Down
21 changes: 21 additions & 0 deletions build_envs/platform-specific/macos_arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Create full conda environment for development, including some useful tools
name: wrf_python_build
channels:
- conda-forge
dependencies:
- python<3.12
- basemap
- cartopy
- clang_osx-arm64
- gfortran_osx-arm64
- jupyter
- matplotlib
- netcdf4
- numpy
- pycodestyle
- setuptools
- sphinx
- sphinx_rtd_theme
- wrapt
- xarray

Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: wrf_python_build
channels:
- conda-forge
dependencies:
- python=3
- python<3.12
- basemap
- cartopy
- clang_osx-64
- gfortran_osx-64
- jupyter
- matplotlib
- netcdf4
- numpy!=1.24.3
- numpy
- pycodestyle
- setuptools
- sphinx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ channels:
- conda-forge
- msys2
dependencies:
- python=3
- python<3.12
- basemap
- cartopy
- jupyter
- m2w64-toolchain
- matplotlib
- netcdf4
- numpy!=1.24.3
- numpy
- pycodestyle
- setuptools
- sphinx
Expand Down
21 changes: 3 additions & 18 deletions doc/source/contrib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -294,28 +294,13 @@ contributing is:
git remote add ncar https://github.com/ncar/wrf-python.git
- To create the development environment, you'll need to run the appropriate
command below for your operating system.

OSX:

.. code::
conda env create -f build_envs/Darwin.yml
Linux:

.. code::
conda env create -f build_envs/Linux.yml
Win64:
- To create the development environment, you'll need to run the command below:

.. code::
conda env create -f build_envs/Win64.yml
conda env create -f build_envs/environment.yml
Note: For Win64, you will also need VS2015 installed on your system.
Note: For Windows, you will also need Visual Studio installed on your system.

- Activate your conda environment.

Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Fortran",
"Programming Language :: Python :: 3.7",
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Topic :: Software Development",
"Operating System :: POSIX",
Expand Down

0 comments on commit 1f3d23d

Please sign in to comment.