From 6c05f0f83720c8726fbeb8510ca7511eb253d563 Mon Sep 17 00:00:00 2001 From: yangdx Date: Mon, 13 Oct 2025 23:50:02 +0800 Subject: [PATCH] Fix linting --- docs/FrontendBuildGuide.md | 8 ++++---- setup.py | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/FrontendBuildGuide.md b/docs/FrontendBuildGuide.md index 18e1afb5..4d416899 100644 --- a/docs/FrontendBuildGuide.md +++ b/docs/FrontendBuildGuide.md @@ -246,9 +246,9 @@ cd lightrag_webui && bun run build ## Summary -✅ **PyPI users**: No action needed, frontend included -✅ **Developers**: Use `pip install -e ".[api]"`, build frontend when needed -✅ **CI/CD**: Automatic build in GitHub Actions -✅ **Git**: Frontend build output never committed +✅ **PyPI users**: No action needed, frontend included +✅ **Developers**: Use `pip install -e ".[api]"`, build frontend when needed +✅ **CI/CD**: Automatic build in GitHub Actions +✅ **Git**: Frontend build output never committed For questions or issues, please open a GitHub issue. diff --git a/setup.py b/setup.py index 460c7a3a..0a796ddb 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ """Minimal setup.py for backward compatibility with frontend build check""" + from pathlib import Path from setuptools import setup from setuptools.command.build_py import build_py @@ -13,12 +14,12 @@ def check_webui_exists(): class BuildPyCommand(build_py): """Check WebUI build status before packaging/installation""" - + def run(self): # Check if running in development mode - 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_develop = any(arg in sys.argv for arg in ["develop", "egg_info"]) + is_editable = "--editable" in sys.argv or "-e" in sys.argv + if is_develop or is_editable: # Development mode: friendly reminder if not check_webui_exists(): @@ -55,19 +56,19 @@ Then run the installation again. 💡 TIP: For development, use editable mode instead: pip install -e ".[api]" - + This allows you to build the frontend after installation. ╚══════════════════════════════════════════════════════════════════════════╝ """) sys.exit(1) - + print("✅ Proceeding with package build...") build_py.run(self) setup( cmdclass={ - 'build_py': BuildPyCommand, + "build_py": BuildPyCommand, } )