Skip to content

Commit

Permalink
Merge pull request #23 from TheDataGuild/ops/setup-CI
Browse files Browse the repository at this point in the history
Ops/setup ci
  • Loading branch information
Quantisan authored Sep 12, 2023
2 parents 936a5e2 + f2db204 commit 6a27b13
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 4 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/backend-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Backend Python application

on: [push]

defaults:
run:
working-directory: backend

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@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: '**/requirements/dev.txt'

- name: Install dependencies
run: |
pip install -r requirements/dev.txt
- name: Lint with ruff
run: |
ruff --format=github --ignore=E501 --exclude=tests/context.py .
- name: Format check with black
run: |
black --check .
- name: Test with pytest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
pytest
2 changes: 0 additions & 2 deletions backend/mind_palace/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import extract
import index

import llama_index as li


# PDF Extraction
input_dir = "./resources/pdfs/12-pdfs-from-steve-aug-22/xml"
Expand Down
1 change: 1 addition & 0 deletions backend/requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-r build.txt

pytest
ruff
black

5 changes: 4 additions & 1 deletion backend/tests/context.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../mind_palace/')))

sys.path.insert(
0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../mind_palace/"))
)

import extract
2 changes: 1 addition & 1 deletion backend/tests/test_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def test_seed_nodes():
input_dir="./resources/pdfs/12-pdfs-from-steve-aug-22/xml"
input_dir = "./resources/pdfs/12-pdfs-from-steve-aug-22/xml"
nodes = extract.seed_nodes(input_dir)
assert isinstance(nodes, list)
for node in nodes:
Expand Down

0 comments on commit 6a27b13

Please sign in to comment.