From 3bb563a226468dcdd8625d1b278e8c637d4e5753 Mon Sep 17 00:00:00 2001 From: Giorgi Merebashvili Date: Thu, 19 Feb 2026 01:11:25 +0400 Subject: [PATCH 1/3] refactor: Move core to crates --- Cargo.toml | 21 +++---------------- crates/fluxqueue-core/Cargo.toml | 14 +++++++++++++ {src => crates/fluxqueue-core/src}/lib.rs | 0 pyproject.toml | 3 ++- {fluxqueue => python/fluxqueue}/__init__.py | 0 {fluxqueue => python/fluxqueue}/core.py | 0 .../fluxqueue}/fluxqueue_core.pyi | 0 .../fluxqueue}/utils/__init__.py | 0 {fluxqueue => python/fluxqueue}/utils/task.py | 0 9 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 crates/fluxqueue-core/Cargo.toml rename {src => crates/fluxqueue-core/src}/lib.rs (100%) rename {fluxqueue => python/fluxqueue}/__init__.py (100%) rename {fluxqueue => python/fluxqueue}/core.py (100%) rename {fluxqueue => python/fluxqueue}/fluxqueue_core.pyi (100%) rename {fluxqueue => python/fluxqueue}/utils/__init__.py (100%) rename {fluxqueue => python/fluxqueue}/utils/task.py (100%) diff --git a/Cargo.toml b/Cargo.toml index 0335baf..c2ad9d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,27 +1,12 @@ [workspace] -members = ["crates/fluxqueue-common", "crates/fluxqueue-worker"] +members = ["crates/*"] +resolver = "3" [workspace.package] +edition = "2024" repository = "https://github.com/CCXLV/fluxqueue" homepage = "https://fluxqueue.ccxlv.dev" authors = ["Giorgi Merebashvili "] -edition = "2024" - -[package] -name = "fluxqueue_core" -version = "0.2.0" -edition = "2024" - -[lib] -name = "fluxqueue_core" -crate-type = ["cdylib"] - -[dependencies] -pyo3 = { version = "0.27.2", features = ["experimental-async"] } -pyo3-async-runtimes = { version = "0.27.0", features = ["tokio-runtime"] } -tokio = { version = "1.49.0", features = ["rt-multi-thread", "sync"] } -deadpool-redis = { version = "0.22.1", features = ["rt_tokio_1"] } -fluxqueue-common = { path = "./crates/fluxqueue-common" } [workspace.dependencies] fluxqueue-common = { path = "./crates/fluxqueue-common" } diff --git a/crates/fluxqueue-core/Cargo.toml b/crates/fluxqueue-core/Cargo.toml new file mode 100644 index 0000000..e5d09fb --- /dev/null +++ b/crates/fluxqueue-core/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "fluxqueue_core" +version = "0.2.0" +repository.workspace = true +homepage.workspace = true +authors.workspace = true +edition.workspace = true + +[dependencies] +pyo3 = { version = "0.27.2", features = ["experimental-async"] } +pyo3-async-runtimes = { version = "0.27.0", features = ["tokio-runtime"] } +tokio = { version = "1.49.0", features = ["rt-multi-thread", "sync"] } +deadpool-redis = { version = "0.22.1", features = ["rt_tokio_1"] } +fluxqueue-common.workspace = true diff --git a/src/lib.rs b/crates/fluxqueue-core/src/lib.rs similarity index 100% rename from src/lib.rs rename to crates/fluxqueue-core/src/lib.rs diff --git a/pyproject.toml b/pyproject.toml index 71985cd..ae2842c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,8 +55,9 @@ docs = [ build = ["maturin"] [tool.maturin] -python-source = "." module-name = "fluxqueue.fluxqueue_core" +python-source = "python" +manifest-path = "crates/fluxqueue-core/Cargo.toml" [tool.ruff] line-length = 88 diff --git a/fluxqueue/__init__.py b/python/fluxqueue/__init__.py similarity index 100% rename from fluxqueue/__init__.py rename to python/fluxqueue/__init__.py diff --git a/fluxqueue/core.py b/python/fluxqueue/core.py similarity index 100% rename from fluxqueue/core.py rename to python/fluxqueue/core.py diff --git a/fluxqueue/fluxqueue_core.pyi b/python/fluxqueue/fluxqueue_core.pyi similarity index 100% rename from fluxqueue/fluxqueue_core.pyi rename to python/fluxqueue/fluxqueue_core.pyi diff --git a/fluxqueue/utils/__init__.py b/python/fluxqueue/utils/__init__.py similarity index 100% rename from fluxqueue/utils/__init__.py rename to python/fluxqueue/utils/__init__.py diff --git a/fluxqueue/utils/task.py b/python/fluxqueue/utils/task.py similarity index 100% rename from fluxqueue/utils/task.py rename to python/fluxqueue/utils/task.py From 8c721ccccc80a8c083c5eafbba69bc7d3bad796f Mon Sep 17 00:00:00 2001 From: Giorgi Merebashvili Date: Thu, 19 Feb 2026 01:20:42 +0400 Subject: [PATCH 2/3] Fix style error --- .github/actions/tests/action.yml | 8 ++++---- .github/workflows/tests.yml | 4 +++- tests/conftest.py | 6 +----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/actions/tests/action.yml b/.github/actions/tests/action.yml index 8a4b7d6..ec4ee7d 100644 --- a/.github/actions/tests/action.yml +++ b/.github/actions/tests/action.yml @@ -12,13 +12,13 @@ runs: uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} - cache: pip + + - name: Install uv + uses: astral-sh/setup-uv@v7 - name: Install dependencies shell: bash -euxo pipefail {0} - run: | - python -m pip install --upgrade pip - pip install -e .[tests] + run: uv sync --extra tests - name: Set up Rust uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d61144e..381886a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,8 +22,10 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.13" + - name: Install uv + uses: astral-sh/setup-uv@v7 - run: | - pip install -e .[dev] + uv sync --extra dev scripts/check-prettier.sh ruff check . cargo fmt --all -- --check diff --git a/tests/conftest.py b/tests/conftest.py index 0ea0b55..43af84d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,13 +1,9 @@ -import os from dataclasses import dataclass from typing import Annotated import pytest -from redis import Redis - from fluxqueue import FluxQueue - -REDIS_VERSION = os.getenv("REDIS_VERSION") if os.getenv("REDIS_VERSION") else "latest" +from redis import Redis @dataclass From 5b1887d41f50971dfd4deb07245e6a9c31c68a02 Mon Sep 17 00:00:00 2001 From: Giorgi Merebashvili Date: Thu, 19 Feb 2026 01:24:20 +0400 Subject: [PATCH 3/3] Fix tests --- .github/actions/tests/action.yml | 4 ++-- .github/workflows/tests.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/tests/action.yml b/.github/actions/tests/action.yml index ec4ee7d..6e1d14e 100644 --- a/.github/actions/tests/action.yml +++ b/.github/actions/tests/action.yml @@ -12,7 +12,7 @@ runs: uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} - + - name: Install uv uses: astral-sh/setup-uv@v7 @@ -29,5 +29,5 @@ runs: - name: Run Tests shell: bash -euxo pipefail {0} run: | - pytest tests/ + uv run pytest tests/ cargo test --workspace --locked diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 381886a..682c3d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,11 +27,12 @@ jobs: - run: | uv sync --extra dev scripts/check-prettier.sh - ruff check . + uv run ruff check . cargo fmt --all -- --check cargo clippy --workspace -- -D warnings tests: + needs: [check-style] name: ${{ matrix.os }} (Py ${{ matrix.python-version }}) strategy: fail-fast: false