Skip to content

update

update #8

name: Python package
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-venv
- name: Install Poetry
run: |
# Install specific version of Poetry directly
pip install "poetry==1.5.1"
echo "$(python -m site --user-base)/bin" >> $GITHUB_PATH
- name: Configure Poetry
run: |
# Configure Poetry with explicit paths
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
poetry config virtualenvs.path .venv
poetry config --list
poetry --version
- name: Install dependencies
run: |
# Install with verbose output for better debugging
poetry install --no-interaction --no-ansi -v
# Verify the environment
poetry env info
- name: Run tests
run: |
poetry run pytest tests/ -v
- name: Lint with flake8
run: |
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
poetry run flake8 . --count --max-complexity=10 --max-line-length=88 --statistics