Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UsePythonVersionV0] Fix duplicate lib and update localization #17979

Merged
merged 6 commits into from
Mar 24, 2023

Conversation

vmapetr
Copy link
Contributor

@vmapetr vmapetr commented Mar 20, 2023

Task name: UsePythonVersionV0

Description: This PR updates task localization and bumps the dependency version to fix CI checks for duplicate libs.

azure-pipelines-tasks-utility-common ^3.0.3 >> ^3.219.1

azure-pipelines-tasks-utility-common is used to log UsePythonVersionV0 task telemetry, PR doesn't include potential breaking changes for customers.

Documentation changes required: (Y/N) N

Added unit tests: (Y/N) N

How it was tested:

  • Unit tests for Node10 & Node16 passed successfully on local machine
  • Task executed successfully on Node10 & Node16 for Windows / Ubuntu / macOS with the following steps:
    - task: UsePythonVersion@0
      displayName: 'Do not append PATH'
      name: 'Test1'
      inputs:
        versionSpec: '3.8.x'
        addToPath: false
        architecture: 'x64'

    - bash: |
        if grep -q "Python/3.8" <<< "$PATH"; then
            echo 'A value was added to PATH but should not have to'
            exit 1
        else
            echo 'PATH was not appended. Test passed'
        fi
      displayName: 'Check that PATH was not appended'

    - pwsh: |
        if (Test-Path "$(Test1.pythonLocation)") {
            Write-Host 'Python location has been set'
        } else {
          throw 'Python location has not been set'
        }
        echo 'pythonLocation=$(Test1.pythonLocation)'

        $pattern = 'Python/3.8'
        if ($env:OS -like '*Windows*') {
          $pattern = 'Python\3.8'
        }

        if ('$(Test1.pythonLocation)' -like "*$pattern*") {
          Write-Host 'Python location is OK'
        } else {
          throw 'Python location is wrong'
        }
      displayName: 'Test output variable'

    - task: UsePythonVersion@0
      displayName: 'Append PATH'
      name: 'Test2'
      inputs:
        versionSpec: '3.8.x'

    - bash: |
        if ! grep -q "Python/3.8" <<< "$PATH";
        then
            echo 'PATH has not been appended'
            exit 1
        else
            echo 'PATH has been appended'
        fi
      displayName: 'Test appending PATH'

Checklist:

  • Task version was bumped - please check instruction how to do it
  • Checked that applied changes work as expected

@vmapetr vmapetr marked this pull request as ready for review March 20, 2023 18:39
@vmapetr vmapetr requested a review from a team as a code owner March 20, 2023 18:39
@vmapetr vmapetr merged commit 02f51d8 into master Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants