Skip to content

Commit

Permalink
fix: pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
leoguillaumegouv committed Sep 17, 2024
1 parent 12d4172 commit dce71d1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ feat(collections): collection name retriever
2. Dans un environnement virtuel Python, installez les packages Python présents dans le fichier *[pyproject.toml](./pyproject.toml)*

```bash
pip install ".[ui,app,dev]"
pip install ".[ui,app,dev,test]"
pre-commit install
```

Expand All @@ -37,7 +37,7 @@ Merci avant chaque pull request, de vérifier le bon déploiement de votre API
```

2. Executez les tests unitaires

```bash
PYTHONPATH=. pytest -v --exitfirst app/tests --base-url http://localhost:8080/v1 --api-key API_KEY
```
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/_vectorstore.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import time
import uuid
from typing import List, Optional
import uuid

from fastapi import HTTPException
from langchain.docstore.document import Document
from qdrant_client.http.models import Distance, FieldCondition, Filter, MatchAny, PointIdsList, PointStruct, VectorParams

from app.schemas.chunks import Chunk
from langchain.docstore.document import Document
from app.schemas.collections import CollectionMetadata
from app.schemas.config import EMBEDDINGS_MODEL_TYPE, METADATA_COLLECTION, PRIVATE_COLLECTION_TYPE, PUBLIC_COLLECTION_TYPE

Expand Down
12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,23 @@ dev = [
"ruff==0.6.5",
"pre-commit==3.6.2",
]
test = [
"pytest==8.2.2",
]

[tool.setuptools]
py-modules = []

[tool.ruff]
line-length = 150

[tool.ruff.lint]
ignore = ["F403", "F841"] # import * and never used variables

[ruff.isort]
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = ["config", "utils", "app"]
forced-separate = ["tests"]
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]


[tool.ruff.lint.isort.sections]
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
5 changes: 3 additions & 2 deletions ui/chat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from openai import OpenAI
import streamlit as st

from config import BASE_URL
from openai import OpenAI
from utils import get_collections, get_models, set_config, header
from utils import get_collections, get_models, header, set_config

# Config
set_config()
Expand Down

0 comments on commit dce71d1

Please sign in to comment.