Fix linting

This commit is contained in:
yangdx 2025-10-13 23:50:02 +08:00
parent be9e6d1612
commit 6c05f0f837
2 changed files with 12 additions and 11 deletions

View file

@ -246,9 +246,9 @@ cd lightrag_webui && bun run build
## Summary ## Summary
**PyPI users**: No action needed, frontend included **PyPI users**: No action needed, frontend included
**Developers**: Use `pip install -e ".[api]"`, build frontend when needed **Developers**: Use `pip install -e ".[api]"`, build frontend when needed
**CI/CD**: Automatic build in GitHub Actions **CI/CD**: Automatic build in GitHub Actions
**Git**: Frontend build output never committed **Git**: Frontend build output never committed
For questions or issues, please open a GitHub issue. For questions or issues, please open a GitHub issue.

View file

@ -1,4 +1,5 @@
"""Minimal setup.py for backward compatibility with frontend build check""" """Minimal setup.py for backward compatibility with frontend build check"""
from pathlib import Path from pathlib import Path
from setuptools import setup from setuptools import setup
from setuptools.command.build_py import build_py from setuptools.command.build_py import build_py
@ -13,12 +14,12 @@ def check_webui_exists():
class BuildPyCommand(build_py): class BuildPyCommand(build_py):
"""Check WebUI build status before packaging/installation""" """Check WebUI build status before packaging/installation"""
def run(self): def run(self):
# Check if running in development mode # Check if running in development mode
is_develop = any(arg in sys.argv for arg in ['develop', 'egg_info']) is_develop = any(arg in sys.argv for arg in ["develop", "egg_info"])
is_editable = '--editable' in sys.argv or '-e' in sys.argv is_editable = "--editable" in sys.argv or "-e" in sys.argv
if is_develop or is_editable: if is_develop or is_editable:
# Development mode: friendly reminder # Development mode: friendly reminder
if not check_webui_exists(): if not check_webui_exists():
@ -55,19 +56,19 @@ Then run the installation again.
💡 TIP: For development, use editable mode instead: 💡 TIP: For development, use editable mode instead:
pip install -e ".[api]" pip install -e ".[api]"
This allows you to build the frontend after installation. This allows you to build the frontend after installation.
""") """)
sys.exit(1) sys.exit(1)
print("✅ Proceeding with package build...") print("✅ Proceeding with package build...")
build_py.run(self) build_py.run(self)
setup( setup(
cmdclass={ cmdclass={
'build_py': BuildPyCommand, "build_py": BuildPyCommand,
} }
) )