Skip to content

Commit

Permalink
Merge branch 'dev' into 14-pylint-error-checking-throws-exeption-due-…
Browse files Browse the repository at this point in the history
…to-deprecation-warning
  • Loading branch information
RobFirth committed Feb 15, 2024
2 parents 2f8cebb + 83c49bc commit dea6dca
Show file tree
Hide file tree
Showing 7 changed files with 1,204 additions and 1,028 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,41 @@ name: lint

on: push

env:
POETRY_VERSION: "1.3.1"
PYTHON_VERSION: "3.9"

jobs:
lint:
name: Run linting tools
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Print PYTHON_VERSION
run: echo "Using python==$PYTHON_VERSION"

- name: Setup Python
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: ${{env.PYTHON_VERSION}}


- name: Permacache Poetry
id: cache-poetry
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.poetry
key: poetry

- name: Install latest version of Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
curl -sSL https://install.python-poetry.org | python3 -
POETRY_VERSION=$POETRY_VERSION curl -sSL https://install.python-poetry.org | python3 -
poetry version
- name: Add Poetry to $PATH
run: |
Expand All @@ -41,7 +50,7 @@ jobs:

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{github.workspace}}/.venv
key: poetry-${{ hashFiles('**/poetry.lock') }}
Expand All @@ -55,8 +64,7 @@ jobs:
- name: Lint code
run: |
poetry run pylint --errors-only hooks
poetry run flake8 hooks
poetry run isort --check hooks
poetry run black --check --diff .
poetry run ruff check hooks
poetry run mypy hooks
17 changes: 11 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,37 @@ on:
tags:
- "v*"

env:
POETRY_VERSION: "1.3.1"
PYTHON_VERSION: "3.9"

jobs:
autorelease:
name: Create Release
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v2.3.4
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: ${{ env.PYTHON_VERSION }}

- name: Permacache Poetry
id: cache-poetry
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.poetry
key: poetry

- name: Install latest version of Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
curl -sSL https://install.python-poetry.org | python3 -
POETRY_VERSION=$POETRY_VERSION curl -sSL https://install.python-poetry.org | python3 -
poetry --version
- name: Add Poetry to $PATH
run: |
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,26 @@ on:
branches:
- master

env:
POETRY_VERSION: "1.3.1"
PYTHON_VERSION: "3.9"

jobs:
build-docs:
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.9

- uses: abatilo/actions-poetry@v2.1.3
python-version: ${ env.PYTHON_VERSION }

- uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: install
run: poetry install --extras docs

Expand Down
21 changes: 11 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/stfc/pre-commit-hooks
rev: v0.3.4
rev: v0.3.5
hooks:
- id: check-mypy-import-errors
- id: check-pylint-import-errors
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.5.0
hooks:
- id: check-toml
- id: check-yaml
Expand All @@ -26,15 +26,16 @@ repos:
files: ^.+$(?<!\.jpg)(?<!\.png)(?<!\.ipynb)(?<!\.bmp)(?<!\.tif)
args: [ '--maxkb=500' ]
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 22.3.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/isort
rev: 5.10.1
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.8
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ example configuration:
repos:
- repo: https://github.com/stfc/pre-commit-hooks
rev: v0.3.4
rev: v0.3.5
hooks:
- id: check-mypy-import-errors
- id: check-pylint-import-errors
Expand Down
Loading

0 comments on commit dea6dca

Please sign in to comment.