Skip to main content

scikit_build_example

Gitter

CI status
conda.recipe Conda Actions Status
pip builds Pip Actions Status

An example project built with pybind11 and scikit-build-core. Python 3.7+ (see older commits for older versions of Python using scikit-build (classic)).

Installation

  • Clone this repository
  • pip install ./scikit_build_example

Test call

import scikit_build_example

scikit_build_example.add(1, 2)

Files

This example has several files that are a good idea, but aren't strictly necessary. The necessary files are:

  • pyproject.toml: The Python project file
  • CMakeLists.txt: The CMake configuration file
  • src/main.cpp: The source file for the C++ build
  • src/scikit_build_example/__init__.py: The Python portion of the module. The root of the module needs to be <package_name>, src/<package_name>, or python/<package_name> to be auto-discovered.

These files are also expected and highly recommended:

  • .gitignore: Git's ignore list, also used by scikit-build-core to select files for the SDist
  • README.md: The source for the PyPI description
  • LICENSE: The license file

There are also several completely optional directories:

  • .github: configuration for Dependabot and GitHub Actions
  • conda.recipe: Example recipe. Normally you should submit projects to conda-forge instead of building them yourself, but this is useful for testing the example.
  • docs/: Documentation
  • tests/: Tests go here

And some optional files:

  • .pre-commit-config.yaml: Configuration for the fantastic static-check runner pre-commit.
  • noxfile.py: Configuration for the nox task runner, which helps make setup easier for contributors.

This is a simplified version of the recommendations in the Scientific-Python Development Guide, which is a highly recommended read for anyone interested in Python package development (Scientific or not). The guide also has a cookiecutter that includes scikit-build-core and pybind11 as a backend choice.

CI Examples

There are examples for CI in .github/workflows. A simple way to produces binary "wheels" for all platforms is illustrated in the "wheels.yml" file, using cibuildwheel.

License

pybind11 is provided under a BSD-style license that can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.

Metadata

Release files for PyBindTest 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyBindTest 0.0.2
File Size Uploaded
pybindtest-0.0.2.tar.gz 256.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyBindTest 0.0.2
File Interpreter ABI Platform
pybindtest-0.0.2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details

Total release size: 312.7 kB

Release files / pybindtest-0.0.2.tar.gz

Download URL pybindtest-0.0.2.tar.gz
Size 256.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e81aa84d5dd67c6f5f335df1b20bff77f4c723a474c8d2c4520e231b4204d797
BLAKE2b-256 checksum
How to use checksums
201a85389a2a6ae6389178b15c12ad603cda99b1a5d606bfcb20dbabf27c127d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.1

Release files / pybindtest-0.0.2-cp311-cp311-win_amd64.whl

Download URL pybindtest-0.0.2-cp311-cp311-win_amd64.whl
Size 56.7 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
b78ce34c22802840cf8f27113bc90eb97e4b500753d1e6188ab0fcfbbfcdf0a8
BLAKE2b-256 checksum
How to use checksums
231e950af030f4e3ca76d1f2db5cfafa041c5ddc97e0b46013499f9eb8f3cbde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.1

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page