Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions synth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ exclude = ["testing_harness/*", "tmp"]
name = "bench"
harness = false

[lib]
name = "synth"
crate-type = ["cdylib", "rlib"]

[features]
default = []
telemetry = ["posthog-rs", "uuid", "backtrace", "console"]
python = ["pyo3"]

[build-dependencies]
git2 = "0.13.20"
Expand Down Expand Up @@ -90,3 +95,6 @@ uriparse = "0.6.3"
querystring = "1.1.0"

csv = "1.1.6"

# Python Dependencies
pyo3 = { version = "0.16.5", features = ["extension-module", "abi3-py37"], optional = true }
16 changes: 16 additions & 0 deletions synth/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[build-system]
requires = ["maturin>=0.13,<0.14"]
build-backend = "maturin"

[project]
name = "getsynthpy"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]

[tool.maturin]
features = ["python"]

18 changes: 18 additions & 0 deletions synth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,21 @@ pub mod datasource;
pub mod sampler;
pub mod utils;
pub mod version;

// Python Code
#[cfg(feature = "python")]
use pyo3::prelude::*;

#[cfg(feature = "python")]
#[pymodule]
fn synth(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_function(wrap_pyfunction!(generate, m)?)?;

Ok(())
}

#[cfg(feature = "py")]
#[pyfunction]
pub fn generate() {
todo!();
}