-
Notifications
You must be signed in to change notification settings - Fork 4
Fix issues related to moving pyproject.toml to project root #502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issues related to moving pyproject.toml to project root #502
Conversation
…epo structure ## Summary Move pyproject.toml and poetry.lock from backend/ to project root to centralize Python dependency management and fix virtual environment accessibility issues. ## Changes ### Poetry Configuration (Moved) - backend/pyproject.toml → pyproject.toml - backend/poetry.lock → poetry.lock ### Makefile (100+ lines across 20+ targets) - Changed VENV_DIR from backend/.venv to .venv - Updated all Poetry commands to run from project root with PYTHONPATH=backend - Added venv dependency to local-dev-backend and local-dev-all targets - Updated build targets to use project root as Docker build context - Updated all test targets (atomic, unit, integration, e2e) - Updated code quality targets (lint, format, security-check, coverage) - Fixed clean target to reference root-level paths ### CI/CD Workflows (5 files) - poetry-lock-check.yml: Updated paths and removed cd backend commands - 01-lint.yml: Removed working-directory, updated all tool paths - 04-pytest.yml: Updated cache keys and test commands - 05-ci.yml: Updated dependency installation commands - makefile-testing.yml: Updated test execution paths ### Docker Configuration - backend/Dockerfile.backend: Updated COPY commands for new build context - docker-compose.dev.yml: Changed context from ./backend to . + fixed indentation ## Benefits - Single source of truth for Python dependencies at project root - Simplified virtual environment management (.venv/ at root) - Consistent build context across all tools (Makefile, docker-compose, CI/CD) - Better monorepo structure for future frontend/backend separation - Fixes dependency accessibility issues (e.g., docling import errors) ## Breaking Changes Developers need to: 1. Remove old venv: rm -rf backend/.venv 2. Create new venv: make venv 3. Update IDE Python interpreter from backend/.venv to .venv 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
When poetry files were moved from backend/ to project root, Docker cached layers still referenced the old file structure. Adding an ARG before the COPY command forces Docker to invalidate the cache at this layer. Fixes CI build failure in PR #501.
This commit fixes the Docker build failure by changing the build context from the backend directory to the project root directory. This change ensures consistency across all build configurations. Changes made: - Updated backend/Dockerfile.backend to add 'backend/' prefix to all COPY commands - Updated Makefile build-backend target to build from root (.) instead of backend/ - Updated GitHub Actions workflows (03-build-secure.yml, 06-weekly-security-audit.yml, publish.yml) to use root context - Updated docker-compose.dev.yml to use root context - Added .dockerignore in root directory to exclude unnecessary files from build context This fixes the test failure in test_make_build_backend_minimal where the build was failing with "pyproject.toml: not found" error due to inconsistent build context. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…dockerfile-011CUXwLMKkqgqHfnUD6QR12
🚀 Development Environment OptionsThis repository supports Dev Containers for a consistent development environment. Option 1: GitHub Codespaces (Recommended)Create a cloud-based development environment:
Option 2: VS Code Dev Containers (Local)Use Dev Containers on your local machine:
Option 3: Traditional Local SetupSet up the development environment manually: # Clone the repository
git clone https://github.com/manavgup/rag_modulo.git
cd rag_modulo
git checkout claude/fix-backend-dockerfile-011CUXwLMKkqgqHfnUD6QR12
# Initialize development environment
make dev-init
make dev-build
make dev-up
make dev-validateAvailable CommandsOnce in your development environment: make help # Show all available commands
make dev-validate # Validate environment setup
make test-atomic # Run atomic tests
make test-unit # Run unit tests
make lint # Run lintingServices AvailableWhen running
This automated message helps reviewers quickly set up the development environment. |
Pull Request Review: Poetry Configuration Migration to Project RootThis PR addresses Issue #501 by migrating Poetry configuration files from ✅ Strengths1. Comprehensive Scope
2. Excellent .dockerignore AdditionThe new
3. CI/CD Workflow Improvements
4. Makefile Refactoring Quality
🔍 Issues Found & Recommendations1. CRITICAL: Docker Build Context & .dockerignore Mismatch
|
Fixes #502 - Update all Docker and CI/CD references after moving Poetry config from backend/ to project root (Issue #501). Changes: 1. **Dockerfiles** (backend/Dockerfile.backend, Dockerfile.codeengine): - Add POETRY_ROOT_MIGRATION cache-bust ARG to both stages - Update COPY commands to reference pyproject.toml and poetry.lock from project root - Move poetry.lock copy alongside pyproject.toml for consistency - Add explanatory comments about Issue #501 migration 2. **GitHub Actions Workflows**: - Update 05-ci.yml: Fix poetry cache key to use 'poetry.lock' instead of 'backend/poetry.lock' - Update 03-build-secure.yml: Change backend context from 'backend' to '.' for correct file resolution 3. **PyTorch Version Update**: - Upgrade torch from 2.5.0+cpu to 2.6.0+cpu - Upgrade torchvision from 0.20.0+cpu to 0.21.0+cpu - Reason: 2.5.0+cpu not available for ARM64 architecture - New versions are compatible with both ARM64 and x86_64 4. **Secret Management**: - Add pragma: allowlist secret comments to test secrets in 05-ci.yml - Prevents false positives in detect-secrets pre-commit hook Impact: - Fixes failing CI/CD test: TestMakefileTargetsDirect.test_make_build_backend_minimal - Docker builds now correctly find pyproject.toml and poetry.lock at project root - Maintains compatibility with both local development (ARM64) and CI (x86_64) - GitHub Actions workflows correctly cache Poetry dependencies Testing: - Docker build context validated - All references to backend/pyproject.toml and backend/poetry.lock removed - Cache keys updated to match new file locations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
No description provided.