Skip to content
Open
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
29 changes: 14 additions & 15 deletions Cargo.lock

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

11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,16 @@ Opsqueue's client libraries and binary itself are also available through `niv`.
2. Package the now available `opsqueue` library as part of your overlay, using e.g.

```nix
opsqueue = self.callPackage (sources.opsqueue + "/libs/opsqueue_python/opsqueue_python.nix") { };
opsqueue_client = self.callPackage (sources.opsqueue + "/libs/opsqueue_python/opsqueue_python.nix") { };
```

- If you want to override which Rust version is used, you can set the `rustToolchain` either in an overlay or by passing it as parameter directly to `callPackage`.
- If you want to override which Python version is used for the Python client, you can set `python` either in an overlay or by passing it as parameter directly to `callPackage`.

For example:

```nix
opsqueue_client = self.callPackage (sources.opsqueue + "/libs/opsqueue_python/opsqueue_python.nix") { python = mySpecialPython; };
```

## For devs modifying Opsqueue: Building, running, testing
Expand Down
6 changes: 3 additions & 3 deletions libs/opsqueue_python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ anyhow = "1.0.86"
thiserror = "1.0.65"

# Python FFI:
pyo3 = { version = "0.23.4", features = ["chrono"] }
pyo3-async-runtimes = { version = "0.23.0", features = ["tokio-runtime", "unstable-streams"] }
pyo3 = { version = "0.25", features = ["chrono"] }
pyo3-async-runtimes = { version = "0.25", features = ["tokio-runtime", "unstable-streams"] }
once_cell = "1.21.3" # Only currently used for `unsync::OnceCell` as part of PyO3 async helpers.

# Logging/tracing:
pyo3-log = "0.12.1"
pyo3-log = "0.12"
tracing = { version = "0.1.41", features = ["log"] }
5 changes: 4 additions & 1 deletion libs/opsqueue_python/opsqueue_python.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
opentelemetry-api,
opentelemetry-exporter-otlp,
opentelemetry-sdk,

# Downstream users can override which precise Python version is used.
# This is opt-in; by default we will use whatever 'python3' is in scope.
python ? (pkgs.python3),
}:
let
python = pkgs.python3;
sources = import ../../nix/sources.nix;
crane = import sources.crane { pkgs = pkgs; };
craneLib = crane.overrideToolchain (pkgs: rustToolchain);
Expand Down
Loading