From 025c0e5e8530ee1f53d2a45cd1d1de437cc2e819 Mon Sep 17 00:00:00 2001 From: Matan Kushner Date: Fri, 19 Jul 2019 15:56:36 -0400 Subject: [PATCH] ci: Use Python v3.6.9 in CI (#101) --- ci/setup-test-env.yml | 22 +++++++++++++++++++++- tests/Dockerfile | 2 +- tests/testsuite/python.rs | 8 ++++---- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ci/setup-test-env.yml b/ci/setup-test-env.yml index c2c54b07..80a031c1 100644 --- a/ci/setup-test-env.yml +++ b/ci/setup-test-env.yml @@ -9,8 +9,28 @@ steps: inputs: versionSpec: "1.10" displayName: "Install a fixed version of Go" + + # Because the Pipelines agent updates are out of sync, we can't install 3.6.9 + # with PythonTool on macOS + # Install Python - task: UsePythonVersion@0 inputs: - versionSpec: "3.6.8" + versionSpec: "3.6.9" + displayName: "Install a fixed version of Python" + condition: not(eq(variables['Agent.OS'], 'Darwin')) + # Install Python (macOS) + - script: | + echo "##vso[task.setvariable variable=PYTHON_VERSION;]3.6.9" + echo "##vso[task.setvariable variable=PYENV_ROOT;]$HOME/.pyenv" + condition: eq(variables['Agent.OS'], 'Darwin') + - script: | + curl https://pyenv.run | bash + echo "##vso[task.setvariable variable=PATH;]$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH" + condition: eq(variables['Agent.OS'], 'Darwin') + - script: | + eval "$(pyenv init -)" + pyenv install $PYTHON_VERSION + pyenv global $PYTHON_VERSION + condition: eq(variables['Agent.OS'], 'Darwin') displayName: "Install a fixed version of Python" diff --git a/tests/Dockerfile b/tests/Dockerfile index 45576f69..03c23030 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -28,7 +28,7 @@ RUN git clone https://github.com/syndbg/goenv.git $GOENV_ROOT \ RUN go version # Install Python -ENV PYTHON_VERSION 3.6.8 +ENV PYTHON_VERSION 3.6.9 ENV PYENV_ROOT /home/nonroot/.pyenv ENV PATH $PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH RUN curl https://pyenv.run | bash \ diff --git a/tests/testsuite/python.rs b/tests/testsuite/python.rs index 7a68a916..bc47c53a 100644 --- a/tests/testsuite/python.rs +++ b/tests/testsuite/python.rs @@ -16,7 +16,7 @@ fn folder_with_python_version() -> io::Result<()> { .output()?; let actual = String::from_utf8(output.stdout).unwrap(); - let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.6.8")); + let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.6.9")); assert_eq!(expected, actual); Ok(()) } @@ -33,7 +33,7 @@ fn folder_with_requirements_txt() -> io::Result<()> { .output()?; let actual = String::from_utf8(output.stdout).unwrap(); - let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.6.8")); + let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.6.9")); assert_eq!(expected, actual); Ok(()) } @@ -50,7 +50,7 @@ fn folder_with_pyproject_toml() -> io::Result<()> { .output()?; let actual = String::from_utf8(output.stdout).unwrap(); - let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.6.8")); + let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.6.9")); assert_eq!(expected, actual); Ok(()) } @@ -67,7 +67,7 @@ fn folder_with_py_file() -> io::Result<()> { .output()?; let actual = String::from_utf8(output.stdout).unwrap(); - let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.6.8")); + let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.6.9")); assert_eq!(expected, actual); Ok(()) }