[skip ci] fix python pip/pip3 installation

This commit is contained in:
ansgarz 2022-01-04 20:27:45 +01:00
parent f676d0329b
commit 3c7a1baa8c
2 changed files with 11 additions and 6 deletions

View file

@ -14,25 +14,25 @@ fun Prov.installPython() = def {
} }
fun Prov.installPython3(): ProvResult = def { fun Prov.installPython3(): ProvResult = def {
aptInstall("python3.8-venv") aptInstall("python3.8-venv python3-pip")
} }
fun Prov.installVenv(): ProvResult = def { fun Prov.installVenv(): ProvResult = def {
val venvHome = "~/.python/meissa" val venvHome = "~/.python/meissa"
cmd("python3 -m venv " + venvHome) cmd("python3 -m venv " + venvHome)
cmd("source " + venvHome + "/bin/activate") cmd("source " + venvHome + "/bin/activate")
cmd("pip install pip --upgrade") cmd("pip3 install pip --upgrade")
} }
fun Prov.installPybuilder(): ProvResult = def { fun Prov.installPybuilder(): ProvResult = def {
cmd("pip install pybuilder ddadevops pypandoc mockito coverage unittest-xml-reporting deprecation python_terraform " + cmd("pip3 install pybuilder ddadevops pypandoc mockito coverage unittest-xml-reporting deprecation python_terraform " +
"boto3") "boto3")
} }
fun Prov.installRestClient(): ProvResult = def { fun Prov.installRestClient(): ProvResult = def {
cmd("pip install requests") cmd("pip3 install requests")
} }
fun Prov.installJupyterlab(): ProvResult = def { fun Prov.installJupyterlab(): ProvResult = def {
cmd("pip install jupyterlab pandas matplotlib") cmd("pip3 install jupyterlab pandas matplotlib")
} }

View file

@ -2,6 +2,7 @@ package org.domaindrivenarchitecture.provs.workplace.infrastructure
import org.domaindrivenarchitecture.provs.test.defaultTestContainer import org.domaindrivenarchitecture.provs.test.defaultTestContainer
import org.domaindrivenarchitecture.provs.test.tags.ContainerTest import org.domaindrivenarchitecture.provs.test.tags.ContainerTest
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test import org.junit.jupiter.api.Test
internal class PythonKtTest { internal class PythonKtTest {
@ -9,6 +10,10 @@ internal class PythonKtTest {
@Test @Test
@ContainerTest @ContainerTest
fun installPython() { fun installPython() {
defaultTestContainer().installPython() // when
val res = defaultTestContainer().installPython()
// then
assertTrue(res.success)
} }
} }