Use uv to manage dependencies, load YAML configuration via PyYAML, generate rotating logs with logging, and compress archived logs using APScheduler and py7zr.
# Create project virtual environment
uv venv
# Sync locked dependencies
uv sync
# Install current project in editable mode (provides app1/common imports)
uv pip install -e .
# Run app module
uv run python -m app1.app1
# --- Activate the virtual environment ---
# Windows
.venv\Scripts\activate.bat
# Linux / MacOS
source .venv/bin/activate
# --- Deactivate the virtual environment ---
# Windows
.venv\Scripts\deactivate.bat
# Linux / MacOS
deactivateNotes:
uv rundoes not require manually activating.venv.- If you run
uv syncagain later, runuv pip install -e .again.
uv run python -m app1.app1Optional one-off command (without persisting editable install):
uv run --with-editable . python -m app1.app1Set once, then reuse:
- Interpreter: select project
.venv(uv-created environment). - Mark
srcasSources Rootin Project view. - Run Configuration:
- Type: Python
- Run:
Module name - Module name:
app1.app1 - Working directory: project root
- Save the run configuration (optionally as shared).
If you see ModuleNotFoundError: No module named 'app1' or 'common':
uv pip install -e .Initial build:
-Fsingle-file executable,-Dsingle-directory executable-nexecutable name--add-datainclude resource files-pappend search path tosys.path
pyinstaller -n app1 -D --add-data "src/app1/res;res" -p src src/app1/app1.pyBuild with .spec:
--noconfirmNo need to confirm whether to overwrite the last built file
pyinstaller app1.spec --noconfirmRun EXE:
app1.exe --config _internal\res\config.yml