Skip to content

Commit

Permalink
Merge branch 'main' into git-cliff
Browse files Browse the repository at this point in the history
  • Loading branch information
slevang committed Apr 14, 2024
2 parents 52a15bf + a9ba9ff commit 467b8d0
Show file tree
Hide file tree
Showing 216 changed files with 4,698 additions and 7,790 deletions.
4 changes: 0 additions & 4 deletions .all-contributorsrc

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/black_formatting.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fetch-depth: 0
- uses: BobAnkh/[email protected]
with:
REPO_NAME: 'nicrie/xeofs'
REPO_NAME: 'xarray-contrib/xeofs'
ACCESS_TOKEN: ${{ secrets.CHANGELOG_TOKEN }}
PATH: 'CHANGELOG.md'
COMMIT_MESSAGE: 'docs(CHANGELOG): update release notes'
Expand Down
53 changes: 21 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,40 @@ on:
types: [opened, synchronize, reopened, edited]
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab

jobs:

Code_Quality_Check:

jobs:
test:
name: py${{ matrix.versions.python-version }} ${{ matrix.versions.resolution }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', 3.11]
versions:
- python-version: '3.10'
resolution: lowest-direct
- python-version: '3.11'
resolution: highest
- python-version: '3.12'
resolution: highest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4

- name: Setup Poetry
uses: abatilo/actions[email protected]
- name: Setup Python ${{ matrix.versions.python-version }}
uses: actions/setup-python@v5
with:
poetry-version: 1.5.1
python-version: ${{ matrix.versions.python-version }}

- name: Configure Poetry Settings
shell: bash
run: python -m poetry config virtualenvs.in-project true

- name: Verify Poetry Version
run: poetry --version

- name: Install Project Dependencies
run: python -m poetry install --with dev

- name: Lint Codebase with flake8
- name: Install dependencies
run: |
python -m poetry run flake8 . --exclude .venv --count --select=E9,F63,F7,F82 --show-source --statistics
python -m poetry run flake8 . --exclude .venv --count --exit-zero --max-complexity=10 --max-line-length=79 --statistics
pip install uv
uv pip install . -r pyproject.toml --system --extra dev --resolution ${{ matrix.versions.resolution }}
- name: Execute Tests with pytest and Coverage
- name: Execute Tests
run: |
python -m poetry run coverage run -m pytest
python -m poetry run coverage report -m
python -m poetry run coverage xml
coverage run -m pytest -n auto --doctest-glob="README.md"
coverage report -m
coverage xml
- name: Upload Coverage Report to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml

27 changes: 27 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Formatting

on:
pull_request:
branches: [main, develop]
types: [opened, synchronize, reopened, edited]
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab


jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
# Update output format to enable automatic inline annotations.
- name: Run Ruff
run: |
ruff check
ruff format --check
6 changes: 3 additions & 3 deletions .github/workflows/pull-request-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
# Aim: ensure that PR title matches the concentional commits spec
# More info: https://github.com/marketplace/actions/semantic-pull-request

name: "Pull Request Linting"
name: "PR Linting"

on:
pull_request_target:
types: [opened, edited, synchronize]

jobs:
PR_Validation:
name: Validate Pull Request Title
validate:
name: validate conventional commit in title
runs-on: ubuntu-latest
steps:
- name: Run Semantic Pull Request Linting
Expand Down
22 changes: 12 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
repos:

# - repo: ...

# Conventional Commits
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v1.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [] # optional: list of Conventional Commits types to allow
- repo: https://github.com/psf/black
rev: 23.7.0
# Lint and format with ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
# Strip output from Jupyter Notebooks
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.11
- id: nbstripout
Loading

0 comments on commit 467b8d0

Please sign in to comment.