Files
opm-simulators/python/docker/test_wheels/dockerfiles/ubuntu-22.04
Håkon Hægland ddf2e3d338 Add Python version selection to Docker image builds
This enhancement allows specifying which Python versions to install during
Docker image builds, significantly reducing build times when only testing
specific Python versions during debugging.

Changes:
- Add --python-versions option to build-docker-image command
- Pass BUILD_PYTHON_VERSIONS build argument to Docker
- Update install_python_versions.py to respect BUILD_PYTHON_VERSIONS env var
- Validate requested versions against supported versions in python_versions.json
- Maintain backward compatibility (installs all versions if not specified)

Usage examples:
  # Build with only Python 3.12 (much faster for debugging)
  opm-wheels build-docker-image --docker-os="ubuntu-24.04" --python-versions="3.12"

  # Build with multiple specific versions
  omp-wheels build-docker-image --python-versions="3.11,3.12"

  # Build with all versions (original behavior)
  opm-wheels build-docker-image

Benefits:
- Reduces build time from ~7 minutes to ~2 minutes for single Python version
- Enables faster iteration during debugging of Docker-specific issues
- Particularly valuable when combined with --test-cases-* for focused testing
2025-09-23 07:06:24 +02:00
..