180 lines
4.7 KiB
Markdown
180 lines
4.7 KiB
Markdown
# Requirements Update Dokumentation
|
|
|
|
## Datum: 2025-01-12
|
|
|
|
## Überblick der Änderungen
|
|
|
|
Die `requirements.txt` wurde umfassend aktualisiert, um die Stabilität, Sicherheit und Funktionalität der MYP Platform zu verbessern.
|
|
|
|
## Wichtige Verbesserungen
|
|
|
|
### 🔒 Versionsspezifikationen
|
|
- **Ansatz**: Minimale Versionsangaben für maximale Flexibilität
|
|
- **Nur kritische Pakete**: Versionsangaben nur bei Core-Framework-Paketen mit bekannten Breaking Changes
|
|
- **Behalten**: `Flask>=2.3.0,<3.0.0`, `SQLAlchemy>=2.0.0,<3.0.0`, `cryptography>=41.0.0`
|
|
- **Entfernt**: Versionsangaben bei Utility-Paketen und Extensions für bessere Kompatibilität
|
|
|
|
### 📊 Neue Kategorien hinzugefügt
|
|
|
|
#### Testing & Development
|
|
- `pytest>=7.4.0` - Moderne Test-Framework
|
|
- `pytest-flask>=1.2.0` - Flask-spezifische Tests
|
|
- `pytest-cov>=4.1.0` - Code Coverage
|
|
- `coverage>=7.3.0` - Coverage-Berichte
|
|
|
|
#### Code Quality
|
|
- `flake8>=6.1.0` - Code-Linting
|
|
- `black>=23.9.0` - Code-Formatierung
|
|
- `isort>=5.12.0` - Import-Sortierung
|
|
|
|
#### Zusätzliche Utilities
|
|
- `humanize>=4.8.0` - Benutzerfreundliche Formatierung
|
|
- `validators>=0.22.0` - Erweiterte Validierung
|
|
- `Send2Trash>=1.8.2` - Sichere Dateilöschung
|
|
- `ping3>=4.0.4` - Netzwerk-Diagnose
|
|
- `netifaces>=0.11.0` - Netzwerk-Interface-Info
|
|
- `cachelib>=0.10.0` - Caching-Funktionen
|
|
- `py7zr>=0.20.0` - 7-Zip-Komprimierung
|
|
|
|
### 🚀 Performance-Optimierungen (optional)
|
|
```
|
|
# uwsgi>=2.0.21; sys_platform != "win32"
|
|
# gevent>=23.7.0
|
|
# redis>=5.0.0
|
|
# celery>=5.3.0
|
|
```
|
|
|
|
### 🔄 Aktualisierte Pakete
|
|
|
|
#### Core Framework
|
|
- Flask: `2.3.0+` - Neueste stabile Version
|
|
- SQLAlchemy: `2.0.0+` - Moderne ORM-Features
|
|
- Werkzeug: `2.3.0+` - Kompatibilität mit Flask
|
|
|
|
#### Sicherheit
|
|
- cryptography: `41.0.0+` - Aktuelle Sicherheits-Fixes
|
|
- bcrypt: `4.0.0+` - Verbesserte Hash-Performance
|
|
- PyJWT: `2.8.0+` - JWT-Token-Handling
|
|
|
|
#### Data Processing
|
|
- pandas: `2.0.0+` - Moderne DataFrame-API
|
|
- openpyxl: `3.1.0+` - Excel-Export-Verbesserungen
|
|
- Pillow: `10.0.0+` - Aktuelle Bildverarbeitung
|
|
|
|
## Plattform-spezifische Pakete
|
|
|
|
### Windows
|
|
- `pywin32>=306` - Windows-API-Zugriff
|
|
- `wmi>=1.5.1` - Windows Management Interface
|
|
- `colorama>=0.4.6` - Farbige Konsolen-Ausgabe
|
|
|
|
### Linux
|
|
- `RPi.GPIO>=0.7.1` - Raspberry Pi GPIO-Kontrolle
|
|
|
|
### Production
|
|
- `gunicorn>=21.2.0` - Unix WSGI-Server
|
|
- `waitress>=2.1.2` - Windows-kompatibel
|
|
|
|
## Installation
|
|
|
|
### Vollständige Installation
|
|
```bash
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
### Nur Production-Pakete (ohne Dev-Tools)
|
|
```bash
|
|
pip install -r requirements.txt --no-deps
|
|
# Dann manuell nur die benötigten Pakete installieren
|
|
```
|
|
|
|
### Performance-Pakete aktivieren
|
|
Entkommentieren Sie die gewünschten Pakete in der Datei:
|
|
```bash
|
|
# uwsgi>=2.0.21; sys_platform != "win32"
|
|
```
|
|
|
|
## Kompatibilität
|
|
|
|
- **Python**: 3.8+ (empfohlen: 3.11+)
|
|
- **Betriebssysteme**: Windows 10+, Linux, macOS
|
|
- **Architektur**: x86_64, ARM64
|
|
|
|
## Migrationsleitfaden
|
|
|
|
### Von alter requirements.txt
|
|
1. Virtuelles Environment erstellen:
|
|
```bash
|
|
python -m venv venv
|
|
source venv/bin/activate # Windows: venv\Scripts\activate
|
|
```
|
|
|
|
2. Dependencies installieren:
|
|
```bash
|
|
pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
3. Anwendung testen:
|
|
```bash
|
|
python app.py --debug
|
|
```
|
|
|
|
### Troubleshooting
|
|
|
|
#### Häufige Probleme
|
|
1. **PyP100 Installation**:
|
|
- Windows: Möglicherweise Visual C++ Build Tools erforderlich
|
|
- Lösung: Microsoft C++ Build Tools installieren
|
|
|
|
2. **weasyprint Installation**:
|
|
- Linux: Zusätzliche System-Dependencies erforderlich
|
|
- Ubuntu/Debian: `sudo apt install libpango-1.0-0 libharfbuzz0b libpangoft2-1.0-0`
|
|
|
|
3. **psutil Windows-Probleme**:
|
|
- Lösung: Neueste Version verwenden oder pre-compiled wheel
|
|
|
|
#### Fallback-Installation
|
|
Bei Problemen einzelne Pakete separat installieren:
|
|
```bash
|
|
pip install Flask>=2.3.0
|
|
pip install SQLAlchemy>=2.0.0
|
|
# ... weitere Core-Pakete
|
|
```
|
|
|
|
## Wartung
|
|
|
|
### Regelmäßige Updates
|
|
```bash
|
|
# Sicherheitsupdates prüfen
|
|
pip list --outdated
|
|
|
|
# Spezifische Pakete aktualisieren
|
|
pip install --upgrade Flask SQLAlchemy
|
|
|
|
# Vollständiges Update (Vorsicht!)
|
|
pip install --upgrade -r requirements.txt
|
|
```
|
|
|
|
### Dependency-Pinning für Production
|
|
Für Production-Deployments:
|
|
```bash
|
|
pip freeze > requirements-lock.txt
|
|
```
|
|
|
|
## Nächste Schritte
|
|
|
|
1. **Testing**: Vollständige Test-Suite mit pytest ausführen
|
|
2. **Security Audit**: `pip-audit` für Sicherheitslücken
|
|
3. **Performance**: Optional Performance-Pakete aktivieren
|
|
4. **Monitoring**: Dependency-Updates überwachen
|
|
|
|
## Changelog
|
|
|
|
### 2025-01-12
|
|
- ✅ Umfassende Aktualisierung mit Versionsspezifikationen
|
|
- ✅ Neue Test- und Development-Tools hinzugefügt
|
|
- ✅ Code-Quality-Tools integriert
|
|
- ✅ Erweiterte Utility-Pakete
|
|
- ✅ Performance-Optimierungen vorbereitet
|
|
- ✅ Verbesserte Plattform-Kompatibilität |