perf(backend): enhance backend for reproducible builds and modular structure#24
Merged
cristofima merged 9 commits intomainfrom Dec 26, 2025
Merged
perf(backend): enhance backend for reproducible builds and modular structure#24cristofima merged 9 commits intomainfrom
cristofima merged 9 commits intomainfrom
Conversation
…uilds - Enhanced Dockerfile to utilize a lock file for consistent dependency versions. - Added fallback mechanism to install from requirements.txt if lock file is absent. - Updated FastAPI version to 1.1.0 in main.py for improved features and fixes. - Introduced requirements.lock and updated requirements-dev.txt for better dependency management.
…aining report generation
There was a problem hiding this comment.
Pull request overview
This PR enhances the backend architecture by restructuring the training module into a proper Python package with modular organization, updating dependencies to use flexible version ranges for better maintainability, and expanding the test suite. The modular structure improves code organization by separating core ML components, report generation, and utilities into distinct packages with absolute imports.
Key Changes:
- Restructured
backend/training/from flat scripts to a modular package structure withcore/,reports/, andutils/subdirectories - Updated dependency management from pinned versions to flexible version ranges (e.g.,
fastapi>=0.115.0,<1.0.0) - Expanded test suite from 197 to 263 tests with new test files for EDA and training report generation
Reviewed changes
Copilot reviewed 29 out of 32 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
backend/training/__init__.py |
Adds package root with documentation for the new modular structure |
backend/training/main.py |
Updates entry point with absolute imports and adds default parameter value |
backend/training/core/ |
New directory containing preprocessor, trainer, and ONNX exporter modules |
backend/training/reports/ |
New directory containing EDA and training report generators |
backend/training/utils/detection.py |
Extracts shared detection utilities (problem type, ID columns, etc.) |
backend/training/Dockerfile |
Updates to copy package structure and use python -m training.main |
backend/training/requirements.txt |
Replaces pinned versions with flexible ranges and adds inline documentation |
backend/requirements.txt |
Updates API dependencies with flexible ranges, notably FastAPI >=0.115.0 for ReDoc fix |
backend/requirements-dev.txt |
Updates dev dependencies to use version ranges |
backend/tests/training/conftest.py |
Simplifies path setup for package imports |
backend/tests/training/unit/test_*.py |
Updates imports to use new package structure |
backend/tests/training/unit/test_eda.py |
New comprehensive test suite for EDA report generation (485 tests) |
backend/tests/training/unit/test_training_report.py |
New comprehensive test suite for training report generation (552 tests) |
docs/UNIT_TESTING_ANALYSIS.md |
Updates test counts and coverage metrics, documents new modular structure |
docs/LESSONS_LEARNED.md |
Adds lessons about ReDoc CDN issues and cross-platform lock files |
CHANGELOG.md |
Documents dependency updates and test suite expansion |
.github/workflows/*.yml |
Adds requirements-dev.txt to deployment triggers |
.gitignore |
Broadens coverage file pattern matching |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enhances the backend architecture by restructuring the training module into a proper Python package with modular organization, updating dependencies to use flexible version ranges for better maintainability, and expanding the test suite. The modular structure improves code organization by separating core ML components, report generation, and utilities into distinct packages with absolute imports.
Key Changes: