# CPU Training Image Python Dependencies
#
# To regenerate pylock.toml:
#   uv pip compile --python-platform=linux --python-version=3.12 \
#     --find-links=https://download.pytorch.org/whl/cpu \
#     --index-strategy=unsafe-first-match \
#     --output-file=pylock.toml pyproject.toml

[project]
name = "cpu-training-image"
version = "0.1.0"
requires-python = "==3.12.*"

dependencies = [
    # ===================================================================
    # BASE IMAGE DEPENDENCIES (from odh-workbench-jupyter-minimal-cpu-py312-ubi9:2025b-v1.39)
    # Versions MUST match exactly to avoid compatibility issues
    # ===================================================================
    
    # JupyterLab Core (exact versions from base image)
    "odh-jupyter-trash-cleanup==0.1.1",
    "jupyterlab==4.4.9",
    "jupyterlab-server==2.27.3",
    "jupyterlab-git==0.51.2",
    "jupyterlab-pygments==0.3.0",
    
    # Jupyter Server and Extensions
    "jupyter-server==2.17.0",
    "jupyter-server-proxy==4.4.0",
    "jupyter-server-terminals==0.5.3",
    "jupyter-server-mathjax==0.2.6",
    "jupyter-client==8.6.3",
    "jupyter-core==5.8.1",
    "jupyter-events==0.12.0",
    "jupyter-lsp==2.3.0",
    
    # Notebook packages
    "nbdime==4.0.2",
    "nbgitpuller==1.2.2",
    "nbformat==5.10.4",
    "nbconvert==7.16.6",
    "nbclient==0.10.2",
    "notebook-shim==0.2.4",
    
    # IPython and kernel
    "ipython==9.5.0",
    "ipykernel==6.30.1",
    "ipython-pygments-lexers==1.1.1",
    
    # Common shared dependencies (base image versions)
    "aiohappyeyeballs==2.6.1",
    "aiohttp==3.12.15",
    "aiosignal==1.4.0",
    "anyio==4.10.0",
    "argon2-cffi==25.1.0",
    "argon2-cffi-bindings==25.1.0",
    "arrow==1.3.0",
    "asttokens==3.0.0",
    "async-lru==2.0.5",
    "attrs==25.3.0",
    "babel==2.17.0",
    "beautifulsoup4==4.13.5",
    "bleach==6.2.0",
    "certifi==2025.8.3",
    "cffi==2.0.0",
    "charset-normalizer==3.4.3",
    "colorama==0.4.6",
    "comm==0.2.3",
    "debugpy==1.8.16",
    "decorator==5.2.1",
    "defusedxml==0.7.1",
    "executing==2.2.1",
    "fastjsonschema==2.21.2",
    "fqdn==1.5.1",
    "frozenlist==1.7.0",
    "gitdb==4.0.12",
    "gitpython==3.1.45",
    "h11==0.16.0",
    "httpcore==1.0.9",
    "httpx==0.28.1",
    "idna==3.10",
    "isoduration==20.11.0",
    "jedi==0.19.2",
    "jinja2==3.1.6",
    "json5==0.12.1",
    "jsonpointer==3.0.0",
    "jsonschema==4.25.1",
    "jsonschema-specifications==2025.9.1",
    "lark==1.2.2",
    "markupsafe==3.0.2",
    "matplotlib-inline==0.1.7",
    "micropipenv==1.9.0",
    "mistune==3.1.4",
    "multidict==6.6.4",
    "nest-asyncio==1.6.0",
    "packaging==25.0",
    "pandocfilters==1.5.1",
    "parso==0.8.5",
    "pexpect==4.9.0",
    "platformdirs==4.4.0",
    "prometheus-client==0.22.1",
    "prompt-toolkit==3.0.52",
    "propcache==0.3.2",
    "psutil==7.0.0",
    "ptyprocess==0.7.0",
    "pure-eval==0.2.3",
    "pycparser==2.23",
    "pygments==2.19.2",
    "python-dateutil==2.9.0.post0",
    "python-json-logger==3.3.0",
    "pyyaml==6.0.2",
    "pyzmq==27.1.0",
    "referencing==0.36.2",
    "requests==2.32.5",
    "rfc3339-validator==0.1.4",
    "rfc3986-validator==0.1.1",
    "rfc3987-syntax==1.1.0",
    "rpds-py==0.27.1",
    "send2trash==1.8.3",
    "setuptools==80.9.0",
    "simpervisor==1.0.0",
    "six==1.17.0",
    "smmap==5.0.2",
    "sniffio==1.3.1",
    "soupsieve==2.8",
    "stack-data==0.6.3",
    "terminado==0.18.1",
    "tinycss2==1.4.0",
    "tornado==6.5.2",
    "traitlets==5.14.3",
    "types-python-dateutil==2.9.0.20250822",
    "typing-extensions==4.15.0",
    "uri-template==1.3.0",
    "urllib3==2.5.0",
    "wcwidth==0.2.13",
    "webcolors==24.11.1",
    "webencodings==0.5.1",
    "websocket-client==1.8.0",
    "wheel==0.45.1",
    "yarl==1.20.1",
    
    # ===================================================================
    # ML/AI DEPENDENCIES (CPU-compatible packages only)
    # ===================================================================
    
    # PyTorch CPU version
    "torch==2.9.0+cpu",
    
    # ML Training and Inference Libraries
    "peft==0.17.0",
    "datasets==4.0.0",
    "transformers==4.57.1",
    "accelerate==1.10.0",
    "trl==0.21.0",
    
    # Deep Learning Utilities (CPU-compatible)
    "einops>=0.8",
    "numba==0.62.1",
    
    # Tokenization
    "sentencepiece>=0.1.99,<0.3",
    "tokenizers==0.22.1",
    
    # Core Dependencies
    "numpy>=1.23.5,<2.0.0",
    "tqdm==4.67.1",
    "pydantic>=2.11.7",
    "protobuf>=5.28.0,<6.0.0",
    "simpleeval>=0.9.13,<1.0",
    "safetensors==0.6.2",
    "py-cpuinfo==9.0.0",
    "rich==14.1.0",
    "aiofiles==24.1.0",
    "async-timeout==4.0.3",
    "tensorboard==2.19.0",
    
    # Training Frameworks
    "training_hub==0.4.0",
    
    # Note: GPU-specific packages are NOT included:
    # - flash-attn (requires CUDA/ROCm)
    # - bitsandbytes (GPU-focused)
    # - liger-kernel (GPU-focused)
    # - deepspeed (primarily for GPU training)
    # - causal-conv1d, mamba-ssm (require CUDA)
]

[tool.uv]
environments = [
    "sys_platform == 'linux' and implementation_name == 'cpython'",
]
# Use CPU index for torch
index-url = "https://download.pytorch.org/whl/cpu"
extra-index-url = ["https://pypi.org/simple"]

