Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "Bot"
38 changes: 0 additions & 38 deletions .github/workflows/conda-tests.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Documentation

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

jobs:
build-docs:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Mamba
uses: mamba-org/provision-with-micromamba@v15
with:
environment-file: false

- name: Build environment
shell: bash -l {0}
run: |
micromamba create --name TEST python=3 --file requirements.txt --file requirements-dev.txt --channel conda-forge
micromamba activate TEST
python -m pip install -e . --no-deps --force-reinstall

- name: Build documentation
shell: bash -l {0}
run: |
set -e
micromamba activate TEST
pushd docs
make clean html linkcheck
popd

- name: Deploy
if: success() && github.event_name == 'release'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
33 changes: 0 additions & 33 deletions .github/workflows/pip-tests.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/pre-commit.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish to PyPI

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

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

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

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

- name: Install build tools
run: |
python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine

shell: bash

- name: Build binary wheel
run: python -m build --sdist --wheel . --outdir dist

- name: CheckFiles
run: |
ls dist
shell: bash

- name: Test wheels
run: |
cd dist && python -m pip install *.whl
python -m twine check *
shell: bash

- 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_PASSWORD }}
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Tests

on:
pull_request:
push:
branches: [main]

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@v15
with:
environment-file: false

- name: Python ${{ matrix.python-version }}
shell: bash -l {0}
run: >
micromamba create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt --channel conda-forge
&& micromamba activate TEST
&& python -m pip install -e . --no-deps --force-reinstall


- name: Tests
shell: bash -l {0}
run: >
micromamba activate TEST
&& python -m pytest -n 2 -rxs --cov=oceans tests

- name: Doctests
shell: bash -l {0}
run: >
micromamba activate TEST
&& python -m pytest -vv oceans --doctest-modules
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*.egg-info
.cache
.coverage
.ipynb_checkpoints/
build/
dist/
.ipynb_checkpoints/
oceans/_version.py
43 changes: 26 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.4.0
hooks:
- id: check-ast
- id: end-of-file-fixer
Expand All @@ -14,34 +14,43 @@ repos:
- id: trailing-whitespace
- id: debug-statements

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0

# - repo: https://github.com/econchick/interrogate
# rev: 1.5.0
# hooks:
# - id: interrogate
# exclude: ^(docs|setup.py|tests)
# args: [--config=pyproject.toml]

- repo: https://github.com/keewis/blackdoc
rev: v0.3.8
hooks:
- id: flake8
exclude: docs/source/conf.py
args: [--max-line-length=105, "--ignore=E203,W503"]
- id: blackdoc

- repo: https://github.com/pycqa/isort
rev: 5.7.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.253
hooks:
- id: isort
additional_dependencies: [toml]
args: ["--profile", "black", "--filter-files"]
- id: ruff

- repo: https://github.com/psf/black
rev: 20.8b1
rev: 23.1.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/asottile/pyupgrade
rev: v2.10.0
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: pyupgrade
- id: codespell
args:
- --py36-plus
- --ignore-words-list=pres

- repo: https://github.com/asottile/add-trailing-comma
rev: v2.1.0
rev: v2.4.0
hooks:
- id: add-trailing-comma

- repo: https://github.com/tox-dev/pyproject-fmt
rev: "0.9.2"
hooks:
- id: pyproject-fmt
Loading