-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
213 changed files
with
17,883 additions
and
8,032 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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,103 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v*.*.* | ||
pull_request: | ||
workflow_dispatch: | ||
schedule: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "v*" | ||
pull_request: | ||
workflow_dispatch: | ||
schedule: | ||
# run every week (for --pre release tests) | ||
- cron: 0 0 * * 0 | ||
- cron: "0 0 * * 0" | ||
|
||
jobs: | ||
check-manifest: | ||
check-manifest: | ||
# check-manifest is a tool that checks that all files in version control are | ||
# included in the sdist (unless explicitly excluded) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: pipx run check-manifest | ||
|
||
test: | ||
name: ${{ matrix.platform }} (${{ matrix.python-version }}) | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: 🐍 Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache-dependency-path: pyproject.toml | ||
cache: pip | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install -U pip | ||
# if running a cron job, we add the --pre flag to test against pre-releases | ||
python -m pip install .[test] ${{ github.event_name == 'schedule' && '--pre' || '' }} | ||
- name: 🧪 Run Tests | ||
run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing -m "not gpu" | ||
|
||
# If something goes wrong with --pre tests, we can open an issue in the repo | ||
- name: 📝 Report --pre Failures | ||
if: failure() && github.event_name == 'schedule' | ||
uses: JasonEtco/create-an-issue@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PLATFORM: ${{ matrix.platform }} | ||
PYTHON: ${{ matrix.python-version }} | ||
RUN_ID: ${{ github.run_id }} | ||
TITLE: '[test-bot] pip install --pre is failing' | ||
with: | ||
filename: .github/TEST_FAIL_TEMPLATE.md | ||
update_existing: true | ||
|
||
- name: Coverage | ||
uses: codecov/codecov-action@v4 | ||
|
||
deploy: | ||
name: Deploy | ||
needs: test | ||
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule' | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing on PyPi | ||
# see https://docs.pypi.org/trusted-publishers/ | ||
id-token: write | ||
# This permission allows writing releases | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 🐍 Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: 👷 Build | ||
run: | | ||
python -m pip install build | ||
python -m build | ||
- name: 🚢 Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
- uses: softprops/action-gh-release@v1 | ||
with: | ||
generate_release_notes: true | ||
files: ./dist/* | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: pipx run check-manifest | ||
|
||
test: | ||
name: ${{ matrix.platform }} (${{ matrix.python-version }}) | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories | ||
platform: [ubuntu-latest, macos-13, windows-latest] | ||
|
||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: 🐍 Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache-dependency-path: "pyproject.toml" | ||
cache: "pip" | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install -U pip | ||
# if running a cron job, we add the --pre flag to test against pre-releases | ||
python -m pip install .[dev] ${{ github.event_name == 'schedule' && '--pre' || '' }} | ||
- name: 🧪 Run Tests | ||
run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing -m "not gpu" | ||
|
||
# If something goes wrong with --pre tests, we can open an issue in the repo | ||
- name: 📝 Report --pre Failures | ||
if: failure() && github.event_name == 'schedule' | ||
uses: JasonEtco/create-an-issue@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PLATFORM: ${{ matrix.platform }} | ||
PYTHON: ${{ matrix.python-version }} | ||
RUN_ID: ${{ github.run_id }} | ||
TITLE: "[test-bot] pip install --pre is failing" | ||
with: | ||
filename: .github/TEST_FAIL_TEMPLATE.md | ||
update_existing: true | ||
|
||
- name: Coverage | ||
uses: codecov/codecov-action@v3 | ||
|
||
deploy: | ||
name: Deploy | ||
needs: test | ||
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 🐍 Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: 👷 Build | ||
run: | | ||
python -m pip install build | ||
python -m build | ||
- name: 🚢 Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.TWINE_API_KEY }} | ||
|
||
- uses: softprops/action-gh-release@v1 | ||
with: | ||
generate_release_notes: true |
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 |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
.pytest* | ||
*.DS_Store* | ||
**/.ipynb_checkpoints | ||
.coverage | ||
coverage.xml | ||
lightning_logs |
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,62 +1,56 @@ | ||
--- | ||
# enable pre-commit.ci at https://pre-commit.ci/ | ||
# it adds: | ||
# 1. auto fixing pull requests | ||
# 2. auto updating the pre-commit configuration | ||
ci: | ||
autoupdate_schedule: monthly | ||
autofix_commit_msg: 'style(pre-commit.ci): auto fixes [...]' | ||
autoupdate_commit_msg: 'ci(pre-commit.ci): autoupdate' | ||
autoupdate_schedule: monthly | ||
autofix_commit_msg: "style(pre-commit.ci): auto fixes [...]" | ||
autoupdate_commit_msg: "ci(pre-commit.ci): autoupdate" | ||
|
||
repos: | ||
- repo: https://github.com/abravalheri/validate-pyproject | ||
rev: v0.15 | ||
hooks: | ||
- id: validate-pyproject | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.9 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --target-version, py38] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.12.1 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.8.0 | ||
hooks: | ||
- id: mypy | ||
files: ^src/ | ||
additional_dependencies: | ||
- numpy | ||
- types-PyYAML | ||
- repo: https://github.com/abravalheri/validate-pyproject | ||
rev: v0.14 | ||
hooks: | ||
- id: validate-pyproject | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.0.292 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --target-version, py38] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.9.1 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.5.1 | ||
hooks: | ||
- id: mypy | ||
files: "^src/" | ||
additional_dependencies: | ||
- numpy | ||
- types-PyYAML | ||
- types-setuptools | ||
|
||
# check docstrings | ||
- repo: https://github.com/numpy/numpydoc | ||
rev: v1.6.0 | ||
hooks: | ||
- id: numpydoc-validation | ||
- repo: https://github.com/numpy/numpydoc | ||
rev: v1.6.0 | ||
hooks: | ||
- id: numpydoc-validation | ||
|
||
# jupyter linting and formatting | ||
- repo: https://github.com/nbQA-dev/nbQA | ||
rev: 1.7.1 | ||
hooks: | ||
- id: nbqa-ruff | ||
args: [--fix] | ||
- id: nbqa-black | ||
#- id: nbqa-mypy | ||
- repo: https://github.com/nbQA-dev/nbQA | ||
rev: 1.7.0 | ||
hooks: | ||
- id: nbqa-ruff | ||
args: [--fix] | ||
- id: nbqa-black | ||
#- id: nbqa-mypy | ||
|
||
# strip out jupyter notebooks | ||
- repo: https://github.com/kynan/nbstripout | ||
rev: 0.6.1 | ||
hooks: | ||
- id: nbstripout | ||
|
||
# yaml formatter | ||
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt | ||
rev: 0.2.3 | ||
hooks: | ||
- id: yamlfmt | ||
- repo: https://github.com/kynan/nbstripout | ||
rev: 0.6.1 | ||
hooks: | ||
- id: nbstripout |
Oops, something went wrong.