Skip to content

Commit e901b89

Browse files
authored
refactor: Move core to crates (#111)
* refactor: Move core to crates * Fix style error * Fix tests
1 parent 04548c1 commit e901b89

12 files changed

Lines changed: 30 additions & 31 deletions

File tree

.github/actions/tests/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ runs:
1212
uses: actions/setup-python@v5
1313
with:
1414
python-version: ${{ inputs.python-version }}
15-
cache: pip
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v7
1618

1719
- name: Install dependencies
1820
shell: bash -euxo pipefail {0}
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install -e .[tests]
21+
run: uv sync --extra tests
2222

2323
- name: Set up Rust
2424
uses: dtolnay/rust-toolchain@stable
@@ -29,5 +29,5 @@ runs:
2929
- name: Run Tests
3030
shell: bash -euxo pipefail {0}
3131
run: |
32-
pytest tests/
32+
uv run pytest tests/
3333
cargo test --workspace --locked

.github/workflows/tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ jobs:
2222
- uses: actions/setup-python@v5
2323
with:
2424
python-version: "3.13"
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v7
2527
- run: |
26-
pip install -e .[dev]
28+
uv sync --extra dev
2729
scripts/check-prettier.sh
28-
ruff check .
30+
uv run ruff check .
2931
cargo fmt --all -- --check
3032
cargo clippy --workspace -- -D warnings
3133
3234
tests:
35+
needs: [check-style]
3336
name: ${{ matrix.os }} (Py ${{ matrix.python-version }})
3437
strategy:
3538
fail-fast: false

Cargo.toml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
11
[workspace]
2-
members = ["crates/fluxqueue-common", "crates/fluxqueue-worker"]
2+
members = ["crates/*"]
3+
resolver = "3"
34

45
[workspace.package]
6+
edition = "2024"
57
repository = "https://github.com/CCXLV/fluxqueue"
68
homepage = "https://fluxqueue.ccxlv.dev"
79
authors = ["Giorgi Merebashvili <mereba2627@gmail.com>"]
8-
edition = "2024"
9-
10-
[package]
11-
name = "fluxqueue_core"
12-
version = "0.2.0"
13-
edition = "2024"
14-
15-
[lib]
16-
name = "fluxqueue_core"
17-
crate-type = ["cdylib"]
18-
19-
[dependencies]
20-
pyo3 = { version = "0.27.2", features = ["experimental-async"] }
21-
pyo3-async-runtimes = { version = "0.27.0", features = ["tokio-runtime"] }
22-
tokio = { version = "1.49.0", features = ["rt-multi-thread", "sync"] }
23-
deadpool-redis = { version = "0.22.1", features = ["rt_tokio_1"] }
24-
fluxqueue-common = { path = "./crates/fluxqueue-common" }
2510

2611
[workspace.dependencies]
2712
fluxqueue-common = { path = "./crates/fluxqueue-common" }

crates/fluxqueue-core/Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "fluxqueue_core"
3+
version = "0.2.0"
4+
repository.workspace = true
5+
homepage.workspace = true
6+
authors.workspace = true
7+
edition.workspace = true
8+
9+
[dependencies]
10+
pyo3 = { version = "0.27.2", features = ["experimental-async"] }
11+
pyo3-async-runtimes = { version = "0.27.0", features = ["tokio-runtime"] }
12+
tokio = { version = "1.49.0", features = ["rt-multi-thread", "sync"] }
13+
deadpool-redis = { version = "0.22.1", features = ["rt_tokio_1"] }
14+
fluxqueue-common.workspace = true

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ docs = [
5555
build = ["maturin"]
5656

5757
[tool.maturin]
58-
python-source = "."
5958
module-name = "fluxqueue.fluxqueue_core"
59+
python-source = "python"
60+
manifest-path = "crates/fluxqueue-core/Cargo.toml"
6061

6162
[tool.ruff]
6263
line-length = 88

0 commit comments

Comments
 (0)