Skip to content

Commit 0799379

Browse files
authored
Merge pull request #272 from NCAR/develop
v1.4.0
2 parents 31c9233 + d48203b commit 0799379

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+537
-500
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'github-actions'
4+
directory: '/'
5+
schedule:
6+
# Check for updates once a week
7+
interval: 'weekly'

.github/workflows/ci.yml

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,58 @@
11
name: CI
22
on:
33
push:
4+
branches:
5+
- main
6+
- develop
47
pull_request:
58
workflow_dispatch:
6-
# schedule:
7-
# - cron: '0 0 * * *' # Daily “At 00:00”
9+
schedule:
10+
- cron: '0 0 * * *' # Daily “At 00:00”
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
815

916
jobs:
1017
test:
11-
# if: |
12-
# github.repository == 'NCAR/wrf-python'
13-
name: Python (${{ matrix.python-version }}, ${{ matrix.os }})
18+
name: Python ${{ matrix.python-version }}, ${{ matrix.os }}
1419
runs-on: ${{ matrix.os }}
1520
defaults:
1621
run:
1722
shell: bash -l {0}
18-
1923
strategy:
2024
fail-fast: false
2125
matrix:
22-
os: [ "ubuntu-latest", "macos-latest"]
23-
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
24-
26+
os: [ "ubuntu-latest", "macos-latest", "macos-14" ]
27+
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
2528
steps:
26-
- name: Cancel previous runs
27-
uses: styfle/[email protected]
28-
with:
29-
access_token: ${{ github.token }}
30-
- name: Checkout
31-
uses: actions/checkout@v2
29+
- name: checkout
30+
uses: actions/checkout@v4
31+
- name: environment setup
32+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
3233
with:
33-
token: ${{ github.token }}
34-
- name: Conda setup
35-
uses: conda-incubator/setup-miniconda@v2
36-
with:
37-
activate-environment: wrf_python_build
3834
python-version: ${{ matrix.python-version }}
39-
channels: conda-forge, ncar
40-
- name: Conda install (Darwin)
41-
if: matrix.os == 'macos-latest'
42-
run: |
43-
conda env update --file build_envs/Darwin.yml --prune
44-
- name: Conda install (Linux)
45-
if: matrix.os == 'ubuntu-latest'
35+
channels: conda-forge
36+
environment-file: build_envs/environment.yml
37+
- name: build WRF-Python
4638
run: |
47-
conda env update --file build_envs/Linux.yml --prune
48-
- name: Build WRF-Python
49-
run: |
50-
cd build_scripts
51-
./gnu_omp.sh
52-
cd ..
53-
- name: Run tests
39+
python -m pip install build
40+
python -m build .
41+
python -m pip install dist/wrf*.whl
42+
- name: run tests
5443
run: |
5544
cd test/ci_tests
5645
python utests.py
46+
- name: check import
47+
if: failure()
48+
run: |
49+
python -m pip show wrf-python
50+
python -m pip show --files wrf-python
51+
prefix="$(python -m pip show --files wrf-python | grep Location: | cut -f2 -d" ")"
52+
echo "Site-packages directory is ${prefix}"
53+
cd "${prefix}"
54+
installed_files="$(python -m pip show --files wrf-python | grep -v -E -e '^[-a-zA-Z]+:')"
55+
ls -l ${installed_files}
56+
file ${installed_files}
57+
python -vvv -dd -c "import wrf"
58+
ldd $(echo ${installed_files} | grep -F -v -e ".py" -e ".dist-info")

.github/workflows/pypi.yaml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@ jobs:
88
if: github.repository == 'NCAR/wrf-python'
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
- name: Set up Python
13-
uses: actions/setup-python@v3
13+
uses: actions/setup-python@v5
1414
with:
15-
python-version: '3.x'
15+
python-version: '3.10'
1616
- name: Install dependencies
1717
run: |
1818
python -m pip install --upgrade pip
19-
python -m pip install setuptools setuptools-scm wheel twine check-manifest
19+
python -m pip install build twine
2020
- name: Build tarball and wheels
2121
run: |
22-
python setup.py sdist bdist_wheel
23-
python -m pip wheel . -w dist --no-deps
22+
python -m build
2423
- name: Test the artifacts
2524
run: |
2625
python -m twine check dist/*
@@ -29,26 +28,25 @@ jobs:
2928
if: startsWith(github.ref, 'refs/tags')
3029
runs-on: ubuntu-latest
3130
steps:
32-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v4
3332
- name: Set up Python
34-
uses: actions/setup-python@v3
33+
uses: actions/setup-python@v5
3534
with:
36-
python-version: '3.x'
35+
python-version: '3.10'
3736
- name: Install dependencies
3837
run: |
3938
python -m pip install --upgrade pip
40-
python -m pip install setuptools setuptools-scm wheel twine check-manifest
39+
python -m pip install build twine
4140
- name: Build tarball and wheels
4241
run: |
43-
python setup.py sdist bdist_wheel
44-
python -m pip wheel . -w dist --no-deps
42+
python -m build
4543
- name: Test the artifacts
4644
run: |
4745
python -m twine check dist/*
4846
- name: Publish package to PyPI
49-
uses: pypa/gh-action-pypi-publish@v1.5.0
47+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
5048
with:
5149
user: __token__
5250
password: ${{ secrets.PYPI_WRF_PYTHON }}
5351
skip_existing: true
54-
verbose: true
52+
verbose: true

.readthedocs.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
build:
9+
os: "ubuntu-20.04"
10+
tools:
11+
python: "mambaforge-4.10"
12+
jobs:
13+
post_create_environment:
14+
- python -m pip install --no-cache-dir --no-deps .
15+
16+
# Build documentation in the docs/ directory with Sphinx
17+
sphinx:
18+
configuration: doc/source/conf.py
19+
20+
conda:
21+
environment: build_envs/environment.yml

CITATION.cff

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
authors:
4+
- given-names: "Visualization & Analysis Systems Technologies"
5+
title: "Geoscience Community Analysis Toolkit: WRF-Python"
6+
doi: 10.5065/D6W094P1
7+
url: "https://github.com/NCAR/wrf-python"

0 commit comments

Comments
 (0)