mirror of
https://github.com/katanemo/plano.git
synced 2026-07-23 16:51:04 +02:00
fix precommit
This commit is contained in:
parent
8e999a6298
commit
6f7331bdc1
3 changed files with 39 additions and 13 deletions
8
.github/workflows/pre-commit.yml
vendored
8
.github/workflows/pre-commit.yml
vendored
|
|
@ -13,13 +13,5 @@ jobs:
|
||||||
- uses: actions/setup-python@v3
|
- uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
# Step 3: Install dependencies (from requirements.txt or Pipfile)
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m venv venv
|
|
||||||
source venv/bin/activate
|
|
||||||
cd model_server
|
|
||||||
pip install --upgrade pip
|
|
||||||
pip install -r requirements.txt # Or use pipenv install
|
|
||||||
- uses: pre-commit/action@v3.0.1
|
- uses: pre-commit/action@v3.0.1
|
||||||
|
|
||||||
|
|
|
||||||
39
.github/workflows/python-tests.yml
vendored
Normal file
39
.github/workflows/python-tests.yml
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
name: Run Python Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main # Run tests on pushes to the main branch
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main # Run tests on pull requests to the main branch
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Step 1: Check out the code from your repository
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Step 2: Set up Python (specify the version)
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.10" # Adjust to your Python version
|
||||||
|
|
||||||
|
# Step 3: Install dependencies (from requirements.txt or Pipfile)
|
||||||
|
- name: Install dependencies
|
||||||
|
run:
|
||||||
|
python -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
cd model_server
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt # Or use pipenv install
|
||||||
|
|
||||||
|
# Step 4: Set PYTHONPATH and run tests
|
||||||
|
- name: Run tests with pytest
|
||||||
|
run: |
|
||||||
|
export PYTHONPATH=.
|
||||||
|
pytest --maxfail=5 --disable-warnings
|
||||||
|
|
@ -28,11 +28,6 @@ repos:
|
||||||
# --lib is to only test the library, since when integration tests are made,
|
# --lib is to only test the library, since when integration tests are made,
|
||||||
# they will be in a seperate tests directory
|
# they will be in a seperate tests directory
|
||||||
entry: bash -c "cd crates/llm_gateway && cargo test --lib"
|
entry: bash -c "cd crates/llm_gateway && cargo test --lib"
|
||||||
- id: python-tests
|
|
||||||
name: Run Python Tests with pytest
|
|
||||||
language: system
|
|
||||||
entry: bash -c "cd model_server && PYTHONPATH=. pytest --maxfail=5 --disable-warnings"
|
|
||||||
types: [python]
|
|
||||||
|
|
||||||
|
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue