Chore: update md and make command

This commit is contained in:
ziesorx 2025-09-12 21:44:09 +07:00
parent f617025e01
commit ea31261bff
3 changed files with 256 additions and 47 deletions

View file

@ -1133,25 +1133,126 @@ def test_yolo_detection_speed(self, sample_frame, performance_config):
## Development Workflow
### Cross-Platform Setup
The Makefile automatically detects the correct Python command for your platform:
- **macOS/Linux**: Uses `python3` and `pip3` if available
- **Windows**: Falls back to `python` and `pip`
- **Automatic Detection**: No manual configuration needed
### Step-by-Step Project Setup
#### 1. Clone and Navigate to Project
```bash
git clone <repository-url>
cd python-detector-worker
```
#### 2. Install Dependencies
```bash
# Install production dependencies
make install
# Install development dependencies (includes testing tools)
make install-dev
# Check environment information
make env-info
```
#### 3. Configure Environment (Optional)
```bash
# Copy example configuration (if exists)
cp config.example.json config.json
# Set environment variables for development
export DETECTOR_WORKER_ENV=dev
export DETECTOR_WORKER_PORT=8001
```
#### 4. Run the Application
```bash
# For development (staging port 8001 with auto-reload)
make run-staging
# For production (port 8000)
make run-prod
# For debugging (verbose logging on staging port)
make run-debug
```
#### 5. Verify Installation
```bash
# Check system health
curl http://localhost:8001/health
# Run basic tests
make test-fast
# Check code quality
make lint
```
### Development Commands
#### Environment Management
```bash
# Setup
make install-dev # Install development dependencies
make format # Format code with black & isort
make lint # Run code linting
make env-info # Show environment information
make check-deps # Verify dependency integrity
make update-deps # List outdated dependencies
make freeze # Generate requirements-frozen.txt
```
# Testing
#### Code Development
```bash
# Code quality
make format # Format code with black & isort
make lint # Run code linting (flake8, mypy)
make quality # Run all quality checks
# Application execution
make run # Run production mode (port 8000) with reload
make run-staging # Run staging mode (port 8001) with reload
make run-prod # Run production mode (port 8000) without reload
make run-debug # Run debug mode (port 8001) with verbose logging
```
#### Testing Framework
```bash
# Test execution
make test # Run all tests with coverage
make test-unit # Run unit tests only
make test-integration # Run integration tests
make test-performance # Run performance benchmarks
make test-fast # Run fast tests only
make test-fast # Run fast tests only (skip slow markers)
make test-coverage # Generate detailed coverage report
make test-failed # Rerun only failed tests
# Development
make run # Run the application
make clean # Clean build artifacts
# CI/CD testing
make ci-test # Run CI-optimized tests
make ci-quality # Run CI quality checks
```
#### Docker Operations
```bash
# Container management
make docker-build # Build Docker image
make docker-run # Run container (production port 8000)
make docker-run-staging # Run container (staging port 8001)
make docker-dev # Run development container with volume mounts
```
#### Utilities
```bash
# Maintenance
make clean # Clean build artifacts and cache
make monitor # Start system resource monitor
make profile # Run performance profiling
make version # Show application version
# Database utilities (when implemented)
make db-migrate # Run database migrations
make db-reset # Reset database to initial state
```
### Using the Test Runner