Skip to content

Commit

Permalink
Merge branch 'master' into read-wtime-stats
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekryjak committed Jun 9, 2024
2 parents f19dc73 + d02fe5a commit 3e071af
Show file tree
Hide file tree
Showing 43 changed files with 1,183 additions and 1,173 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: black

on:
pull_request:
paths:
- '**.py'

defaults:
run:
shell: bash

jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install black
run: |
python -m pip install --upgrade pip
pip install black
- name: Version
run: |
python --version
black --version
- name: Run black
run: |
black xbout
black docs
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Apply black formatting"
77 changes: 17 additions & 60 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,94 +20,51 @@ jobs:
if: always()
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.x]
pip-packages:
- "setuptools pip pytest pytest-cov coverage codecov boutdata xarray numpy>=1.16.0"
python-version: ["3.8", "3.9", "3.10", "3.11", "3.x"]
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install libhdf5-dev libnetcdf-dev
python -m pip install --upgrade pip
pip install --upgrade ${{ matrix.pip-packages }}
pip install -e .
- name: Install package
run: |
pip install -e .[calc,tests]
- name: Test with pytest
run: |
pip install pytest
pytest -v --long --cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
pytest -vv --long --cov
pytest-min-versions:
# test with oldest supported version of packages
pytest-oldest-xarray:

runs-on: ubuntu-latest
if: always()
strategy:
matrix:
python-version: [3.8]
pip-packages:
- "setuptools pip pytest pytest-cov coverage codecov boutdata==0.1.4 xarray==0.18.0 dask==2.10.0 numpy==1.18.0 natsort==5.5.0 matplotlib==3.1.1 animatplot==0.4.2 netcdf4==1.4.2 Pillow==6.1.0" # test with oldest supported version of packages. Note, using numpy==1.18.0 as a workaround because numpy==1.17.0 is not supported on Python-3.7, even though we should currently support numpy==1.17.0.
python-version: ["3.8"]
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install libhdf5-dev libnetcdf-dev
python -m pip install --upgrade pip
pip install --upgrade ${{ matrix.pip-packages }}
pip install -e .
- name: Test with pytest
pip install xarray~=0.18.0 pandas~=1.4.0
- name: Install package
run: |
pip install pytest
pytest -v --long --cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1


# Need to tidy up the things that flake8 finds before we activate this
#flake8:

# runs-on: ubuntu-latest
# if: always()

# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v1
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# - name: Lint with flake8
# run: |
# pip install flake8
# flake8


black:

runs-on: ubuntu-latest
if: always()

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Check formatting with black
pip install -e .[tests]
- name: Test with pytest
run: |
pip install black
black --check .
pytest -vv --long --cov
77 changes: 17 additions & 60 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,94 +20,51 @@ jobs:
if: always()
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.x]
pip-packages:
- "setuptools pip pytest pytest-cov coverage codecov boutdata xarray numpy>=1.16.0"
python-version: ["3.8", "3.9", "3.10", "3.x"]
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install libhdf5-dev libnetcdf-dev
python -m pip install --upgrade pip
pip install --upgrade ${{ matrix.pip-packages }}
pip install -e .
- name: Install package
run: |
pip install -e .[calc,tests]
- name: Test with pytest
run: |
pip install pytest
pytest -v --long --cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
pytest -vv --long --cov
pytest-min-versions:
# test with oldest supported version of packages
pytest-oldest-xarray:

runs-on: ubuntu-latest
if: always()
strategy:
matrix:
python-version: [3.8]
pip-packages:
- "setuptools pip pytest pytest-cov coverage codecov boutdata==0.1.4 xarray==0.18.0 dask==2.10.0 numpy==1.18.0 natsort==5.5.0 matplotlib==3.1.1 animatplot==0.4.2 netcdf4==1.4.2 Pillow==7.2.0" # test with oldest supported version of packages. Note, using numpy==1.18.0 as a workaround because numpy==1.17.0 is not supported on Python-3.7, even though we should currently support numpy==1.17.0.
python-version: ["3.8"]
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install libhdf5-dev libnetcdf-dev
python -m pip install --upgrade pip
pip install --upgrade ${{ matrix.pip-packages }}
pip install -e .
- name: Test with pytest
pip install xarray~=0.18.0 pandas~=1.4.0
- name: Install package
run: |
pip install pytest
pytest -v --long --cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1


# Need to tidy up the things that flake8 finds before we activate this
#flake8:

# runs-on: ubuntu-latest
# if: always()

# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v1
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# - name: Lint with flake8
# run: |
# pip install flake8
# flake8


black:

runs-on: ubuntu-latest
if: always()

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Check formatting with black
pip install -e .[tests]
- name: Test with pytest
run: |
pip install black
black --check .
pytest -vv --long --cov
123 changes: 12 additions & 111 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,125 +5,26 @@ name: Upload Python Package

on:
release:
types: [created]
types: [published]

jobs:
pytest:

runs-on: ubuntu-latest
if: always()
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.x]
pip-packages:
- "setuptools pip pytest boutdata xarray numpy>=1.16.0"
fail-fast: true

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install libhdf5-dev libnetcdf-dev
python -m pip install --upgrade pip
pip install --upgrade ${{ matrix.pip-packages }}
pip install -e .
- name: Test with pytest
run: |
pip install pytest
pytest -v --long
pytest-min-versions:

runs-on: ubuntu-latest
if: always()
strategy:
matrix:
python-version: [3.8]
pip-packages:
- "setuptools pip pytest boutdata==0.1.4 xarray==0.18.0 dask==2.10.0 numpy==1.18.0 natsort==5.5.0 matplotlib==3.1.1 animatplot==0.4.2 netcdf4==1.4.2 Pillow==7.2.0" # test with oldest supported version of packages. Note, using numpy==1.18.0 as a workaround because numpy==1.17.0 is not supported on Python-3.7, even though we should currently support numpy==1.17.0.
fail-fast: true

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install libhdf5-dev libnetcdf-dev
python -m pip install --upgrade pip
pip install --upgrade ${{ matrix.pip-packages }}
pip install -e .
- name: Test with pytest
run: |
pip install pytest
pytest -v --long
# Need to tidy up the things that flake8 finds before we activate this
#flake8:

# runs-on: ubuntu-latest
# if: always()

# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v1
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# - name: Lint with flake8
# run: |
# pip install flake8
# flake8


black:

runs-on: ubuntu-latest
if: always()

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Check formatting with black
run: |
pip install black
black --check .
deploy:

name: Upload release to PyPI
runs-on: ubuntu-latest
needs: [pytest, pytest-min-versions, black]

environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install libhdf5-dev libnetcdf-dev
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel twine
pip install -e .
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
git fetch --tags --unshallow
python setup.py sdist bdist_wheel
twine upload dist/*
python -m pip install --upgrade pip build
- name: Build package
run: python -m build --sdist --wheel
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading

0 comments on commit 3e071af

Please sign in to comment.