Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
devcontainer-features
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eazydevelop-devcontainer-temp
devcontainer-features
Commits
9ec1eacf
Unverified
Commit
9ec1eacf
authored
May 11, 2022
by
Samruddhi Khandale
Committed by
GitHub
May 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python: copying original contents of install.sh (#9)
python: copying orignal
parent
d9c4c137
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
34 deletions
+12
-34
install.sh
collection/python/install.sh
+12
-34
No files found.
collection/python/install.sh
View file @
9ec1eacf
#!/usr/bin/env bash
PYTHON_VERSION
=(
$PYTHON_VERSION
)
# 'system' checks the base image first, else installs 'latest'
PYTHON_INSTALL_PATH
=(
$PYTHON_INSTALL_PATH
)
PYTHON_SETUP_LINKS
=(
$PYTHON_SETUP_LINKS
)
#PYTHON_VERSION=${1:-"latest"} # 'system' checks the base image first, else installs 'latest'
#PYTHON_INSTALL_PATH=${2:-"/usr/local/python"}
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
#
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/python.md
# Maintainer: The VS Code and Codespaces Teams
#
# Syntax: ./python-debian.sh [Python Version] [Python intall path] [PIPX_HOME] [non-root user] [Update rc files flag] [install tools flag] [Use Oryx if available flag] [Optimize when building from source flag]
PYTHON_VERSION
=
${
1
:-
"latest"
}
# 'system' checks the base image first, else installs 'latest'
PYTHON_INSTALL_PATH
=
${
2
:-
"/usr/local/python"
}
export
PIPX_HOME
=
${
3
:-
"/usr/local/py-utils"
}
USERNAME
=
${
4
:-
"automatic"
}
UPDATE_RC
=
${
5
:-
"true"
}
...
...
@@ -341,36 +346,9 @@ for util in ${DEFAULT_UTILS[@]}; do
done
rm
-rf
/tmp/pip-tmp
echo
"(*) Updating RC files."
updaterc
"
$(
cat
<<
EOF
export PIPX_HOME="
${
PIPX_HOME
}
"
export PIPX_BIN_DIR="
${
PIPX_BIN_DIR
}
"
if [[ "\
${
PATH
}
" != *"\
${
PIPX_BIN_DIR
}
"* ]]; then export PATH="\
${
PATH
}
:\
${
PIPX_BIN_DIR
}
"; fi
EOF
)
"
echo
"(*) About to do final Python setup."
INSTALLED_PYTHON_VERSION
=
$(${
PYTHON_INSTALL_PATH
}
/bin/python
--version
2>&1 |
grep
-Po
'(?<=Python )(.+)'
)
if
[[
!
-z
"
$INSTALLED_PYTHON_VERSION
"
]]
;
then
echo
"(*) Installed Python version is
${
INSTALLED_PYTHON_VERSION
}
"
PYTHON_MAJOR_VERSION
=
$(
echo
${
INSTALLED_PYTHON_VERSION
}
|
cut
-f1
-d
'.'
)
PYTHON_MINOR_VERSION
=
$(
echo
${
INSTALLED_PYTHON_VERSION
}
|
cut
-f2
-d
'.'
)
if
[
"
${
PYTHON_SETUP_LINKS
}
"
=
"true"
]
;
then
mkdir
-p
/opt/python
ln
-s
/usr/share/python /opt/python/
${
INSTALLED_PYTHON_VERSION
}
ln
-s
/opt/python/
${
INSTALLED_PYTHON_VERSION
}
/opt/python/
${
PYTHON_MAJOR_VERSION
}
.
${
PYTHON_MINOR_VERSION
}
ln
-s
/opt/python/
${
PYTHON_MAJOR_VERSION
}
.
${
PYTHON_MINOR_VERSION
}
/opt/python/
${
PYTHON_MAJOR_VERSION
}
ln
-s
/opt/python/
${
INSTALLED_PYTHON_VERSION
}
/opt/python/latest
ln
-s
/opt/python/
${
INSTALLED_PYTHON_VERSION
}
/opt/python/stable
mkdir
-p
/home/
${
USERNAME
}
/.python
ln
-s
/opt/python/
${
INSTALLED_PYTHON_VERSION
}
/home/
${
USERNAME
}
/.python/current
fi
else
echo
"(*) Failed to get installed Python version."
fi
echo
"(*) Done with Python feature."
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment