File: select-python.sh

package info (click to toggle)
ecmwflibs 2%3A0.6.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 388 kB
  • sloc: python: 720; sh: 536; cpp: 30; ansic: 16; makefile: 10
file content (23 lines) | stat: -rwxr-xr-x 619 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -xe
version=$1

brew install python@$1

echo /opt/homebrew/opt/python@$version/libexec/bin >> $GITHUB_PATH

ls -l /opt/homebrew/opt/python@$version/libexec/bin

# Looks like python3 is not a symlink to python in 3.11

if [[ ! -f /opt/homebrew/opt/python@$version/libexec/bin/python3 ]]
then
    ln -s /opt/homebrew/opt/python@$version/libexec/bin/python /opt/homebrew/opt/python@$version/libexec/bin/python3
fi

if [[ ! -f /opt/homebrew/opt/python@$version/libexec/bin/pip3 ]]
then
    ln -s /opt/homebrew/opt/python@$version/libexec/bin/pip /opt/homebrew/opt/python@$version/libexec/bin/pip3
fi

ls -l