Skip to content
Draft
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
52 changes: 17 additions & 35 deletions python-lint/action.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,44 @@
name: "Linting and Type Checking"
description: "Run linting and type-checking tools like Black, Flake8, isort, and mypy using Poetry"
description: "Run linting(ruff) and type-checking(mypy) tools via uv"

inputs:
python-version:
description: "The version of Python to use"
required: true

poetry-version:
description: "The version of Poetry to use"
required: true

runs:
using: "composite"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.8"
enable-cache: true

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Install pipx
run: |
python -m pip install --upgrade pip
python -m pip install pipx
python -m pipx ensurepath
continue-on-error: true

shell: bash

- name: Install Poetry with pipx
run: pipx install poetry==${{ inputs.poetry-version }}
continue-on-error: true
shell: bash

- name: Install dependencies
run: poetry install
continue-on-error: true
shell: bash

- name: Run Black
run: poetry run black --check .
continue-on-error: true #Added so to provide lineance while lint
- name: Install the project
run: uv sync --locked --all-extras --dev
shell: bash

- name: Run Flake8
run: poetry run flake8 .
continue-on-error: true #Added so to provide lineance while lint
- name: Run Ruff format
run: uv run ruff format --check .
continue-on-error: true # Added so to provide lenience while linting
shell: bash

- name: Run isort
run: poetry run isort --check .
continue-on-error: true #Added so to provide lineance while lint
- name: Sort imports
run: uv run ruff check --select I --diff .
continue-on-error: true # Added so to provide lenience while linting
shell: bash

- name: Run mypy
run: poetry run mypy .
continue-on-error: true #Added so to provide lineance while lint
run: uv run mypy .
continue-on-error: true # Added so to provide lenience while linting
shell: bash
36 changes: 15 additions & 21 deletions python-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ inputs:
python-version:
description: "The version of Python used"
required: true
poetry-version:
description: "The version of Poetry to install"
required: true

runs:
using: "composite"
Expand All @@ -20,31 +17,28 @@ runs:
with:
python-version: ${{ inputs.python-version }}

- name: Install pipx
run: |
python -m pip install --upgrade pip
python -m pip install pipx
python -m pipx ensurepath
continue-on-error: true
shell: bash
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.8"
enable-cache: true

- name: Install Poetry with pipx
run: pipx install poetry==${{ inputs.poetry-version }}
continue-on-error: true
shell: bash
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Update pyproject.toml to fix NumPy path
run: |
sed -i 's|numpy = { path = "/artifact/numpy-1.23.3-cp310-cp310-linux_x86_64.whl" }|numpy = "^1.23.3"|' pyproject.toml
cat pyproject.toml # Optionally, verify the change
shell: bash

- name: Install dependencies
run: poetry install
continue-on-error: true
- name: Install the project
run: uv sync --locked --all-extras --dev
shell: bash

- name: Run Test
run: poetry run pytest
continue-on-error: true
shell: bash
- name: Run tests
run: uv run pytest
continue-on-error: false
shell: bash