Skip to content

Commit 600e3ed

Browse files
authored
Merge pull request #8 from midassystems/dev
Updated project name to mbe and added Crate.io publishing.
2 parents 3ff4c83 + b85089b commit 600e3ed

26 files changed

+202
-95
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish Crate.io
2+
3+
on:
4+
workflow_run:
5+
workflows: ['Bump-Version']
6+
types: [completed]
7+
branches:
8+
- 'main'
9+
10+
jobs:
11+
publish_crate:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check out the code
16+
uses: actions/checkout@v3
17+
18+
- name: Install Rust toolchain
19+
uses: dtolnay/rust-toolchain@stable
20+
21+
- name: Cache Cargo dependencies
22+
uses: Swatinem/rust-cache@v2
23+
24+
- name: Publish to Crates.io
25+
working-directory: rust # Adjust if needed
26+
env:
27+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
28+
run: cargo publish --verbose

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
2-
name = "mbn_python"
2+
name = "mbe_python"
33
version = "1.0.0"
44
edition = "2021"
55

66
[lib]
7-
name = "mbn_python"
7+
name = "mbe_python"
88
crate-type = ["cdylib"]
99

1010
[dependencies]
11-
mbn = {path = "../rust" , features =["python"]}
11+
mbe = {path = "../rust" , features =["python"]}
1212
pyo3 = { workspace = true }
1313

1414

python/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Add MBN to your Rust project's `Cargo.toml`:
2525

2626
```toml
2727
[dependencies]
28-
mbn = { git = "https://github.com/midassystems/mbn.git", branch = "main" }
28+
mbe = { git = "https://github.com/midassystems/mbe.git", branch = "main" }
2929
```
3030

3131
### Python Installation
@@ -35,8 +35,8 @@ For Python, MBN must be installed from source:
3535
1. Clone the repository:
3636

3737
```bash
38-
git clone https://github.com/midassystems/mbn.git
39-
cd mbn/mbn_python
38+
git clone https://github.com/midassystems/mbe.git
39+
cd mbe/mbe_python
4040
```
4141

4242
2. Install dependencies:
@@ -55,7 +55,7 @@ For Python, MBN must be installed from source:
5555

5656
4. Navigate to the desired installation location and install the built package:
5757
```bash
58-
cd mbn/mbn_python
58+
cd mbe/mbe_python
5959
pip install dist/*.whl
6060
```
6161

python/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ build-backend = "maturin"
55
[tool.maturin]
66
features = ["pyo3/extension-module"]
77
python-source = "python"
8-
module-name = "mbn._lib" # was python_mbn
8+
module-name = "mbe._lib"
99

1010
[project]
11-
name = "mbn" #was python_mbn
11+
name = "mbe"
1212
version = "1.0.16"
1313
description = "A binary encoding library designed for efficient data storage and transportation in trading platforms."
1414
readme = "README.md"

python/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use mbn::{
1+
use mbe::{
22
backtest::{
33
BacktestData, BacktestMetaData, Parameters, SignalInstructions, Signals, StaticStats,
44
TimeseriesStats, Trades,
@@ -19,13 +19,13 @@ use pyo3::{prelude::*, PyClass};
1919

2020
// ensure a module was specified, otherwise it defaults to builtins
2121
fn checked_add_class<T: PyClass>(m: &Bound<PyModule>) -> PyResult<()> {
22-
assert_eq!(T::MODULE.unwrap(), "mbn");
22+
assert_eq!(T::MODULE.unwrap(), "mbe");
2323
m.add_class::<T>()
2424
}
2525

2626
#[pymodule] // The name of the function must match `lib.name` in `Cargo.toml`
2727
#[pyo3(name = "_lib")]
28-
fn python_mbn(_py: Python<'_>, m: &Bound<PyModule>) -> PyResult<()> {
28+
fn python_mbe(_py: Python<'_>, m: &Bound<PyModule>) -> PyResult<()> {
2929
checked_add_class::<Side>(m)?;
3030
checked_add_class::<Vendors>(m)?;
3131
checked_add_class::<Stype>(m)?;

python/tests/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22
import json
3-
from mbn import (
3+
from mbe import (
44
Side,
55
Action,
66
Schema,

0 commit comments

Comments
 (0)