Skip to content

Mod: Downgrade black version from 23.12.1 to 23.3.0 to be compatible … #333

Mod: Downgrade black version from 23.12.1 to 23.3.0 to be compatible …

Mod: Downgrade black version from 23.12.1 to 23.3.0 to be compatible … #333

# Template: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package using Pip
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
env:
CACHE_NUMBER: 0 # increase to reset cache manually
AAC_DATASETS_ROOT: "$HOME/.cache/data"
# Cancel workflow if a new push occurs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.11"]
steps:
# --- INSTALLATIONS ---
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install package
shell: bash
# note: ${GITHUB_REF##*/} gives the branch name
# note 2: dev is NOT the branch here, but the dev dependencies
run: |
python -m pip install "aac-datasets[dev] @ git+https://github.com/Labbeti/aac-datasets@${GITHUB_REF##*/}"
- name: Install soundfile for torchaudio, ffmpeg and yt-dlp for AudioCaps download
run: |
sudo add-apt-repository ppa:tomtomtom/yt-dlp # Add ppa repo to apt
sudo apt-get update
sudo apt-get install libsndfile1
sudo apt-get install ffmpeg
sudo apt-get install yt-dlp
# --- TESTS ---
- name: Compile python files
run: |
python -m compileall src
- name: Lint with flake8
run: |
python -m flake8 --config .flake8 --exit-zero --show-source --statistics src
- name: Check format with Black
run: |
python -m black --check --diff src
- name: Print install info
run: |
aac-datasets-info
ffmpeg -version
yt-dlp --version
- name: Test with pytest
run: |
python -m pytest -v
- name: Build data root
run: |
dataroot=`eval echo $AAC_DATASETS_ROOT`
echo "Building directory '$dataroot'..."
mkdir -p "$dataroot"
- name: Try to download Clotho val
run: |
aac-datasets-download --verbose 2 clotho --subsets val
- name: Try to download AudioCaps val
run: |
aac-datasets-download --verbose 2 audiocaps --subsets val --max_workers none --with_tags true
- name: Check data root
run: |
aac-datasets-check --verbose 2 --datasets clotho audiocaps