[FIX] حل مشکل ModuleNotFoundError با حذف peikarband.py و استفاده از __init__.py (fix) | ApprovalToken: accepted
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

- حذف peikarband.py که با peikarband/ directory تداخل داشت
- به‌روزرسانی __init__.py برای ایجاد peikarband.peikarband submodule
- به‌روزرسانی PYTHONPATH در Dockerfile برای پشتیبانی از src.* imports
- این تغییرات باعث می‌شود Reflex بتواند peikarband.peikarband را پیدا کند
This commit is contained in:
Ehsan.Asadi
2025-12-31 04:12:32 +03:30
parent 3d241f5269
commit 066ce4a5c1
2 changed files with 26 additions and 7 deletions

View File

@@ -50,8 +50,9 @@ RUN --mount=type=cache,target=/root/.cache/pip \
# This ensures peikarband.peikarband module can be found by Reflex
COPY peikarband/ /build/peikarband/
# Set PYTHONPATH to include /build so Reflex can find the peikarband package
ENV PYTHONPATH=/build
# Set PYTHONPATH to include /build (for peikarband package) and /build/peikarband (for src imports)
# This allows both peikarband.peikarband and src.* imports to work
ENV PYTHONPATH=/build:/build/peikarband
# Initialize Reflex and build frontend from peikarband directory
# Reflex needs to run from the directory containing rxconfig.py
@@ -137,10 +138,11 @@ RUN chmod -R 755 /app && \
# Environment variables
# PYTHONPATH=/app allows importing peikarband.peikarband
# PYTHONPATH also includes /app/peikarband for src.* imports
# REFLEX_DIR points to the directory containing rxconfig.py
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONPATH=/app \
PYTHONPATH=/app:/app/peikarband \
PATH="/app/.venv/bin:$PATH" \
REFLEX_DIR=/app/peikarband \
NODE_ENV=production