Skip to content

Commit

Permalink
Merge branch 'open-atmos:main' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
Caastlefox authored Jan 28, 2025
2 parents 82fa5bc + ddecbf2 commit e0495c9
Show file tree
Hide file tree
Showing 23 changed files with 1,592 additions and 374 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/pdoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: pdoc

defaults:
run:
shell: bash

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 13 * * 4'

jobs:
pdoc:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
persist-credentials: false
- uses: actions/setup-python@v5.2.0
with:
python-version: 3.9
- env:
JUPYTER_PLATFORM_DIRS: 1
run: |
pip install pdoc nbformat gitpython
pip install -e . -e ./examples
python -We docs/generate_html.py . .
python - <<EOF
import glob, nbformat
for notebook_path in glob.glob('examples/PyMPDATA_examples/*/*.ipynb'):
with open(notebook_path, encoding="utf8") as fin:
with open(notebook_path + ".badges.md", 'w') as fout:
fout.write(nbformat.read(fin, nbformat.NO_CONVERT).cells[0].source)
EOF
PDOC_ALLOW_EXEC=1 python -We -m pdoc -o html PyMPDATA examples/PyMPDATA_examples -t docs/templates --math
- if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }}
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
branch: pdoc
folder: html
clean: true
19 changes: 19 additions & 0 deletions .github/workflows/projects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Add new issues and pull requests to project board

on:
issues:
types:
- opened
pull_request_target:
types:
- opened

jobs:
add-to-project:
name: Add to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/open-atmos/projects/6
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
57 changes: 57 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: pypi

defaults:
run:
shell: bash

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 13 * * 4'
release:
types: [published]

jobs:
dist:
strategy:
matrix:
package-dir: [".", "examples"]
fail-fast: false
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480
- uses: actions/setup-python@v5.2.0
with:
python-version: "3.10"

- run: pip install twine build

- run: |
unset CI
cd ${{ matrix.package-dir }}
python -m build 2>&1 | tee build.log
exit `fgrep -v "warning: no previously-included files matching" buid.log | fgrep -i warning | wc -l`
twine check --strict dist/*
exit `tar tzf dist/*.tar.gz | fgrep ".ipynb" | wc -l`
cd ..
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1.12
with:
attestations: false
repository_url: https://test.pypi.org/legacy/
packages-dir: ${{ matrix.package-dir }}/dist

- if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1.12
with:
attestations: false
packages-dir: ${{ matrix.package-dir }}/dist
23 changes: 17 additions & 6 deletions .github/workflows/readme_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,30 @@ on:

jobs:
matlab:
strategy:
matrix:
# https://www.mathworks.com/support/requirements/python-compatibility.html
include:
- matlab-version: "R2021b"
python-version: "3.9"
- matlab-version: "R2024b"
python-version: "3.12"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5.3.0
with:
python-version: 3.8
python-version: ${{ matrix.python-version }}
- run: pip install -e .
- run: pip install pytest-codeblocks pytest
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('docs/markdown/pympdata_landing.md'); f=open('readme.m', 'w'); f.writelines(block.code for block in code if block.syntax=='Matlab'); f.close()"
- run: cat readme.m
- uses: matlab-actions/setup-matlab@v0
- uses: matlab-actions/setup-matlab@v2.3.0
with:
release: R2021a
- uses: matlab-actions/run-command@v0
release: ${{ matrix.matlab-version }}
- uses: matlab-actions/run-command@v2.1.1
with:
command: pe=pyenv; assert(pe.Version == "${{ matrix.python-version }}");
- uses: matlab-actions/run-command@v2.1.1
with:
command: readme
Loading

0 comments on commit e0495c9

Please sign in to comment.