Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat][CI] Building system of farsante #19

Merged
merged 2 commits into from
Mar 10, 2024
Merged
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
19 changes: 19 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build release

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Maturin build
uses: PyO3/maturin-action@v1
with:
command: build
args: --release

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ __pycache__/
.pytest_cache/

*.csv
**/target
**/target

.env
.venv
22 changes: 11 additions & 11 deletions h2o-data-rust/Cargo.lock → Cargo.lock

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

4 changes: 2 additions & 2 deletions h2o-data-rust/Cargo.toml → Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "h2o_data_rust"
name = "farsante"
version = "0.1.0"
edition = "2021"

[lib]
name = "h2o"
name = "farsante"
crate-type = ["cdylib"]

[dependencies]
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.PHONY: install_dev
install_dev:
maturin develop --extras=test

14 changes: 0 additions & 14 deletions h2o-data-rust/README.md

This file was deleted.

348 changes: 0 additions & 348 deletions poetry.lock

This file was deleted.

37 changes: 20 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
[tool.poetry]
[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"

[project]
name = "farsante"
version = "0.2.0"
description = "Fake DataFrame generators for Pandas and PySpark"
authors = ["MrPowers <[email protected]>"]

[tool.poetry.dependencies]
python = ">=3.8 <4.0"
mimesis = "6.0.0"
pyspark = "^3.3.1"
pandas = ">=1.0.0"
pyarrow = "11.0.0"
maturin = "^1.3.2"
authors = [{ name = "MrPowers", email = "[email protected]" }]
requires-python = ">=3.8,<4.0"
dependencies = [
"mimesis == 6.0.0",
"pyspark >= 3.3",
"pandas >=1.0.0",
"pyarrow >= 11.0.0",
"maturin >= 1.3.2",
]

[tool.poetry.dev-dependencies]
pytest = "7.2.0"

[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"
# requires = ["poetry>=0.12"]
[project.optional-dependencies]
test = ["pytest >= 7.2"]

[tool.maturin]
# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
features = ["pyo3/extension-module"]
python-source = "python"
python-packages = ["farsante"]
module-name = "farsante_rs"
bindings = "pyo3"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from h2o import generate_csv_py
from concurrent.futures import ProcessPoolExecutor
from itertools import repeat

from farsante_rs import generate_csv_py


def pretty_sci(n: int) -> str:
if n == 0:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from farsante import generate_all_h2o_datasets
import argparse

from farsante import generate_all_h2o_datasets


def main():
parser = argparse.ArgumentParser(description="Generate all h2o datasets")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions h2o-data-rust/src/lib.rs → src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fn hello_rust() -> () {
}

#[pymodule]
#[pyo3(name = "farsante_rs")]
fn h2o(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_function(wrap_pyfunction!(generate_csv_py, m)?)?;
m.add_function(wrap_pyfunction!(hello_rust, m)?)?;
Expand Down
File renamed without changes.