forked from open-atmos/PyMPDATA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'open-atmos:main' into main
- Loading branch information
Showing
41 changed files
with
535 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: readme_rust | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
schedule: | ||
- cron: '0 13 * * 4' | ||
|
||
jobs: | ||
rust: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rust-src | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.9 | ||
- run: pip install -e . | ||
- run: pip install pytest-codeblocks pytest | ||
|
||
- run: | | ||
cat >Cargo.toml <<EOF | ||
[package] | ||
name = "PyMPDATA" | ||
version = "0.1.0" | ||
edition = "2021" | ||
[dependencies] | ||
pyo3 = { version = "0.22.2", features=["auto-initialize"]} | ||
EOF | ||
- run: mkdir src | ||
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('docs/markdown/pympdata_landing.md'); f=open('src/main.rs', 'w'); f.writelines(block.code for block in code if block.syntax=='Rust'); f.close()" | ||
- run: cat -n src/main.rs | ||
- run: cargo run | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v1 | ||
- uses: actions/setup-python@v5.2.0 | ||
with: | ||
python-version: "3.10" | ||
- run: | | ||
|
@@ -37,7 +37,7 @@ jobs: | |
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@master | ||
- uses: actions/setup-python@v5.2.0 | ||
with: | ||
python-version: 3.9 | ||
- name: Generate coverage report | ||
|
@@ -60,7 +60,7 @@ jobs: | |
submodules: recursive | ||
fetch-depth: 0 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v5.2.0 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
|
@@ -89,16 +89,24 @@ jobs: | |
with: | ||
submodules: recursive | ||
persist-credentials: false | ||
- uses: actions/setup-python@v2 | ||
- uses: actions/setup-python@v5.2.0 | ||
with: | ||
python-version: 3.9 | ||
- env: | ||
JUPYTER_PLATFORM_DIRS: 1 | ||
run: | | ||
pip3 install pdoc | ||
pip3 install pdoc nbformat | ||
pip install -e . -e ./examples | ||
export PDOC_ALLOW_EXEC=1 | ||
python -We -m pdoc -o html PyMPDATA examples/PyMPDATA_examples -t docs/templates | ||
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/[email protected] | ||
with: | ||
|
@@ -121,37 +129,21 @@ jobs: | |
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, macos-12, macos-14, windows-latest] | ||
python-version: ["3.9", "3.12", "system"] | ||
python-version: ["3.9", "3.12"] | ||
exclude: | ||
- platform: ubuntu-latest | ||
python-version: system | ||
- platform: macos-12 | ||
python-version: system | ||
- platform: windows-latest | ||
python-version: system | ||
- platform: macos-14 | ||
python-version: "3.9" | ||
- platform: macos-14 | ||
python-version: "3.12" | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- if: matrix.platform != 'macos-14' | ||
uses: actions/setup-python@v1 | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- if: matrix.platform == 'macos-14' | ||
run: | | ||
sudo ln -s `which python3` /usr/local/bin/python | ||
echo "PIP_INSTALL_ARGS=--break-system-packages" >> $GITHUB_ENV | ||
# Python 3.12 workaround | ||
python -m pip install --break-system-packages setuptools | ||
- run: | | ||
python -m pip install $PIP_INSTALL_ARGS -e . # to check if usable without test/example dependencies | ||
python -We -c "import PyMPDATA" | ||
|
@@ -178,17 +170,6 @@ jobs: | |
matrix: | ||
platform: [ubuntu-latest, macos-12, macos-14, windows-latest] | ||
python-version: ["3.9", "3.12"] | ||
exclude: | ||
- platform: ubuntu-latest | ||
python-version: system | ||
- platform: macos-12 | ||
python-version: system | ||
- platform: windows-latest | ||
python-version: system | ||
- platform: macos-14 | ||
python-version: "3.9" | ||
- platform: macos-14 | ||
python-version: "3.12" | ||
fail-fast: false | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
|
@@ -197,19 +178,10 @@ jobs: | |
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- if: matrix.platform != 'macos-14' | ||
uses: actions/setup-python@v1 | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- if: matrix.platform == 'macos-14' | ||
run: | | ||
sudo ln -s `which python3` /usr/local/bin/python | ||
echo "PIP_INSTALL_ARGS=--break-system-packages" >> $GITHUB_ENV | ||
# Python 3.12 workaround | ||
python -m pip install --break-system-packages setuptools | ||
- run: python -m pip install $PIP_INSTALL_ARGS -e .[tests] ./examples | ||
- run: python -m pip install $PIP_INSTALL_ARGS -r tests/devops_tests/requirements.txt | ||
- if: matrix.platform == 'ubuntu-latest' | ||
|
@@ -279,7 +251,7 @@ jobs: | |
with: | ||
submodules: recursive | ||
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480 | ||
- uses: actions/setup-python@v2 | ||
- uses: actions/setup-python@v5.2.0 | ||
with: | ||
python-version: "3.10" | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
global-exclude *.ipynb | ||
include docs/*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.