-
Notifications
You must be signed in to change notification settings - Fork 339
Customizing Python for Munki
Munki 4+ ships with its own Python 3 interpreter, based on a Python.org release, and adding some additional modules to allow calling Apple's Cocoa frameworks. The additional modules are defined in code/tools/py3_requirements.txt in standard pip
requirements format, and are intended to support Munki's own Python needs.
You may find you need additional Python modules to be installed -- especially if you use third-party repo plugins or middleware.
The maintainers of the Munki project want to be slow, cautious, and conservative about what Python modules are included in the "official" Munki distribution, as it puts them on the hook to keep them updated and to answer support questions for modules they may not even use. It's possible, even likely, over time that additional modules will be added to the set in the "official" Munki distribution, but if you need certain modules, you should not (and do not have to) wait for those modules to be included in the Python bundled with Munki 4+.
Additional Python modules can be installed in /usr/local/munki/Python.framework/Versions/3.10/lib/python3.10/site-packages
(note that path will change if Munki's embedded Python moves in the future).
/usr/local/munki/Python.framework/Versions/Current/bin/python3 -m pip install <some_python_module>
would be one way to install modules when developing or testing, though that would not be a good choice for mass-deployment.
For mass-deployment, you could build an Apple installer package that installs the files you need added to the python3.10/site-packages
directory.
You can build a munkitools package yourself containing any modules you want.
You can edit the py3_requirements.txt in code/tools and add your additional modules, then run code/tools/build_python_framework.sh to build that customized framework.
Or you can use https://github.com/gregneagle/relocatable-python directly to build a Python framework containing whatever modules you'd like.
If you decide to build a customized Python framework, you'll need to deploy it. Here are a couple of options.
Once you have your custom Python framework, save/copy it to the root of your Munki code repo. You can then run code/tools/make_munki_mpkg.sh to build a munkitools distribution pkg containing your customized Python. See Building Munki Packages for additional information.
Another deployment alternative would be to use the "official" Munki tools releases, but install the tools with the embedded Python deselected, and instead install your custom Python in its place. Building a package of your custom Python is outside the scope of this documentation. You may find some useful pointers here.
- Getting Started
- Overview
- Discussion Group
- Demonstration Setup
- Glossary
- Frequently Asked Questions
- Contributing to Munki
- Release Notes
- Introduction
- Managed Software Center in Munki 5.2
- Manual Apple Updates
- force_install_after_date for Apple Updates
- Additional update encouragement
- Aggressive update notifications
- AggressiveUpdateNotificationDays preference
- Additional Munki 5 changes
- Configuration profile notes
- Major macOS upgrade notes
- Upgrading to Munki 5
- Introduction
- Munki Links
- Product Icons
- Screenshots In Product Descriptions
- Client Customization
- Custom Help Content
- Featured Items
- Update Notifications:
- Introduction
- iconimporter
- makepkginfo
- munkiimport
- managedsoftwareupdate
- makecatalogs
- manifestutil
- repoclean
- Preferences
- Default Repo Detection
- Default Manifest Resolution
- Managed Preferences Support In Munki
- Apple Software Updates With Munki
- Pkginfo Files
- Supported Pkginfo Keys
- Pre And Postinstall Scripts
- Munki And AutoRemove
- Blocking Applications
- ChoiceChangesXML
- CopyFromDMG
- nopkg items
- How Munki Decides What Needs To Be Installed
- Default Installs
- Removal of Unused Software
- Upgrading macOS:
- Apple Updates:
- Securing the Munki repo
- Preflight And Postflight Scripts
- Report Broken Client
- MSC Logging
- Munki With Git
- Bootstrapping With Munki
- License Seat Tracking
- LaunchD Jobs and Changing When Munki Runs
- Web Request Middleware
- Repo Plugins
- Downgrading Software
- Downgrading Munki tools
- Authorized Restarts
- Allowing Untrusted Packages
- About Munki's Embedded Python
- Customizing Python for Munki
- Configuration Profile Emulation
- PPPC Privacy permissions
- AutoPkg
- Repackaging
- Creating Disk Images
- Stupid Munki Tricks
- Troubleshooting
- Professional Support
- Known Issues and Workarounds
- Building Munki packages
- Munki packages and restarts
- Signing Munki
- Removing Munki
- More Links And Tools
- Munki Configuration Script
- Who's Using Munki
- Munki 3 Information
- Munki 4 Information
- macOS Monterey Info
- Pkginfo For Apple Software Updates
- Managing Configuration Profiles
- Microsoft Office
- Adobe Products
- Upgrading macOS: