Skip to content

Commit

Permalink
Merge branch 'develop' into feature/issue_115
Browse files Browse the repository at this point in the history
  • Loading branch information
joannasendorek committed Aug 30, 2023
2 parents 197ba46 + 334dcaf commit 20c4cb9
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 15 deletions.
45 changes: 37 additions & 8 deletions .github/actions/build-module/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ runs:
steps:
- name: Set up Python
uses: actions/setup-python@v4
env:
PIP_ROOT_USER_ACTION: 'ignore'
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Upgrade pip
shell: bash
run: |
pip install --root-user-action=ignore --upgrade pip
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
Expand All @@ -28,25 +36,46 @@ runs:
restore-keys: |
venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('poetry.lock') }}
venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-
- name: Setup poetry
uses: abatilo/actions-poetry@v2.1.5
uses: abatilo/actions-poetry@v2.3.0
env:
PIP_ROOT_USER_ACTION: ignore
with:
poetry-version: ${{ env.POETRY_VERSION }}

- name: Install dependencies
shell: bash
env:
PIP_ROOT_USER_ACTION: ignore
run: |
poetry install
working-directory: "${{ inputs.moduleFolder }}"
- name: Run Black
poetry install
- name: Install pandas (version ${{ env.PANDAS_VERSION }})
shell: bash
env:
PIP_ROOT_USER_ACTION: ignore
run: |
poetry run black . --check --diff --color
working-directory: "${{ inputs.moduleFolder }}"
- name: Run MyPy checks
poetry run pip uninstall pandas --yes
poetry run pip install pandas==${{ env.PANDAS_VERSION }}
- name: Install torch (version ${{ env.TORCH_VERSION }})
shell: bash
env:
PIP_ROOT_USER_ACTION: ignore
run: |
poetry run pip uninstall torch --yes
poetry run pip install torch==${{ env.TORCH_VERSION }}
- name: Install pytorch-lightning (version ${{ env.PYTORCH_LIGHTNING_VERSION }})
shell: bash
env:
PIP_ROOT_USER_ACTION: ignore
run: |
poetry run mypy -p foxai --show-error-context --pretty --namespace-packages --explicit-package-bases --ignore-missing-imports
poetry run pip uninstall pytorch-lightning --yes --root-user-action ignore
poetry run pip install pytorch-lightning==${{ env.PYTORCH_LIGHTNING_VERSION }}
working-directory: "${{ inputs.moduleFolder }}"

- name: Run tests
shell: bash
run: poetry run pytest
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
push:
branches:
- main
- development
- develop
pull_request:
branches:
- main
- development
- develop
- release/*
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
Expand All @@ -23,3 +23,8 @@ jobs:
- uses: "./.github/actions/build-module"
with:
moduleName: "src"
env:
PYTHON_VERSION: "3.8"
TORCH_VERSION: "2.0.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu"
PANDAS_VERSION: "2.0.0"
PYTORCH_LIGHTNING_VERSION: "2.0.7"
2 changes: 2 additions & 0 deletions .github/workflows/installation_test_auto_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ jobs:
strategy:
fail-fast: false
matrix:
pandas_version: ["2.0.0"]
cuda_version: ["11.7.1"]
python_version: ["3.8", "3.9", "3.10"]
uses: ./.github/workflows/installation_test_called_workflow.yaml
with:
cuda_version: ${{ matrix.cuda_version }}
python_version: ${{ matrix.python_version }}
pandas_version: ${{ matrix.pandas_version }}
28 changes: 25 additions & 3 deletions .github/workflows/installation_test_called_workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Installation test
run-name: Installation test, CUDA ${{ inputs.cuda_version }}, PYTHON ${{ inputs.python_version }}
run-name: Installation test, CUDA ${{ inputs.cuda_version }}, PYTHON ${{ inputs.python_version }}, PyTorch ${{ inputs.torch_version }}, PyTorch-Lightning ${{ inputs.torch_lightning_version }}, Pandas ${{ inputs.pandas_version }}

on:
workflow_call:
Expand All @@ -12,9 +12,21 @@ on:
description: "Select Python version"
required: true
type: string
pandas_version:
description: "Select Pandas version"
required: true
type: string
torch_version:
description: "Select PyTorch version"
required: true
type: string
pytorch_lightning_version:
description: "Select PyTorch-Lightning version"
required: true
type: string

env:
POETRY_VERSION: "1.4.2"
POETRY_VERSION: "1.5.1"
jobs:
foxai:
name: Install FoxAI
Expand All @@ -28,11 +40,21 @@ jobs:
- name: Check out repository
uses: actions/checkout@v3
- name: Install system libs
env:
DEBIAN_FRONTEND: "noninteractive"
TZ: "Etc/UTC"
run: |
apt-get update -y
apt-get install -y libglib2.0-0 libx11-dev libxext-dev
apt-get install -y libglib2.0-0 libx11-dev libxext-dev libgl1-mesa-glx
apt-get install -y curl
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
node --version
- uses: "./.github/actions/build-module"
env:
PYTHON_VERSION: ${{ inputs.python_version }}
PANDAS_VERSION: ${{ inputs.pandas_version }}
TORCH_VERSION: ${{ inputs.torch_version }}
PYTORCH_LIGHTNING_VERSION: ${{ inputs.pytorch_lightning_version }}
with:
moduleName: "src"
38 changes: 37 additions & 1 deletion .github/workflows/installation_test_manual_run.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,43 @@
name: Manual Installation test
run-name: Installation test, CUDA ${{ inputs.cuda_version }}, PYTHON ${{ inputs.python_version }}
run-name: Installation test, CUDA ${{ inputs.cuda_version }}, PYTHON ${{ inputs.python_version }}, PyTorch ${{ inputs.torch_version }}, PyTorch-Lightning ${{ inputs.torch_lightning_version }}, Pandas ${{ inputs.pandas_version }}


on:
workflow_dispatch:
inputs:
pandas_version:
description: "Select Pandas version"
required: true
default: "2.0.0"
type: choice
options:
- "1.1.0"
- "2.0.0"
- "2.0.3"
torch_version:
description: "Select PyTorch version"
required: true
default: "2.0.1"
type: choice
options:
- "1.12.1"
- "1.13.0"
- "1.13.1"
- "2.0.0"
- "2.0.1"
pytorch_lightning_version:
description: "Select PyTorch-Lightning version"
required: true
default: "2.0.7"
type: choice
options:
- "1.5.0"
- "1.6.0"
- "1.7.0"
- "1.8.0"
- "1.9.0"
- "2.0.0"
- "2.0.7"
cuda_version:
description: "Select CUDA version"
required: true
Expand Down Expand Up @@ -35,3 +68,6 @@ jobs:
with:
cuda_version: ${{ inputs.cuda_version }}
python_version: ${{ inputs.python_version }}
pandas_version: ${{ inputs.pandas_version }}
torch_version: ${{ inputs.torch_version }}
pytorch_lightning_version: ${{ inputs.pytorch_lightning_version }}
30 changes: 30 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: reviewdog
on: [pull_request]
jobs:
linter_name:
name: runner / black formatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Install specific version black (this step is not required. default is "black[jupyter]")
- run: pip install black==23.1.0
- uses: reviewdog/action-black@v3
with:
github_token: ${{ secrets.github_token }}
# Change reviewdog reporter if you need [github-pr-check, github-check].
reporter: github-pr-review
# Change reporter level if you need.
# GitHub Status Check won't become failure with a warning.
level: warning
mypy:
name: runner / mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: tsuyoshicho/action-mypy@v3
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
level: warning
workdir: .
execute_command: 'mypy -p foxai --show-error-context --pretty --namespace-packages --explicit-package-bases --ignore-missing-imports'
4 changes: 3 additions & 1 deletion tests/test_array_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ def test_transpose_color_last_in_array_np_with_should_raise_exception_for_2d_dat
_ = transpose_color_last_in_array_np(array=array)


def test_transpose_color_last_in_array_np_with_should_raise_exception_for_5d_data() -> None:
def test_transpose_color_last_in_array_np_with_should_raise_exception_for_5d_data() -> (
None
):
"""Test if function raises RuntimeError when data has more than 4 dimensions."""
array = np.zeros((1, 1, 6, 6, 3))

Expand Down

0 comments on commit 20c4cb9

Please sign in to comment.