Skip to content

Commit

Permalink
merge and upgrade code
Browse files Browse the repository at this point in the history
  • Loading branch information
aulemahal committed Jun 25, 2024
2 parents 3e46108 + e4b7362 commit 9391f56
Show file tree
Hide file tree
Showing 66 changed files with 20,754 additions and 3,302 deletions.
2 changes: 0 additions & 2 deletions .coveragerc

This file was deleted.

11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
# - package-ecosystem: pip
# directory: "/"
# schedule:
# interval: daily
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates once a week
interval: "weekly"
96 changes: 96 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- "*"
schedule:
- cron: "0 0 * * *" # Daily “At 00:00”
workflow_dispatch: # allows you to trigger manually

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
include:
# Warning: Unless in quotations, numbers below are read as floats. 3.10 < 3.2
- python-version: "3.8"
esmf-version: 8.2
- python-version: "3.9"
esmf-version: 8.3
- python-version: "3.10"
esmf-version: 8.4
- python-version: "3.11"
esmf-version: 8.6
- python-version: "3.12"
esmf-version: 8.6
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- name: Checkout source
uses: actions/checkout@v4
- name: Create conda environment
uses: mamba-org/provision-with-micromamba@main
with:
cache-downloads: true
micromamba-version: "latest"
environment-file: ci/environment.yml
extra-specs: |
python=${{ matrix.python-version }}
esmpy=${{ matrix.esmf-version }}
- name: Install Xesmf (editable)
run: |
python -m pip install --no-deps -e .
- name: Conda list information
run: |
conda env list
conda list
- name: Run tests
run: |
python -m pytest --cov=./ --cov-report=xml --verbose
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.5.0
with:
file: ./coverage.xml
fail_ci_if_error: false

upstream-dev:
name: upstream-dev
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Create conda environment
uses: mamba-org/provision-with-micromamba@v16
with:
cache-downloads: true
micromamba-version: "latest"
environment-file: ci/environment-upstream-dev.yml
extra-specs: |
python=3.10
- name: Install Xesmf (editable)
run: |
python -m pip install -e .
- name: Conda list information
run: |
conda env list
conda list
- name: Run tests
run: |
python -m pytest --cov=./ --cov-report=xml --verbose
18 changes: 18 additions & 0 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: linting

on:
push:
branches:
- master
pull_request:
branches: "*"

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: pre-commit/action@v3.0.1
55 changes: 55 additions & 0 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish to PyPI

on:
pull_request:
push:
branches:
- master
release:
types:
- published

defaults:
run:
shell: bash

jobs:
packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Install build tools
run: |
python -m pip install --upgrade build
- name: Build binary wheel
run: python -m build --sdist --wheel . --outdir dist

- name: CheckFiles
run: |
ls dist
python -m pip install --upgrade check-manifest
check-manifest --verbose
- name: Test wheels
run: |
# We cannot run this step b/c esmpy is not available on PyPI
# cd dist && python -m pip install *.whl && cd ..
python -m pip install --upgrade build twine
python -m twine check dist/*
- name: Publish a Python distribution to PyPI
if: success() && github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
_version.py

# Sphinx documentation
docs/_build/
Expand All @@ -44,3 +45,4 @@ PET0.ESMF_LogFile
.cache
.coverage
coverage.xml
dask-worker-space/
70 changes: 70 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
default_language_version:
python: python3

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: double-quote-string-fixer

- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black

- repo: https://github.com/keewis/blackdoc
rev: v0.3.9
hooks:
- id: blackdoc

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8

- repo: https://github.com/asottile/seed-isort-config
rev: v2.2.0
hooks:
- id: seed-isort-config
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier

- repo: https://github.com/deathbeds/prenotebook
rev: f5bdb72a400f1a56fe88109936c83aa12cc349fa
hooks:
- id: prenotebook
args:
[
"--keep-output",
"--keep-metadata",
"--keep-execution-count",
"--keep-empty",
]

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.8.0
hooks:
- id: pyproject-fmt

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: monthly
skip: []
submodules: false
3 changes: 3 additions & 0 deletions .prettierrc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tabWidth = 2
semi = false
singleQuote = true
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit 9391f56

Please sign in to comment.