From ee805778c52bcb8c85c3fd539e5179b0169feeca Mon Sep 17 00:00:00 2001 From: Erik Gomez Date: Thu, 9 Jul 2020 11:31:51 -0500 Subject: [PATCH] Move python frameworks into their own Python folder --- README.md | 10 +++++----- build_python_framework_pkgs.zsh | 2 +- example_python_script.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 74fa651..4ea1c12 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,22 @@ # python -A Python 3 framework that currently installs to `/Library/ManagedFrameworks/Python3.framework`. +A Python 3 framework that currently installs to `/Library/ManagedFrameworks/Python/Python3.framework`. Please see Apple's documentation on [file system basics](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html) for more information on the thought process here. This is an intended replacement for when Apple removes `/usr/bin/python` ## Using interactively -After installing any of the packages, a symbolic link can be used within terminal for interactive Python sessions. At the time of this writing `/usr/local/bin/managed_python3` points to `/Library/ManagedFrameworks/Python3.framework/Versions/Current/bin/python3` +After installing any of the packages, a symbolic link can be used within terminal for interactive Python sessions. At the time of this writing `/usr/local/bin/managed_python3` points to `/Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/bin/python3` ## Using with scripts It is currently recommended to point directly to symbolic link provided by the Python framework. -At the time of this writing `/Library/ManagedFrameworks/Python3.framework/Versions/Current/bin/python3` points to `/Library/ManagedFrameworks/Python3.framework/Versions/3.8/bin/python3.8` +At the time of this writing `/Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/bin/python3` points to `/Library/ManagedFrameworks/Python/Python3.framework/Versions/3.8/bin/python3.8` An example script would look like the following: ``` -#!/Library/ManagedFrameworks/Python3.framework/Versions/Current/bin/python3 +#!/Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/bin/python3 print('This is an example script.') ``` @@ -25,7 +25,7 @@ print('This is an example script.') #### zshenv global alias If you are calling `python` within `zsh` scripts, adding a global alias to `/etc/zshenv` may be appropriate. -`alias -g python3.framework='/Library/ManagedFrameworks/Python3.framework/Versions/Current/bin/python3'` +`alias -g python3.framework='/Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/bin/python3'` For more information on this method, please see Armin Briegel's "Moving to Zsh" Part [II](https://scriptingosx.com/2019/06/moving-to-zsh-part-2-configuration-files/) and [IV](https://scriptingosx.com/2019/07/moving-to-zsh-part-4-aliases-and-functions/) diff --git a/build_python_framework_pkgs.zsh b/build_python_framework_pkgs.zsh index 06db509..98dc0df 100755 --- a/build_python_framework_pkgs.zsh +++ b/build_python_framework_pkgs.zsh @@ -9,7 +9,7 @@ RP_SHA="8bce58e91895978da6f238c1d2e1de3559ea4643" MP_SHA="71c57fcfdf43692adcd41fa7305be08f66bae3e5" # Hardcoded paths -FRAMEWORKDIR="/Library/ManagedFrameworks" +FRAMEWORKDIR="/Library/ManagedFrameworks/Python" PYTHON_BIN="$FRAMEWORKDIR/Python3.framework/Versions/Current/bin/python3" RP_BINDIR="/tmp/relocatable-python" MP_BINDIR="/tmp/munki-pkg" diff --git a/example_python_script.py b/example_python_script.py index cac97a5..8bffcfd 100755 --- a/example_python_script.py +++ b/example_python_script.py @@ -1,3 +1,3 @@ -#!/Library/ManagedFrameworks/Python3.framework/Versions/Current/bin/python3 +#!/Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/bin/python3 print('This is an example script.')