Apple announced the deprecation of Python 2 with the release of macOS 10.15 Catalina in 2019, however MacAdmins have never known when it would actually be removed. The general expectation was with macOS 13 due out later this year, but Apple surprised us when it published the macOS Monterey 12.3 Beta Release Notes last week.
Open source projects have been planning for this eventuality, with many having already completed the transition to Python 3 by shipping their own version or using clever code to locate an appropriate version already installed.
MunkiReport is no exception, development of version 6 is well underway, but is not ready yet. Thanks to the quick work by a number of talented contributors to the project, an update to version 5 has been released to bridge the gap until MR6 with Python 3 is ready.
However there is a major change admins will need to account for, so read on for the details.
After Apple’s announcement in the 12.3 beta release notes, discussion amongst the project contributors quickly determined that completing version 6 and the full conversion to Python 3 by next month would require too many rushed decisions. Consensus was reached that providing a copy of Python 2 would be a simpler, although temporary, solution for the version 5 branch until version 6 is ready later this year.
The current plan for version 6 is still to require admins to provide their own Python 3, either through Munki’s included version or MacAdmins Python for example. This will be a major change for MunkiReport which has always used macOS’s included Python.
In my opinion a breaking change like this is logical with a major version upgrade, when admins are likely to proceed more cautiously, but could lead to a lot of confusion in a point update.
The release of MunkiReport 5.7.0 tries to straddle that line. It does require a separate install of Python but developers have tried to make it easy for admins by compiling, packaging and providing a specific version that is ready to deploy. Per Olofsson took the lead on this effort with many others helping along the way.
To upgrade your fleet from a previous version to 5.7.0 follow these steps:
- Download MunkiReport-Python2 from GitHub and deploy it to your fleet. This step can be completed before you upgrade your MunkiReport server.
- If you use Munki to deploy MunkiReport, the simplest way to achieve this step is to import MunkiReportPython2-2.7.18.pkg into your Munki repo and then configure your MunkiReport client installer package to REQUIRE MunkiReportPython2. This will ensure that MunkiReportPython2 is immediately installed on all existing clients and that it will be installed before MunkiReport on any new clients going forward.
- Follow the General Upgrade Procedures to update your MunkiReport server as you always have in the past.
- Update any third-party modules that have been revised to utilize the new MunkiReport Python shebang. (Not all modules use Python or require an update.)
- Update any of your own custom modules that utilize Python 2 to use the new shebang: #!/usr/local/munkireport/munkireport-python2
- Generate a new client installer package and deploy it to your fleet.
Updating MunkiReport to 5.7.0 is required before your users update their Macs to macOS 12.3 when it is released sometime next month. After that macOS update, older versions of MunkiReport will fail to check-in.
If you need any help please join us in the #munkireport channel on the MacAdmins Slack.