Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .env

This file was deleted.

21 changes: 15 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install \
fastapi uvicorn python-multipart httpx \
python-docx python-pptx openpyxl \
PyPDF2 pdfplumber reportlab fpdf \
beautifulsoup4 requests lxml markdown python-frontmatter \
numpy scikit-learn networkx xmindparser notion-client \
pydantic python-dotenv tqdm watchdog pytest
- name: Run tests
env:
EMBEDDING_MODEL: tfidf
AI_PROVIDER: none
run: |
python -m pytest

Expand All @@ -32,7 +41,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
Expand All @@ -42,6 +51,6 @@ jobs:
- name: Lint with flake8
run: |
# 停止构建,如果有语法错误或未定义的名称
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --exclude=.git,.venv,.venv-ci-ubuntu,venv,data,logs,__pycache__ --count --select=E9,F63,F7,F82 --show-source --statistics
# 更宽松的检查
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
flake8 . --exclude=.git,.venv,.venv-ci-ubuntu,venv,data,logs,__pycache__ --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
45 changes: 45 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Python caches/build artifacts
__pycache__/
*.py[cod]
*$py.class
*.egg-info/
.eggs/
build/
dist/

# Virtual environments
.venv/
venv/
env/
ENV/

# Test/type/lint caches
.pytest_cache/
.mypy_cache/
.ruff_cache/
.coverage
coverage.xml
htmlcov/

# Runtime data and indexes
data/
vector_db/
uploads/
logs/
*.log

# Local config/secrets
.env
*.env
*.key
*.pem
secrets/

# Local/editor/system files
.vscode/
.idea/
*.swp
*.swo
.DS_Store
Thumbs.db
Desktop.ini
Binary file removed __pycache__/config.cpython-312.pyc
Binary file not shown.
Binary file removed __pycache__/file_brain.cpython-312.pyc
Binary file not shown.
Binary file removed __pycache__/test_api.cpython-312-pytest-9.0.2.pyc
Binary file not shown.
Binary file removed __pycache__/test_basic.cpython-312-pytest-9.0.2.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ai/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed ai/__pycache__/ai_provider.cpython-312.pyc
Binary file not shown.
Binary file removed ai/__pycache__/qa_engine.cpython-312.pyc
Binary file not shown.
Binary file removed api/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed api/__pycache__/server.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file removed core/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed core/__pycache__/content_indexer.cpython-312.pyc
Binary file not shown.
Binary file removed core/__pycache__/file_reader.cpython-312.pyc
Binary file not shown.
Binary file removed core/__pycache__/logger.cpython-312.pyc
Binary file not shown.
Binary file removed core/__pycache__/search_engine.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file removed core/embedding/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed core/embedding/__pycache__/base.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file removed core/embedding/__pycache__/tfidf.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed core/models/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed core/models/__pycache__/file_content.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Empty file removed logs/file_brain_20260329.log
Empty file.
Binary file removed monitor/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed monitor/__pycache__/file_monitor.cpython-312.pyc
Binary file not shown.
4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
python_files = test_*.py
addopts = -q
norecursedirs = benchmarks .git .venv venv data logs
Binary file removed readers/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed readers/__pycache__/html_reader.cpython-312.pyc
Binary file not shown.
Binary file removed readers/__pycache__/mindmap_reader.cpython-312.pyc
Binary file not shown.
Binary file removed readers/__pycache__/notion_reader.cpython-312.pyc
Binary file not shown.
Binary file removed readers/__pycache__/obsidian_reader.cpython-312.pyc
Binary file not shown.
Binary file removed readers/__pycache__/office_reader.cpython-312.pyc
Binary file not shown.
Binary file removed readers/__pycache__/pdf_reader.cpython-312.pyc
Binary file not shown.
Binary file removed readers/__pycache__/text_reader.cpython-312.pyc
Binary file not shown.
Binary file removed readers/external/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed readers/office/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed readers/others/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed readers/text/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file removed readers/text/__pycache__/text_reader.cpython-312.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion test_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

sys.path.insert(0, str(Path(__file__).parent))

from readers.others.pdf_reader import PdfReader
from readers.others.pdf_reader import PdfReader as PDFReader
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import A4

Expand Down
Loading