The UFO has landed 🤖
The UFO has landed 🤖
I’ve uploaded PyObjC 5.2 to PyPI with a number of bug fixes and support for the APIs introduced in the macOS SDK included with Xcode 10.2.
Updated metadata for Xcode 10.2
#252: objc.registerStructAlias no longer emits a deprecation warning because it is still used by the framework wrappers.
The function is still deprecated though, the deprecation will reappear once the metadata has been updatd.
#75: The core bridge now uses PyDict_GetItemWithError(), which may result in exceptions being raised that were previously swallowed.
#247: Partially switch to the new buffer API instead of the older Python 2 buffer API. The new implementation is more correct, but may keep Python objects alive longer than the previous implementation, and also affects buffer related functionality of Python objects. In particular, calling [someData bytes] on a Python object keeps the Py_buffer alive until the next flush of the autoreleasepool.
#257: Fix incorrect metadata for the callback argument to -[AVCaptureStillImageOutput captureStillImageAsynchronouslyFromConnection:completionHandler:].
#258: Add bindings to the “PrintCore” APIs from the ApplicationServices framework.
Python 2: UserDict.UserDict instances are now bridged to instances of a subclass of NSDictionary.
I’ve pushed py2app 0.19 to PyPI. The major fix in this release is that the six.moves recipe no longer breaks builds.
Heard today: “GitHub is like Gitlab, but on the internet”. Enterprise IT keeps amazing me.
Debugging through a CI is interesting… But at least the modulegraph2 tests now pass on Windows and Linux thanks to AppVeyor.
Modulegraph is a library for creating a dependency graph between python modules and is the engine used by py2app to determine which python code to include in the generated application bundle.
The library was written a long time ago and was incrementally updated for new Python features. Along the way I’ve also tried to add unittests, but there we’re never terribly good.
At the end of 2018 I started working on a complete rewrite of the modulegraph library, leading to the release of modulegraph 2.0a1 on PyPI today.
Modulegraph2 is a modern Python 3.6 or later code base, designed for easier unittesting and with type annotations. This combined with a helpfull sprinkling of flake8 extensions should make it a lot easier to maintain the library going forward.
It has been a delight to work on this, even if this rewrite took a lot longer than expected. Importlib takes care of a lot of the low-level gruntwork, allowing me to focus on building a usable dependency graph.
Using Python 3.6 and ignoring Python 2 is a much nicer development experience than trying to support older versions. This in the end allows for cleaner code, and faster development. I was also pleasantly surprised by mypy: it took some time to get used to using the tool, but in the end it helped in finding and fixing bugs early in the development cycle. And that’s on a pretty small code base (3.5K lines of python code, including whitespace, comments and docstrings).
The codebase is functionally complete, but has seen light usage at best. The code passes the full testsuite on macOS (with Python 3.6 and 3.7), but hasn’t been tested on other platforms yet. The current version number reflects that the current status: It is a major change from modulegraph, but needs more testing before I’m truly convinced it is ready for a stable release.
The command-line API can create HTML and Graphviz reports of the dependency graph, but these are fairly crude at the moment (although not worse than those created by modulegraph). It should be fairly easy to create more useful reports in the future.
My plan for the near future is to create an (experimental) branch of py2app that uses modulegraph2 instead of modulegraph, to further validate the design and functionality of the modulegraph2 library.
In a longer timeframe I’d like to do a simular rewrite for py2app: rewrite the code base in a testable way for Python 3.6 and later, and also redesign the py2app interface (moving away from a setuptools command as the main interface).
I’ve been working on a clean rewrite of the modulegraph library, more on that later.
While doing that I’ve also been revisiting the graph library used by modulegraph, resulting in a new distribution on PyPI: objectgraph.
This is a Python 3.6+ library for creating basic graphs where nodes can be arbitrary objects with an “identifier” attribute.
The library has full test coverage and Mypy support, but has only seen light usage at this point.
I have uploaded an initial version to PyPI which can be installed using “pip install objectgraph==1.0a0”.
I’ve pushed PyObjC 5.1.2 to PyPI with a number of bug fixes, see the full changelog for more information.