Skip to content

thisisthepy/pmm-toolchain

Repository files navigation

toolchain

Build Version Downloads

Description

Toolchain for compiling Python & Other Libraries for Python Multiplatform

A lot of thanks to the contribution of the Kivy team to python build system, this toolchain can work. The python package build operations on Android and iOS work using the Kivy team's tools as they are. In addition to that, I would like to thank the people who produced the libraries that this tool depends on.

The toolchain supports:

** Because Xcode only runs on macOS, you need macOS to build macOS and iOS side packages.

Template ToDo list

This Fancy IntelliJ Platform Plugin is going to be your implementation of the brilliant ideas that you have.

This specific section is a source for the plugin.xml file which will be extracted by the Gradle during the build process.

To keep everything working, do not remove <!-- ... --> sections.


Installation

While describing the installation process of this toolchain, I'm going to suppose that you are using the PMM Application Project Template.

Then, the project directory seems like below.

  - project
      - app
          - src
          - build.gradle.kts
          - proguard-rules.pro
      - gradle
      - build.gradle.kts
      - gradle.properties
      - gradlew
      - gradlew.bat
      - settings.gradle.kts
      - ...

Using python 3.9 version or above as a project management tool is recommended. Whatever version you use, it has nothing related to the version of python that being built by this tool.

Please create the project management environment at the project root directory. Pip packages that your python application uses will not be installed in this .venv folder.

  cd project
  python3 -m venv build
  . build/bin/activate

Install this toolchain using the following command. (You can change the python version at the end of the git url)

  pip3 install git+https://github.com/thisisthepy/toolchain.git@python3.11

And set python build target version and target os system.

  toolchain_targetver 3.11.8
  toolchain_targetos host android ios

Additionally, you would need a few system dependencies and configuration when you are on macOS.

  • Xcode 13 or above, with an iOS SDK and command line tools installed:

    xcode-select --install
    
  • Using brew, you can install the following dependencies:

    brew install autoconf automake libtool pkg-config
    brew link libtool
    

  • Using the IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for "toolchain" > Install

  • Using JetBrains Marketplace:

    Go to JetBrains Marketplace and install it by clicking the Install to ... button in case your IDE is running.

    You can also download the latest release from JetBrains Marketplace and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...

  • Manually:

    Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...


Usage

Then, start the compilation with: (python3 and openssl will be built automatically with this)

$ toolchain init

You can build recipes at the same time by adding them as parameters:

$ toolchain build kivy numpy

Recipe builds can be removed via:

$ toolchain clean kivy

or specify a target platform with:

$ toolchain android build kivy numpy
$ toolchain ios build kivy numpy
$ toolchain android clean kivy
$ toolchain ios clean kivy

You can install/uninstall packages that don't require compilation with pip:

$ toolchain pip install plyer
$ toolchain pip uninstall plyer

or specify a target platform with:

$ toolchain android pip install plyer
$ toolchain ios pip install plyer
$ toolchain host pip install plyer

Available Packages Compilation Recipes:

Please reference the recipe documentation of each platform's toolchain


Plugin based on the IntelliJ Platform Plugin Template.

About

Python Multiplatform Build Tool with Kotlin Multiplatform Mobile

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published