Skip to content

Commit

Permalink
chore: Update pyproject.toml format for lint section
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeacom committed Feb 7, 2024
1 parent dfba0d9 commit b6fca7e
Show file tree
Hide file tree
Showing 12 changed files with 1,003 additions and 739 deletions.
7 changes: 4 additions & 3 deletions .github/actions/deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ runs:
using: "composite"
steps:
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '${{ inputs.python-version }}'

- name: Cache Poetry
id: cache-poetry
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{github.workspace}}/.poetry
key: poetry-self-${{ hashFiles('.github/workflows/*.yml') }}
Expand Down Expand Up @@ -47,7 +47,7 @@ runs:

- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{github.workspace}}/.venv
key: poetry-deps-${{ hashFiles('**/poetry.lock') }}
Expand All @@ -57,5 +57,6 @@ runs:
if: steps.cache-deps.cache-hit != 'true'
shell: bash
run: |
poetry env use ${{ inputs.python-version }}
poetry config virtualenvs.in-project true
poetry install --no-interaction
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Dependencies
uses: './.github/actions/deps'
with:
python-version: '3.11'
python-version: '3.12'
- name: Install MDL
run: echo $'source \'https://rubygems.org\'\ngem \'mdl\', \'~> 0.12.0\'' > Gemfile
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Install Pre-commit dependencies
run: poetry poe install
run: poetry run poe install
- uses: pre-commit/[email protected]
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Dependencies
uses: './.github/actions/deps'
with:
python-version: '3.11'
python-version: '3.12'

- name: Run Security Check
run: poetry poe security
run: poetry run poe security

- name: Get Python Module Version
run: |
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Dependencies
uses: './.github/actions/deps'
with:
python-version: '3.11'
python-version: '3.12'

- name: Run Styling Enforcement
shell: bash
run: poetry poe check
run: poetry run poe check

- name: Run Style Linting Enforcement
shell: bash
run: poetry poe lint
run: poetry run poe lint

unit-tests:
name: Run Unit Tests
strategy:
matrix:
version: ['3.8', '3.9', '3.10', '3.11']
version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -51,25 +51,25 @@ jobs:

- name: Run Tests
shell: bash
run: poetry poe test
run: poetry run poe test

- name: Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4

security:
name: Run Security Checks
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Dependencies
uses: './.github/actions/deps'
with:
python-version: '3.11'
python-version: '3.12'

- name: Run Security Checks
shell: bash
run: poetry poe security
run: poetry run poe security
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ minimum_pre_commit_version: "3.0.0"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: f71fa2c1f9cf5cb705f73dffe4b21f7c61470ba9 # frozen: v4.4.0
rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -20,7 +20,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/PyCQA/bandit
rev: ca4faf2f82a7c68a088100f8ba2b8e56f9bdcfe3 # frozen: 1.7.5
rev: 4c5b3c81e4356001b472849b05af902064d68515 # frozen: 1.7.7
hooks:
- id: bandit
description: 'Bandit is a tool for finding common security issues in Python code'
Expand All @@ -29,19 +29,19 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 95f113d6340ab4348ecc5d912cf6e6b3465bfb86 # frozen: v0.0.277
rev: 1bd02b3569e3ac5cc66552b1336a96a8880d1bae # frozen: v0.2.1
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]

- repo: https://github.com/psf/black
rev: bf7a16254ec96b084a6caf3d435ec18f0f245cc7 # frozen: 23.3.0
rev: e026c93888f91a47a9c9f4e029f3eb07d96375e6 # frozen: 24.1.1
hooks:
- id: black
language_version: python3.11

- repo: https://github.com/pycqa/isort
rev: dbf82f2dd09ae41d9355bcd7ab69187a19e6bf2f # frozen: 5.12.0
rev: c235f5e450b4b84e58d114ed4c589cbf454175a3 # frozen: 5.13.2
hooks:
- id: isort
name: isort
Expand Down
Loading

0 comments on commit b6fca7e

Please sign in to comment.