Skip to content

Commit

Permalink
Rpickevert "WIP: Test pyenv shell on Windows again"
Browse files Browse the repository at this point in the history
This reverts commit 0e9a702.
  • Loading branch information
nre-ableton committed Jan 30, 2024
1 parent 76bd0fa commit 5837771
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
39 changes: 19 additions & 20 deletions src/com/ableton/Pyenv.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,28 @@ class Pyenv implements Serializable {

VirtualEnv venv = new VirtualEnv(script, randomSeed)
int result
// script.withEnv(["PYENV_VERSION=${pythonVersion}"]) {
List installCommands = ["export PYENV_ROOT=${pyenvRoot}"]
if (script.isUnix()) {
script.withEnv(["PYENV_VERSION=${pythonVersion}"]) {
List installCommands = ["export PYENV_ROOT=${pyenvRoot}"]
if (script.isUnix()) {
installCommands += [
"export PATH=\$PYENV_ROOT/bin:\$PATH",
"eval \"\$(pyenv init --path)\"",
"eval \"\$(pyenv init -)\"",
]
} else {
installCommands.add("export PATH=${pyenvRoot}/shims:${pyenvRoot}/bin:\$PATH")
}
installCommands += [
"export PATH=\$PYENV_ROOT/bin:\$PATH",
"eval \"\$(pyenv init --path)\"",
"eval \"\$(pyenv init -)\"",
"pyenv install --skip-existing ${pythonVersion}",
'pyenv exec pip install virtualenv',
"pyenv exec virtualenv ${venv.venvRootDir}",
]
} else {
installCommands.add("export PATH=${pyenvRoot}/shims:${pyenvRoot}/bin:\$PATH")
result = venv.script.sh(
label: "Install Python version ${pythonVersion} with pyenv",
returnStatus: true,
script: installCommands.join('\n') + '\n',
)
}
installCommands += [
"pyenv install --skip-existing ${pythonVersion}",
"pyenv shell ${pythonVersion}",
'pyenv exec pip install virtualenv',
"pyenv exec virtualenv ${venv.venvRootDir}",
]
result = venv.script.sh(
label: "Install Python version ${pythonVersion} with pyenv",
returnStatus: true,
script: installCommands.join('\n') + '\n',
)
// }

if (result != 0) {
// If we failed to create the virtualenv, test to see if the requested Python
Expand Down
1 change: 0 additions & 1 deletion test/com/ableton/PyenvTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ class PyenvTest extends BasePipelineTest {
}
installCommands += [
"pyenv install --skip-existing ${pythonVersion}",
"pyenv shell ${pythonVersion}",
'pyenv exec pip install virtualenv',
"pyenv exec virtualenv /workspace/.venv/${TEST_RANDOM_NAME}",
]
Expand Down

0 comments on commit 5837771

Please sign in to comment.