GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Couch9388/python: Framework files for use with popular python macadmin toolsets

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

172 Commits
172 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs/superpowers
docs/superpowers
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build_python_framework_pkgs.zsh
build_python_framework_pkgs.zsh
 
 
example_python_script.py
example_python_script.py
 
 
managed_python_sitecustomize.py
managed_python_sitecustomize.py
 
 
preinstall-cleanup
preinstall-cleanup
 
 
requirements_recommended.txt
requirements_recommended.txt
 
 

Repository files navigation

python

A Python 3 framework that installs to /Library/ManagedFrameworks/Python/Python3.framework.

Please see Apple's documentation on file system basics for context.

This is an intended replacement for /usr/bin/python, which Apple removed in macOS 12.3 (Spring 2022).

Apple Silicon Only

Builds and packages target Apple Silicon (arm64). Universal2 outputs are no longer produced. Build hosts and target machines must be Apple Silicon Macs.

Why use this instead of a package from python.org?

  • Ships with PyObjC and other modules useful for Mac admins, similar in spirit to the Apple Python it replaces
  • Installs to a location less likely to be overwritten, removed, or modified by other Python installations

Using interactively

After installing the package, /usr/local/bin/managed_python3 is a symlink to /Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/Resources/Python.app/Contents/MacOS/Python.

Using with scripts

Point your shebang directly at the symlink:

#!/Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/bin/python3

print('This is an example script.')

zshenv global alias

For zsh scripts you can add a global alias to /etc/zshenv:

alias -g python3.framework='/Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/bin/python3'

See Armin Briegel's "Moving to Zsh" Part II and IV.

Notes

Only a single package may be installed at any given time. The preinstall script removes any previous framework.

Upgrades

Python itself has its own release cadence; this package will see additional updates as 3rd-party libraries release fixes and security updates. Always test your scripts before deploying broadly.

Downgrades

Not supported.

pip

pip is bundled but not recommended for installing external libraries into the framework. Use a virtual environment or a tool like pyenv instead. Pull requests to the recommended requirements file are welcome.

Building locally

Build an unsigned framework on Apple Silicon with:

./build_python_framework_pkgs.zsh --python-version 3.13.13

Pass --installer-id, --application-id, and --notary-password to produce a signed and notarized .pkg.

Updating packages

Do this in a clean virtual environment. After every Python package install, run pip freeze | xargs pip uninstall -y to reset the environment.

CI Job

To update the signing certificate, run base64 -i /path/to/certificate.p12 -o base64string and import it into the GitHub Actions secrets store along with the matching password.

Credits

Built on two open-source tools by Greg Neagle:

  • relocatable-python
  • munki-pkg

About

Framework files for use with popular python macadmin toolsets

Resources

Readme
License
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.