Skip to content

Commit

Permalink
Adding pyproject.toml and using ruff to format the code
Browse files Browse the repository at this point in the history
  • Loading branch information
josephnowak committed Oct 16, 2024
1 parent c2abff3 commit 6e8e11e
Showing 1 changed file with 30 additions and 62 deletions.
92 changes: 30 additions & 62 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,39 @@
name: CI
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

on:
push:
branches: [ main ]
branches: [ "master" ]
pull_request:
branches: [ main ]
branches: [ "master" ]

permissions:
contents: read

jobs:
build:
name: Build

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: astral-sh/setup-uv@v1
with:
version: "latest"
- name: Install dependencies
run: uv sync -p 3.11
- name: Mypy
run: uv run mypy autobot tests
- name: unittest
run: uv run python -m pytest discover -s tests/unit
- name: lint
run: uv run ruff check autobot tests
- name: format
run: uv run ruff format --check autobot tests
strategy:
matrix:
python-version: [ 3.11 ]

## This workflow will install Python dependencies, run tests and lint with a single version of Python
## For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
#
#name: Python application
#
#on:
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]
#
#permissions:
# contents: read
#
#jobs:
# build:
#
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: [ 3.11 ]
#
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v3
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install ruff pytest pytest-cov
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Lint with flake8
# run: |
# ruff check
# - name: Test with pytest
# run: |
# pytest --cov
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
ruff check
- name: Test with pytest
run: |
pytest --cov

0 comments on commit 6e8e11e

Please sign in to comment.