Replies: 2 comments 2 replies
-
There's a high level answer to this; and then specific implementations of that answer. The PEP essentially covers the high level answer. iOS will not allow any executable binary artefacts in the app bundle; all library content must be distributed as Frameworks, one framework per binary. How you access those frameworks is then up to your app - you can explicitly load the filename with How this works in practice depends on exactly which version of Python you're using. As of Python 3.13.0b1 (which will be released any day now), CPython includes support for dynamic framework modules, by installing a custom Briefcase doesn't currently support Python 3.13. The code that has landed in Python 3.13 is deeply inspired by what Briefcase uses, but it has gone through some revisions as a result of being landed upstream. Fundamentally, the concepts are the same, but the Briefcase versions of Python 3.8-3.12 use a Metapath loader (which is a more complex interaction, and has some other complications and edge cases), and doesn't use the Before 3.13 is finalised, we're planning to back port the 3.13 accepted code back to the 3.9-3.12 branches (3.8 will be EOL when 3.13 is released), so that there is complete parity between all the implementations. This will be a backwards incompatible change - but it's a change that will ultimately result in an ecosystem that is easier to maintain. In practical terms:
Beyond that, dynamic loading is a straightforward |
Beta Was this translation helpful? Give feedback.
-
Thanks, this is helpful! Would probbaly be good to cover some of this in the docs, at least a small paragraph on how to provide your own binary wheels - as far as I can see, they just need to be named correctly and copied into the appropriate folder so that the xcode template can move them automatically. I'm now geting |
Beta Was this translation helpful? Give feedback.
-
Hi, from reading https://peps.python.org/pep-0730/, I know that iOS is quite particular when it comes to loading dynamic libraries at runtime. I can't really find any documentation on how Briefcase handles these kinds of files. I can see that the prebuilt wheels (like numpy) come with *.dylib files, but I'm very curious about what happens within the Briefcase machinery.
Particularly, I would like to bundle in my own Python wheel that contains a *.dylib but I can't find a way to hook into Briefcase
Beta Was this translation helpful? Give feedback.
All reactions