Compare commits

...

8 commits

Author SHA1 Message Date
0ad80b2761
pip/pelican,ruff,sphinx
Some checks failed
/ job (push) Failing after 5m27s
2024-08-06 19:52:01 +02:00
dd457b9a85
mv venv 2024-08-06 19:48:08 +02:00
42f2cf73c5
upgrade pip 2024-08-06 19:46:27 +02:00
a9c8f13068
venv/create,activate 2024-08-06 19:45:22 +02:00
e770a6e721
readme/create 2024-08-06 19:30:16 +02:00
4ce608c7f8
configure pip 2024-08-06 19:29:24 +02:00
124200a5ad
readme/pip 2024-08-06 17:01:38 +02:00
17c9b919aa
install venv if necessary 2024-08-06 15:51:26 +02:00
2 changed files with 27 additions and 5 deletions

View file

@ -56,6 +56,7 @@ from various contexts of CA, CI and OCI / OS.
| SPCD_URL_DEBIAN | Debian repository URL | https://deb.debian.org |
| SPCD_URL_EPEL | EPEL repository URL | https://dl.fedoraproject.org |
| SPCD_URL_FEDORA | Fedora repository URL | https://rpmfind.net |
| SPCD_URL_PYTHON | Python repository URL | https://pypi.org/project |
| SPCD_URL_ROCKY | Rocky repository URL | https://dl.rockylinux.org |
| SPCD_URL_UBUNTU | Ubuntu repository URL | https://ubuntu.mirrors.ovh.net |
@ -83,11 +84,6 @@ from various contexts of CA, CI and OCI / OS.
* define templates
* actions
* includes
* handle python virtual environment
* install venv if necessary
* upgrade pip
* install packages
* ruff
* relay environment module name
* write tests

26
spcd.sh
View file

@ -7,6 +7,7 @@
[ -n "${SPCD_DNS_1}" ] || SPCD_DNS_1="9.9.9.9"
[ -n "${SPCD_GIT_MAIN}" ] || SPCD_GIT_MAIN="spcd"
[ -n "${SPCD_GIT_ROOT}" ] || SPCD_GIT_ROOT="rwx"
[ -n "${SPCD_URL_PYTHON}" ] || SPCD_URL_PYTHON="https://pypi.org/project"
# main
spcd_main() {
@ -690,6 +691,31 @@ spcd_install_packages() {
"${SPCD_PM_PACMAN}") spcd_install_package "openssh" ;;
*) ;;
esac
# venv
spcd_step "Install Python virtual environment"
case "${SPCD_OS_ID}" in
"${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
spcd_install_package "python3-venv"
;;
# FIXME arch
*) ;;
esac
spcd_split
spcd_write "/etc/pip.conf" "\
[global]
index-url = ${SPCD_URL_PYTHON}
"
spcd_split
spcd_ip__venv="/opt/venv"
"${SPCD_PYTHON_ALIAS}" -m "venv" "${spcd_ip__venv}"
. "${spcd_ip__venv}/bin/activate"
spcd_split
pip install --upgrade "pip"
spcd_split
pip install \
"pelican" \
"ruff" \
"sphinx"
}
spcd_install_python_modules() {