Skip to content

Converted the build-system to poetry>=2.0 #11

Converted the build-system to poetry>=2.0

Converted the build-system to poetry>=2.0 #11

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
paths-ignore:
- '**.md'
- 'benchmark/**'
jobs:
core:
name: Test (Core)
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
include:
- operating-system: ubuntu-latest
path: ~/.cache/pip
- operating-system: windows-latest
path: ~\AppData\Local\pip\Cache
- operating-system: macos-latest
path: ~/Library/Caches/pip
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Restore Python cache
uses: actions/cache/restore@v4
with:
path: ${cache-dir}/virtualenvs
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-python-${{ matrix.python-version }}-
- name: Install and configure Poetry
uses: snok/install-poetry@v1
# - name: Install PyTorch
# run: |
# if [ "${{ matrix.operating-system }}" = "macos-latest" ]; then
# uv pip install --system torch==2.6.0 torchvision==0.21.0
# else
# uv pip install --system torch==2.6.0+cpu torchvision==0.21.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu
# fi
# shell: bash
- name: Install all dependencies
run: poetry install
shell: bash
- name: Run PyTest
run: poetry run pytest
shell: bash
# Save/Update the Python cache prior to unittest extras
- name: Save Python cache
uses: actions/cache/save@v4
with:
path: ${cache-dir}/virtualenvs
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
pre_commit_hooks:
name: Check Pre-Commit Hooks
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
python-version: ["3.9"]
include:
- operating-system: ubuntu-latest
path: ~/.cache/pip
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Restore Python cache
uses: actions/cache/restore@v4
with:
path: ${cache-dir}/virtualenvs
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-python-${{ matrix.python-version }}-
- name: Install and configure Poetry
uses: snok/install-poetry@v1
- name: Install all dependencies
run: poetry install
- name: Run checks
run: poetry run pre-commit run --files $(find albumentations -type f)
check_defaults_in_apply:
name: Check Defaults In Apply
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
python-version: ["3.9"]
include:
- operating-system: ubuntu-latest
path: ~/.cache/pip
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Restore Python cache
uses: actions/cache/restore@v4
with:
path: ${cache-dir}/virtualenvs
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-python-${{ matrix.python-version }}-
- name: Install and configure Poetry
uses: snok/install-poetry@v1
- name: Install all dependencies
run: poetry install
- name: check-defaults-in-apply
run: poetry run python -m tools.check_defaults
# check_transforms_docs:
# name: Check Readme is not outdated
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: [3.9]
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install all requirements
# run: |
# python -m pip install --upgrade uv
# uv pip install --system requests
# uv pip install --system .
# - name: Run checks for documentation
# run: python -m tools.make_transforms_docs check README.md