-
Notifications
You must be signed in to change notification settings - Fork 1
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
13 changed files
with
3,928 additions
and
227 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "master" | ||
- "dev" | ||
paths: | ||
- "**.py" | ||
- ".github/workflows/*test*.yml" | ||
- "pyproject.toml" | ||
- "poetry.lock" | ||
- "requirements/requirements*.txt" | ||
pull_request: | ||
paths: | ||
- "**.py" | ||
- ".github/workflows/*test*.yml" | ||
- "pyproject.toml" | ||
- "poetry.lock" | ||
- "requirements/requirements*.txt" | ||
|
||
jobs: | ||
test: | ||
name: "test Python ${{ matrix.python }} on ${{ matrix.os }}" | ||
runs-on: "${{ matrix.os }}" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
python: ["3.9", "3.10", "3.11", "3.12"] | ||
include: | ||
- os: "macos-latest" | ||
python: "3.10" | ||
defaults: | ||
run: | ||
shell: "bash -eo pipefail {0}" | ||
|
||
steps: | ||
- uses: "actions/checkout@v2" | ||
- uses: "actions/setup-python@v2" | ||
with: | ||
python-version: "${{ matrix.python }}" | ||
- uses: "actions/cache@v2" | ||
id: "cache" | ||
with: | ||
path: "${{ env.pythonLocation }}" | ||
key: "test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements/*') }}" | ||
- run: "python --version" | ||
- run: "python -mpip install -U pip" | ||
- run: "python -mpip --version" | ||
- run: "python -mpip install -r requirements/requirements-dev.txt" | ||
- run: "python -mpip install ./" | ||
- name: "Run tests" | ||
run: "pytest tests/" | ||
env: | ||
PYTHONPATH: ${{ github.workspace }}/tests |
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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
ci: | ||
autofix_prs: false | ||
default_language_version: | ||
python: "python3" | ||
fail_fast: false | ||
|
||
repos: | ||
- repo: "https://github.com/pre-commit/pre-commit-hooks" | ||
rev: "v4.5.0" | ||
hooks: | ||
- id: "check-added-large-files" | ||
args: ["--maxkb=40000"] | ||
- id: "check-ast" | ||
- id: "check-byte-order-marker" | ||
- id: "check-docstring-first" | ||
- id: "check-executables-have-shebangs" | ||
- id: "check-json" | ||
- id: "check-symlinks" | ||
- id: "check-merge-conflict" | ||
- id: "check-vcs-permalinks" | ||
- id: "check-xml" | ||
- id: "check-yaml" | ||
- id: "debug-statements" | ||
- id: "end-of-file-fixer" | ||
exclude: ".+\\.ipynb" | ||
- id: "name-tests-test" | ||
- id: "trailing-whitespace" | ||
|
||
- repo: "https://github.com/pre-commit/pygrep-hooks" | ||
rev: "v1.10.0" | ||
hooks: | ||
- id: "python-check-blanket-noqa" | ||
- id: "python-check-blanket-type-ignore" | ||
- id: "python-use-type-annotations" | ||
|
||
- repo: "https://github.com/asottile/reorder_python_imports" | ||
rev: "v3.12.0" | ||
hooks: | ||
- id: "reorder-python-imports" | ||
args: | ||
- "--py38-plus" | ||
|
||
- repo: "https://github.com/psf/black" | ||
rev: "23.11.0" | ||
hooks: | ||
- id: "black" | ||
|
||
- repo: "https://github.com/astral-sh/ruff-pre-commit" | ||
# Ruff version. | ||
rev: "v0.1.7" | ||
hooks: | ||
- id: "ruff" | ||
|
||
- repo: "https://github.com/kynan/nbstripout" | ||
rev: "0.6.1" | ||
hooks: | ||
- id: "nbstripout" | ||
|
||
- repo: "https://github.com/python-poetry/poetry" | ||
rev: "1.7.0" | ||
hooks: | ||
- id: "poetry-check" | ||
name: "poetry check" | ||
- id: "poetry-check" | ||
name: "poetry check --lock" | ||
args: ["--lock"] | ||
- id: "poetry-lock" | ||
name: "poetry lock --no-update" | ||
args: ["--no-update"] | ||
- id: "poetry-export" | ||
name: "poetry export main" | ||
args: | ||
[ | ||
"--only", | ||
"main", | ||
"-f", | ||
"requirements.txt", | ||
"-o", | ||
"requirements/requirements.txt", | ||
] | ||
- id: "poetry-export" | ||
name: "poetry export dev" | ||
args: | ||
[ | ||
"--with", | ||
"dev", | ||
"-f", | ||
"requirements.txt", | ||
"-o", | ||
"requirements/requirements-dev.txt", | ||
] |
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
Oops, something went wrong.