Skip to content

xmake-io/xmake-python

Repository files navigation

xmake Python build system (PEP 517)

A python build system based on xmake to output sdist/wheel file respecting PEP517.

  • install xmake from PYPI when it cannot be searched in $PATH
  • provide some path (like scikit-build-core's SKBUILD_PLATLIB_DIR) to install python binary module (XXX.cpython-313-x86_64-linux-gnu.so)

Usage

pyproject.toml:

[build-system]
requires = ["xmake-python"]
build-backend = "xmake_python"

example

Introduction

different from other languages, python build system is consist of two parts:

Frontends

  • build: python -m build
  • uv: uv build

In charge of:

  • install build-system.requires
  • call build-system.build-backend's build_wheel() and build_sdist().

Backends

Refer some python build system backends

Backend can install optional requires. For example, scikit-build-core will install cmake and ninja only when cmake and ninja are not found in $PATH.

We project to provide two python packages. One is a wheel for xmake, like cmake and ninja. Another is a python build system backend, which will install xmake wheel when xmake is not found in $PATH.