-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython-install.sh
68 lines (62 loc) · 2.86 KB
/
python-install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
OS=$(awk -F= '/^NAME/{print $2}' /etc/os-release | tr -d \")
if [ "$OS" = "Alpine Linux" ]; then
apk update
apk add --update --no-cache --virtual .tmp-build-deps \
gcc libc-dev linux-headers postgresql-dev
apk add --no-cache libffi-dev python3 python3-dev py-cryptography \
build-base linux-headers libc6-compat gcc musl-dev postgresql-dev
python3 -m ensurepip
ln -sf python3 /usr/bin/python
ln -sf pip3 /usr/bin/pip
else
echo '
deb https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu focal main
deb-src https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu focal main' >> /etc/apt/sources.list
echo '-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: Hostname:
Version: Hockeypuck ~unreleased
xsFNBFl8fYEBEADQmGZ6pDrwY9iH9DVlwNwTOvOZ7q7lHXPl/TLfMs1tckMc/D9a
hsdBN9VWtMmo+RySvhkIe8X15r65TFs2HE8ft6j2e/4K472pObM1hB+ajiU/wYX2
Syq7DBlNm6YMP5/SyQzRxqis4Ja1uUjW4Q5/Csdf5In8uMzXj5D1P7qOiP2aNa0E
r3w6PXWRTuTihWZOsHv8npyVYDBRR6gEZbd3r86snI/7o8Bfmad3KjbxL7aOdNMw
AqQFaNKl7Y+UJpv1CNFIf+twcOoC0se1SrsVJlAH9HNHM7XGQsPUwpNvQlcmvr+t
1vVS2m72lk3gyShDuJpi1TifGw+DoTqu54U0k+0sZm4pnQVeiizNkefU2UqOoGlt
4oiG9nIhSX04xRlGes3Ya0OjNI5b1xbcYoR+r0c3odI+UCw3VSZtKDX/xlH1o/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7P2
-----END PGP PUBLIC KEY BLOCK-----' >> /tmp/hockeypuck.gpg
apt-key add /tmp/hockeypuck.gpg
apt-get update
apt-get install -y python3.10 python3.10-distutils python3.10-venv
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
ln -sf python3.10 /usr/bin/python
ln -sf python3.10 /usr/bin/python3
fi
python -m pip install --upgrade pip
#install virutal environments tools
curl -skSL https://install.python-poetry.org | python3 -
# Clean up
if [ "$OS" = "Alpine Linux" ]; then
apk del .tmp-build-deps
rm -rf /var/cache/apk/*
else
apt autoremove -y
rm -rf /var/lib/apt/lists/*
fi