Skip to main content

Create Wheel from CMake projects

Project description

CMake Wheel: cmeel

PyPI version pre-commit.ci status Documentation Status Code style: black Ruff

Wheel build backend using CMake, to package anything with pip and distribute on PyPI.

Following those relevant PEPs:

  • PEP 427, The Wheel Binary Package Format 1.0
  • PEP 517, A build-system independent format for source trees
  • PEP 518, Specifying Minimum Build System Requirements for Python Projects
  • PEP 600, Future ‘manylinux’ Platform Tags for Portable Linux Built Distributions
  • PEP 621, Storing project metadata in pyproject.toml
  • PEP 639, Improving License Clarity with Better Package Metadata, DRAFT
  • PEP 660, Editable installs for pyproject.toml based builds (wheel based)

Chat

https://matrix.to/#/#cmake-wheel:matrix.org

Basic idea

Glue between PEP 517 & 660 entry points and modern CMake standard project configuration / build / test / install

This Install in ${PYTHON_SITELIB}/cmeel.prefix/:

  • As there is a dot, it is not a valid python module name, so no risk of importing anything there by mistake
  • Play well with others, as everything is confined to ${PYTHON_SITELIB}/cmeel.prefix
  • ${PYTHON_SITELIB}/cmeel.pth automatically load ${PYTHON_SITELIB}/cmeel.prefix/${PYTHON_SITELIB}, so python packages work out of the box
  • Existing ${PYTHON_SITELIB}/cmeel.prefix are automatically added to $CMAKE_PREFIX_PATH, so we can build CMake packages whose dependencies are provided by other packages installed with cmeel
  • Stuff in ${PYTHON_SITELIB}/cmeel.prefix/bin is exposed via cmeel.run:cmeel_run

Basic pyproject.toml example

extract from https://github.com/cmake-wheel/cmeel-example/blob/main/pyproject.toml:

[project]
name = "cmeel-example"
version = "0.4.12"
description = "This is an example project, to show how to use cmeel"
requires-python = ">= 3.7"
license = "BSD-2-Clause"
authors = [{name = "Guilhem Saurel", email = "guilhem.saurel@laas.fr"}]

[project.urls]
homepage = "https://github.com/cmake-wheel/cmeel-example"
repository = "https://github.com/cmake-wheel/cmeel-example.git"
changelog = "https://github.com/cmake-wheel/cmeel-example/blob/main/CHANGELOG.md"

[build-system]
requires = ["cmeel[build]"]
build-backend = "cmeel"

Complete specification is available at: https://packaging.python.org/en/latest/specifications/declaring-project-metadata

Install

If you want to use the helpers provided by cmeel, to eg. test building a project in a manylinux container with cmeel docker, the best way to install cmeel is to use pipx: pipx install cmeel

Otherwise, if you just want to use the build backend, there is no need to install anything: your frontent (eg. pip) should do this for you

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmeel-0.50.2.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

cmeel-0.50.2-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file cmeel-0.50.2.tar.gz.

File metadata

  • Download URL: cmeel-0.50.2.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1042-azure

File hashes

Hashes for cmeel-0.50.2.tar.gz
Algorithm Hash digest
SHA256 6e646a9dbef76c865fd3a9a7e667eb8727a28347dd6ef9cfde4ff6cbec2e1d34
MD5 f41fb8a4b582836904764f02fe3744b5
BLAKE2b-256 591decfaf36656e748913c59a93481a9b80e9e5673b76493db2f731eb197900a

See more details on using hashes here.

File details

Details for the file cmeel-0.50.2-py3-none-any.whl.

File metadata

  • Download URL: cmeel-0.50.2-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1042-azure

File hashes

Hashes for cmeel-0.50.2-py3-none-any.whl
Algorithm Hash digest
SHA256 271de85eff8ef17f04e835e7edcbff4ede5188f1c2efaacf29ae35e7f9ec67cd
MD5 0540dfa6c51903f52b69ce74dbd9db99
BLAKE2b-256 c52a7c04c25ea62f838f6ba4cd9689f6f6c63a68df39b1172b3e172824c236be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page