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
16 changes: 8 additions & 8 deletions .github/actions/code-quality/action.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: 'Code Quality Checks'
description: 'Runs formatting, linting, and type checking'
name: "Code Quality Checks"
description: "Runs formatting, linting, and type checking"

inputs:
check-type:
description: 'Type of check to run (format, lint, or type-check)'
description: "Type of check to run (format, lint, or type-check)"
required: true
source-dir:
description: 'Source directory to check'
description: "Source directory to check"
required: false
default: 'src/'
default: "src/"

runs:
using: "composite"
steps:
- name: Run Ruff Formatting
if: inputs.check-type == 'format'
if: inputs.check-type == "format"
shell: bash
run: poetry run ruff format --config pyproject.toml ${{ inputs.source-dir }}

- name: Run Ruff Linting
if: inputs.check-type == 'lint'
if: inputs.check-type == "lint"
shell: bash
run: poetry run ruff check --config pyproject.toml ${{ inputs.source-dir }}

- name: Run Mypy Type Checking
if: inputs.check-type == 'type-check'
if: inputs.check-type == "type-check"
shell: bash
run: poetry run mypy --config-file pyproject.toml ${{ inputs.source-dir }}
14 changes: 7 additions & 7 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: 'Setup Environment'
description: 'Sets up Python, Poetry, and dependencies with caching'
name: "Setup Environment"
description: "Sets up Python, Poetry, and dependencies with caching"

inputs:
python-version:
description: 'Python version to use'
description: "Python version to use"
required: false
default: '3.12'
default: "3.12"
cache-key-suffix:
description: 'Additional suffix for cache key'
description: "Additional suffix for cache key"
required: false
default: ''
default: ""

runs:
using: "composite"
Expand All @@ -29,7 +29,7 @@ runs:
path: |
~/.cache/pypoetry
~/.poetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}${{ inputs.cache-key-suffix }}
key: ${{ runner.os }}-poetry-${{ hashFiles("**/poetry.lock") }}${{ inputs.cache-key-suffix }}

- name: Install dependencies
shell: bash
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: 'Shared Configuration'
name: "Shared Configuration"

on:
workflow_call:
outputs:
python-version:
description: "Python version to use"
value: '3.12'
value: "3.12"
poetry-cache-path:
description: "Poetry cache paths"
value: |
~/.cache/pypoetry
~/.poetry
source-dir:
description: "Source directory to check"
value: 'src/'
value: "src/"

jobs:
config:
runs-on: ubuntu-latest
outputs:
python-version: '3.12'
python-version: "3.12"
poetry-cache-path: |
~/.cache/pypoetry
~/.poetry
source-dir: 'src/'
source-dir: "src/"
steps:
- run: echo "Shared configuration loaded"
20 changes: 10 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: 'CI and Release'
name: "CI and Release"

on:
push:
branches:
- '*'
- "*"
pull_request:

jobs:
Expand All @@ -29,7 +29,7 @@ jobs:
python-version: ${{ needs.config.outputs.python-version }}
- uses: ./.github/actions/code-quality
with:
check-type: 'format'
check-type: "format"
source-dir: ${{ needs.config.outputs.source-dir }}

lint:
Expand All @@ -42,7 +42,7 @@ jobs:
python-version: ${{ needs.config.outputs.python-version }}
- uses: ./.github/actions/code-quality
with:
check-type: 'lint'
check-type: "lint"
source-dir: ${{ needs.config.outputs.source-dir }}

type-check:
Expand All @@ -55,7 +55,7 @@ jobs:
python-version: ${{ needs.config.outputs.python-version }}
- uses: ./.github/actions/code-quality
with:
check-type: 'type-check'
check-type: "type-check"
source-dir: ${{ needs.config.outputs.source-dir }}

test:
Expand All @@ -71,7 +71,7 @@ jobs:

release:
needs: [ config, setup, format, lint, type-check, test ]
if: github.ref == 'refs/heads/main'
if: github.ref == "refs/heads/main"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -97,15 +97,15 @@ jobs:
fi

- name: Find Previous Release
if: env.CREATE_RELEASE == 'true'
if: env.CREATE_RELEASE == "true"
run: |
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -n "$PREV_TAG" ]; then
echo "PREV_TAG=${PREV_TAG}" >> $GITHUB_ENV
fi

- name: Generate Compare URL
if: env.CREATE_RELEASE == 'true'
if: env.CREATE_RELEASE == "true"
run: |
if [ -n "${{ env.PREV_TAG }}" ]; then
echo "URL=${{ github.server_url }}/${{ github.repository }}/compare/${{ env.PREV_TAG }}...${{ env.VERSION }}" >> $GITHUB_ENV
Expand All @@ -114,7 +114,7 @@ jobs:
fi

- name: Generate Changelog
if: env.CREATE_RELEASE == 'true'
if: env.CREATE_RELEASE == "true"
run: |
chmod +x .github/generate_changelog.sh
source .github/generate_changelog.sh
Expand All @@ -128,7 +128,7 @@ jobs:
echo "EOF" >> $GITHUB_ENV

- name: Create Release
if: env.CREATE_RELEASE == 'true'
if: env.CREATE_RELEASE == "true"
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.18.0
rev: v9.20.0
hooks:
- id: commitlint
stages: [ commit-msg ]
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12.7
3.12.8
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pyenv install --list
Download & install a specific Python version:

```bash
pyenv install 3.12.7
pyenv install 3.12.8
```

List the global Python version set by your system:
Expand All @@ -122,13 +122,13 @@ pyenv local
Set the global Python version for your system:

```bash
pyenv global 3.12.7
pyenv global 3.12.8
```

Set the local Python version for your project:

```bash
pyenv local 3.12.7
pyenv local 3.12.8
```

Feel free to utilize Pyenv and modify the `.python-version` file to your preference.
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.