Bläddra i källkod

chores: run lint and format (#284)

Deshraj Yadav 2 år sedan
förälder
incheckning
05a4eef6ae

+ 2 - 2
.github/workflows/ci.yml

@@ -23,6 +23,6 @@ jobs:
       - name: Install dependencies
         run: poetry install --all-extras
       - name: Lint with ruff
-        run: poetry run ruff embedchain examples
+        run: make ci_lint
       - name: Test with pytest
-        run: poetry run pytest
+        run: make ci_test

+ 7 - 1
Makefile

@@ -4,7 +4,7 @@ PIP := $(PYTHON) -m pip
 PROJECT_NAME := embedchain
 
 # Targets
-.PHONY: install format lint clean test
+.PHONY: install format lint clean test ci_lint ci_test
 
 install:
 	$(PIP) install --upgrade pip
@@ -22,3 +22,9 @@ clean:
 
 test:
 	$(PYTHON) -m pytest
+
+ci_lint:
+	poetry run ruff .
+
+ci_test:
+	poetry run pytest

+ 4 - 6
embedchain/__init__.py

@@ -2,9 +2,7 @@ import importlib.metadata
 
 __version__ = importlib.metadata.version(__package__ or __name__)
 
-from .embedchain import (
-    App,  # noqa: F401
-    OpenSourceApp,  # noqa: F401
-    PersonApp,  # noqa: F401
-    PersonOpenSourceApp,  # noqa: F401
-)
+from .embedchain import App  # noqa: F401
+from .embedchain import OpenSourceApp  # noqa: F401
+from .embedchain import PersonApp  # noqa: F401
+from .embedchain import PersonOpenSourceApp  # noqa: F401

+ 2 - 0
embedchain/config/InitConfig.py

@@ -1,6 +1,8 @@
 import logging
 import os
+
 from chromadb.utils import embedding_functions
+
 from embedchain.config.BaseConfig import BaseConfig
 
 

+ 2 - 1
embedchain/embedchain.py

@@ -9,7 +9,8 @@ from langchain.docstore.document import Document
 from langchain.memory import ConversationBufferMemory
 
 from embedchain.config import AddConfig, ChatConfig, InitConfig, QueryConfig
-from embedchain.config.QueryConfig import CODE_DOCS_PAGE_PROMPT_TEMPLATE, DEFAULT_PROMPT
+from embedchain.config.QueryConfig import (CODE_DOCS_PAGE_PROMPT_TEMPLATE,
+                                           DEFAULT_PROMPT)
 from embedchain.data_formatter import DataFormatter
 
 gpt4all_model = None

+ 0 - 2
embedchain/vectordb/chroma_db.py

@@ -1,8 +1,6 @@
 import logging
-import os
 
 import chromadb
-from chromadb.utils import embedding_functions
 
 from embedchain.vectordb.base_vector_db import BaseVectorDB
 

+ 2 - 2
setup.py

@@ -1,7 +1,7 @@
-import setuptools
-
 import importlib.metadata
 
+import setuptools
+
 version = importlib.metadata.version(__package__ or __name__)
 
 with open("README.md", "r", encoding="utf-8") as fh: