diff --git a/.github/actions/tests/action.yml b/.github/actions/tests/action.yml index 8a4b7d6..6e1d14e 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 @@ -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 d61144e..682c3d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,14 +22,17 @@ 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 . + 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 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 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