-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding pyproject.toml and using ruff to format the code
- Loading branch information
1 parent
c2abff3
commit 6e8e11e
Showing
1 changed file
with
30 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |