| 1 |
# cffi-pure |
| 2 |
|
| 3 |
A package for testing a crate with cffi bindings with maturin. |
| 4 |
|
| 5 |
Read the [cffi guide](https://cffi.readthedocs.io/en/latest/index.html) to learn how to use the generated `ffi` and `lib` objects. |
| 6 |
|
| 7 |
## Usage |
| 8 |
|
| 9 |
```bash |
| 10 |
pip install . |
| 11 |
``` |
| 12 |
|
| 13 |
```python |
| 14 |
import cffi_pure |
| 15 |
|
| 16 |
point = cffi_pure.lib.get_origin() |
| 17 |
point.x = 10 |
| 18 |
point.y = 10 |
| 19 |
assert cffi_pure.lib.is_in_range(point, 15) |
| 20 |
``` |
| 21 |
|
| 22 |
## Testing |
| 23 |
|
| 24 |
Install tox: |
| 25 |
|
| 26 |
```bash |
| 27 |
pip install tox |
| 28 |
``` |
| 29 |
|
| 30 |
Run it: |
| 31 |
|
| 32 |
```bash |
| 33 |
tox |
| 34 |
``` |
| 35 |
|
| 36 |
The tests are in `test_cffi_pure.py`, while the configuration is in tox.ini |