parameters:
  versionSpec: '3.x'
  architecture: 'x64'

steps:
  # use python 3.8 for tooling. packaging. platform.
  - task: UsePythonVersion@0
    displayName: "Use Python 3.8"
    inputs:
      versionSpec: 3.8

  - pwsh: |
      pip install packaging
    displayName: Prep Environment
  # select the appropriate version from manifest if present
  - task: PythonScript@0
    displayName: 'Check Version Spec Against Known Versions'
    inputs:
     scriptPath: '.azure-pipelines/install_python_version.py'
     arguments: '${{ parameters.versionSpec }} --arch ${{ parameters.architecture }} --installer_folder="../_pyinstaller'

  # use
  - task: UsePythonVersion@0
    displayName: "Use Python $(PythonVersion)"
    inputs:
      versionSpec: ${{ parameters.versionSpec }}
      architecture: ${{ parameters.architecture }}
