diff --git a/MANIFEST.in b/MANIFEST.in index 44c3aff1..3c771107 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,3 @@ +include requirements.txt +include lightrag/api/requirements.txt recursive-include lightrag/api/webui * diff --git a/lightrag/api/requirements.txt b/lightrag/api/requirements.txt index 995e2bc1..80fb74cf 100644 --- a/lightrag/api/requirements.txt +++ b/lightrag/api/requirements.txt @@ -2,6 +2,7 @@ aiofiles ascii_colors asyncpg distro +dotenv fastapi graspologic>=3.4.1 httpcore @@ -11,6 +12,7 @@ numpy openai passlib[bcrypt] pipmaster +pydantic PyJWT python-dotenv python-jose[cryptography] diff --git a/setup.py b/setup.py index 763190ec..14e5c56b 100644 --- a/setup.py +++ b/setup.py @@ -40,36 +40,24 @@ def retrieve_metadata(): # Reading dependencies from requirements.txt -def read_requirements(): +def read_requirements(file_path="requirements.txt"): deps = [] try: - with open("./requirements.txt") as f: - deps = [line.strip() for line in f if line.strip()] + with open(file_path) as f: + deps = [ + line.strip() for line in f if line.strip() and not line.startswith("#") + ] except FileNotFoundError: - print( - "Warning: 'requirements.txt' not found. No dependencies will be installed." - ) + print(f"Warning: '{file_path}' not found. No dependencies will be installed.") return deps def read_api_requirements(): - api_deps = [] - try: - with open("./lightrag/api/requirements.txt") as f: - api_deps = [line.strip() for line in f if line.strip()] - except FileNotFoundError: - print("Warning: API requirements.txt not found.") - return api_deps + return read_requirements("lightrag/api/requirements.txt") def read_extra_requirements(): - api_deps = [] - try: - with open("./lightrag/tools/lightrag_visualizer/requirements.txt") as f: - api_deps = [line.strip() for line in f if line.strip()] - except FileNotFoundError: - print("Warning: API requirements.txt not found.") - return api_deps + return read_requirements("lightrag/tools/lightrag_visualizer/requirements.txt") metadata = retrieve_metadata()