view rust/hg-cpython/Cargo.toml @ 43289:8d432d3a2d7c

rust-cpython: prepare for writing tests that require libpython What I wanted is to disable the "cpython/extension-module<ver>" feature while building tests executable, but that seems not doable. Instead, this patch adds new features dedicated for tests. The make rule is extracted so that we can easily run cargo tests. Added a minimal test of ref-sharing as an example. More tests will follow.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 14 Oct 2019 16:15:19 +0900
parents 649a9601b9e2
children 25ed4d8e707f
line wrap: on
line source

[package]
name = "hg-cpython"
version = "0.1.0"
authors = ["Georges Racinet <gracinet@anybox.fr>"]
edition = "2018"

[lib]
name='rusthg'
crate-type = ["cdylib"]

[features]
default = ["python27"]

# Features to build an extension module:
python27 = ["cpython/python27-sys", "cpython/extension-module-2-7"]
python3 = ["cpython/python3-sys", "cpython/extension-module"]

# Enable one of these features to build a test executable linked to libpython:
# e.g. cargo test --no-default-features --features python27-bin
python27-bin = ["cpython/python27-sys"]
python3-bin = ["cpython/python3-sys"]

[dependencies]
hg-core = { path = "../hg-core" }
libc = '*'

[dependencies.cpython]
version = "0.3"
default-features = false