run pip from python

This commit is contained in:
Marc Beninca 2024-08-19 10:11:39 +02:00
parent f990897cad
commit fc5b997288
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 20 additions and 10 deletions

10
spcd.sh
View file

@ -674,16 +674,6 @@ index-url = ${SPCD_URL_PYTHON}
spcd_split
export PATH="${SPCD_PYTHON_VENV_BINARIES}:${PATH}"
export VIRTUAL_ENV="${SPCD_PYTHON_VENV}"
spcd_split
pip install --upgrade "pip"
spcd_split
pip install \
"mypy" \
"pelican" \
"pytest" \
"ruff" \
"sphinx" "sphinx-rtd-theme" \
"twine"
}
spcd_install_python_modules() {

View file

@ -53,6 +53,25 @@ def install_commands(path: str) -> None:
(user / f"{COMMANDS_PREFIX}{command}").symlink_to(path)
def install_python_packages() -> None:
step("Install Python packages")
log.info("pip")
run("pip", "install", "--upgrade", "pip")
split()
packages = [
"mypy",
"pelican",
"pytest",
"ruff",
"sphinx",
"sphinx-rtd-theme",
"twine",
]
for package in packages:
log.info(package)
run("pip", "install", *packages)
def list_environment_variables() -> None:
step("List environment variables")
for variable, value in sorted(projects.environment.items()):
@ -73,6 +92,7 @@ def main(main: str) -> None:
clone_project_branch()
set_ssh()
install_commands(main)
install_python_packages()
else:
function = getattr(cmd, name.replace("-", "_"))
function(*arguments)