Example for developing C extension on Poetry
This repository show example spam module (in official document) and simple math module.
- Clone this repository.
- If you use VSCode, use Remote-Containers extension, and Reopen in Container.
- Otherwise, install
poetry
by running in a terminal:
pip install poetry
- To install the module in the poetry environment, run:
poetry install
- If you want to install the module system-wide, you could run:
poetry build
pip install dist/spam*whl
Run:
poetry run pytest -s
Run a Python interpreter:
poetry run python
Then, run the following commands:
from spam.math import add
assert add(3, 2) == 5