Skip to main content

A conan plugin for scikit-build-core

Project description

scikit-build-core-conan

CI PyPI version Python versions License

A Conan plugin for scikit-build-core that simplifies building Python extensions with C/C++ dependencies managed by Conan.

Why use this? Instead of manually configuring Conan and CMake toolchains, this plugin handles dependency resolution, build configuration, and CMake integration automatically - all configured through your pyproject.toml.

Features

  • Seamless Conan 2.x integration with scikit-build-core's modern Python build system
  • Local recipe support for consuming in-development Conan packages
  • Lockfile support for reproducible builds across environments
  • Full configuration via pyproject.toml - no separate Conan commands needed

Quick Start

Add scikit-build-core-conan to your build-system.requires and specify scikit_build_core_conan.build as your build backend. You do not need to include scikit-build-core separately - it is required automatically.

[build-system]
requires = ["scikit-build-core-conan"]
build-backend = "scikit_build_core_conan.build"

[project]
name = "my_project"
version = "0.0.1"

With this configuration, the plugin will:

  1. Look for a conanfile.py or conanfile.txt in your project root
  2. Install dependencies using Conan (building from source if needed)
  3. Configure CMake with the appropriate toolchain
  4. Build your Python extension

Configuration

All options can be placed in pyproject.toml under [tool.scikit-build-core-conan], or passed via -C/--config-setting in build or -C/--config-settings in pip.

[tool.scikit-build-core-conan]
# Path to a folder containing a recipe (conanfile.py or conanfile.txt)
path = "."

# Specify which packages to build from source. Possible values: "never", "missing", "cascade", ["pattern", ...]
build = "missing"
# Generators to use
generator = ""
# The root output folder for generated and build files
output-folder = ""
# Deploy using the provided deployer to the output folder. Built-in deployers: full_deploy, direct_deploy, runtime_deploy
deployer = []
# Deployer output folder, base build folder by default if not set
deployer-folder = ""
# Execute the deploy() method of the packages matching the provided patterns
deployer-package = []

# Look in the specified remote or remotes server
remote = []
# Do not use remote, resolve exclusively in the cache
no-remote = false
# Will install newer versions and/or revisions in the local cache
update = false

# Apply the specified profile to the host context
profile = ""
# Apply the specified profile to the build context
profile-build = ""
# Apply the specified profile to both contexts at once
profile-all = ""
# Apply the specified options to the host context. Example: ["pkg/*:with_qt=True"]
options = []
# Apply the specified options to the build context
options-build = []
# Apply the specified options to both contexts at once
options-all = []
# Apply the specified settings to the host context. Example: ["compiler=gcc"]
settings = []
# Apply the specified settings to the build context
settings-build = []
# Apply the specified settings to both contexts at once
settings-all = []
# Apply the specified conf to the host context. Example: ["tools.cmake.cmaketoolchain:generator=Xcode"]
config = []
# Apply the specified conf to the build context
config-build = []
# Apply the specified conf to both contexts at once
config-all = []

# Provide a package name if not specified in conanfile
name = ""
# Provide a package version if not specified in conanfile
version = ""
# Provide a user if not specified in conanfile
user = ""
# Provide a channel if not specified in conanfile
channel = ""

# Path to a lockfile. Use "" to avoid automatic use of existing conan.lock file
lockfile = ""
# Do not raise an error if some dependency is not found in lockfile
lockfile-partial = false
# Filename of the updated lockfile
lockfile-out = ""
# Remove unused entries from the lockfile
lockfile-clean = false

Local Recipes

Sometimes you may want to consume a local recipe rather than from the Conan Center Index. You can do this like this:

[[tool.scikit-build-core-conan.local-recipes]]
path = "path/to/recipe"
name = "recipe"   # optional: package name if not specified in conanfile
version = "0.0.1" # optional: package version if not specified in conanfile

Overrides

scikit-build-core-conan uses the same override system as scikit-build-core. For more details, check out the documentation of scikit-build-core.

For example:

[[tool.scikit-build-core-conan.overrides]]
if.platform-system = "linux"
profile = "path/to/profile"

Projects Using This Build Backend

  • endstone: A high-level plugin API for Minecraft: Bedrock Edition Dedicated Servers.

Using scikit-build-core-conan in your project? Feel free to open a PR to add it here!

Roadmap

This project will be renamed to scikit-build-conan upon the 1.0 stable release.

Links

Project details


Download files

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

Source Distribution

scikit_build_core_conan-0.9.2.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scikit_build_core_conan-0.9.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file scikit_build_core_conan-0.9.2.tar.gz.

File metadata

  • Download URL: scikit_build_core_conan-0.9.2.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scikit_build_core_conan-0.9.2.tar.gz
Algorithm Hash digest
SHA256 d83fb43a83da462f869d03585dcc345c951c38546088a1513f00952321333908
MD5 10ea08b3fe86e85b882d91c2160c2a35
BLAKE2b-256 a8868b24173fc6da67039c29e766a22f92b78fecdade7f513e8cb83030a0d7db

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_build_core_conan-0.9.2.tar.gz:

Publisher: release.yml on wu-vincent/scikit-build-core-conan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_build_core_conan-0.9.2-py3-none-any.whl.

File metadata

File hashes

Hashes for scikit_build_core_conan-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5567b1b054c2c4a9f275f636ba93e53d44e01acac6c3bf51c0c0625144292ceb
MD5 c69d36a485d24ac4e0b8ac31ddea5e1b
BLAKE2b-256 6ae1e492f536178ad65f992850abf5bd5970c8bb65c5ab33007944c8e4611ec1

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_build_core_conan-0.9.2-py3-none-any.whl:

Publisher: release.yml on wu-vincent/scikit-build-core-conan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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