From ac3b2102f883e5609163186f1f33c06d0a2e7009 Mon Sep 17 00:00:00 2001 From: Reinier Maas Date: Fri, 17 Jul 2026 13:13:55 +0200 Subject: [PATCH 1/6] Python tooling shouldn't look at `pyproject.toml` outside the repository --- extra/experimentation/shell.nix | 2 +- justfile | 2 +- libs/opsqueue_python/pyproject.toml | 2 +- nix/overlay.nix | 6 ++---- pyproject.toml | 12 ++++++++++++ ruff.toml | 9 +++++++++ 6 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 pyproject.toml create mode 100644 ruff.toml diff --git a/extra/experimentation/shell.nix b/extra/experimentation/shell.nix index 699c1022..168ffcde 100644 --- a/extra/experimentation/shell.nix +++ b/extra/experimentation/shell.nix @@ -1,6 +1,6 @@ { pkgs ? import ./nixpkgs-pinned.nix {} }: pkgs.mkShell rec { - python = pkgs.python311.withPackages (ps: [ + python = pkgs.python3.withPackages (ps: [ ps.fastapi ps.google-cloud-storage ps.httpx diff --git a/justfile b/justfile index 5a5c542c..9612a5d7 100644 --- a/justfile +++ b/justfile @@ -57,7 +57,7 @@ test-integration *TEST_ARGS: build-bin build-python # Python integration test suite, using artefacts built through Nix. Args are forwarded to pytest [group('nix')] -nix-test-integration *TEST_ARGS: nix-build-bin +nix-test-integration *TEST_ARGS: nix-build #!/usr/bin/env bash set -euo pipefail nix_build_python_library_dir=$(just nix-build-python) diff --git a/libs/opsqueue_python/pyproject.toml b/libs/opsqueue_python/pyproject.toml index 88016e62..c30ad39b 100644 --- a/libs/opsqueue_python/pyproject.toml +++ b/libs/opsqueue_python/pyproject.toml @@ -10,7 +10,7 @@ license="MIT" keywords=["queue", "processing", "paralellism", "distributed", "batch", "producer", "consumer"] -requires-python = ">=3.8" +requires-python = ">=3.13" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", diff --git a/nix/overlay.nix b/nix/overlay.nix index f5ff633d..0d3ee1d1 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -15,12 +15,10 @@ let crane = import sources.crane { pkgs = final; }; craneLib = crane.overrideToolchain (pkgs: rustToolchain); - python3 = final.python313.override { packageOverrides = pythonOverlay; }; + python = final.python314.override { packageOverrides = pythonOverlay; }; in { - inherit rustToolchain python3; - python = python3; + inherit rustToolchain python; opsqueue = final.callPackage ../opsqueue/opsqueue.nix { }; - } diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..f15ca35a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,12 @@ +[project] +name = "opsqueue" +description = "Top level python settings to prevent python tooling from looking further up the directory tree for a pyproject.toml" +version = "0.1.0" +readme = "README.md" +requires-python = ">= 3.13" + +[tool.mypy] +strict = true +follow_imports = "normal" +show_error_codes = true +warn_unused_configs = true diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 00000000..fadc41b6 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,9 @@ +line-length = 88 +target-version = "py313" + +[format] +quote-style = "double" +indent-style = "space" +line-ending = "lf" +docstring-code-format = true +docstring-code-line-length = "dynamic" From be69f0a19a9007aee59cf313babac40aeb4e759e Mon Sep 17 00:00:00 2001 From: Reinier Maas Date: Fri, 17 Jul 2026 13:58:09 +0200 Subject: [PATCH 2/6] fixup! Python tooling shouldn't look at `pyproject.toml` outside the repository --- extra/experimentation/shell.nix | 2 +- nix/overlay.nix | 1 + nix/sources.json | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/extra/experimentation/shell.nix b/extra/experimentation/shell.nix index 168ffcde..c83cabaf 100644 --- a/extra/experimentation/shell.nix +++ b/extra/experimentation/shell.nix @@ -1,6 +1,6 @@ { pkgs ? import ./nixpkgs-pinned.nix {} }: pkgs.mkShell rec { - python = pkgs.python3.withPackages (ps: [ + python = pkgs.python.withPackages (ps: [ ps.fastapi ps.google-cloud-storage ps.httpx diff --git a/nix/overlay.nix b/nix/overlay.nix index 0d3ee1d1..2bc61019 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -19,6 +19,7 @@ let in { inherit rustToolchain python; + python3 = python; opsqueue = final.callPackage ../opsqueue/opsqueue.nix { }; } diff --git a/nix/sources.json b/nix/sources.json index 87f67126..b734ea33 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -17,10 +17,10 @@ "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6308c3b21396534d8aaeac46179c14c439a89b8a", - "sha256": "14qnx22pkl9v4r0lxnnz18f4ybxj8cv18hyf1klzap98hckg58y4", + "rev": "567a49d1913ce81ac6e9582e3553dd90a955875f", + "sha256": "1vq77hlx8mi3z03pw2nf6r5h7473r1p9yxyf58ym3fh01zppmfln", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/6308c3b21396534d8aaeac46179c14c439a89b8a.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/567a49d1913ce81ac6e9582e3553dd90a955875f.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "rust-overlay": { From 4846f8412fafde55b2af447ce58defa85472efa3 Mon Sep 17 00:00:00 2001 From: Reinier Maas Date: Fri, 17 Jul 2026 16:19:49 +0200 Subject: [PATCH 3/6] fixup! fixup! Python tooling shouldn't look at `pyproject.toml` outside the repository --- libs/opsqueue_python/pyproject.toml | 2 +- nix/overlay.nix | 6 +++--- pyproject.toml | 2 +- ruff.toml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/opsqueue_python/pyproject.toml b/libs/opsqueue_python/pyproject.toml index c30ad39b..3fcae63f 100644 --- a/libs/opsqueue_python/pyproject.toml +++ b/libs/opsqueue_python/pyproject.toml @@ -10,7 +10,7 @@ license="MIT" keywords=["queue", "processing", "paralellism", "distributed", "batch", "producer", "consumer"] -requires-python = ">=3.13" +requires-python = ">=3.14" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", diff --git a/nix/overlay.nix b/nix/overlay.nix index 2bc61019..70ea2e2f 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -15,11 +15,11 @@ let crane = import sources.crane { pkgs = final; }; craneLib = crane.overrideToolchain (pkgs: rustToolchain); - python = final.python314.override { packageOverrides = pythonOverlay; }; + python3 = final.python314.override { packageOverrides = pythonOverlay; }; in { - inherit rustToolchain python; - python3 = python; + inherit rustToolchain python3; + python = python3; opsqueue = final.callPackage ../opsqueue/opsqueue.nix { }; } diff --git a/pyproject.toml b/pyproject.toml index f15ca35a..bace3854 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "opsqueue" description = "Top level python settings to prevent python tooling from looking further up the directory tree for a pyproject.toml" version = "0.1.0" readme = "README.md" -requires-python = ">= 3.13" +requires-python = ">= 3.14" [tool.mypy] strict = true diff --git a/ruff.toml b/ruff.toml index fadc41b6..d46d3dae 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,5 +1,5 @@ line-length = 88 -target-version = "py313" +target-version = "py314" [format] quote-style = "double" From 5a52d30a6458c1fd4506db505aaa88636438f8de Mon Sep 17 00:00:00 2001 From: Reinier Maas Date: Fri, 17 Jul 2026 22:49:58 +0200 Subject: [PATCH 4/6] fixup! fixup! fixup! Python tooling shouldn't look at `pyproject.toml` outside the repository --- extra/experimentation/shell.nix | 2 +- libs/opsqueue_python/pyproject.toml | 2 +- nix/overlay.nix | 2 +- pyproject.toml | 2 +- ruff.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/experimentation/shell.nix b/extra/experimentation/shell.nix index c83cabaf..5d5672b3 100644 --- a/extra/experimentation/shell.nix +++ b/extra/experimentation/shell.nix @@ -1,6 +1,6 @@ { pkgs ? import ./nixpkgs-pinned.nix {} }: pkgs.mkShell rec { - python = pkgs.python.withPackages (ps: [ + python = pkgs.python313.withPackages (ps: [ ps.fastapi ps.google-cloud-storage ps.httpx diff --git a/libs/opsqueue_python/pyproject.toml b/libs/opsqueue_python/pyproject.toml index 3fcae63f..c30ad39b 100644 --- a/libs/opsqueue_python/pyproject.toml +++ b/libs/opsqueue_python/pyproject.toml @@ -10,7 +10,7 @@ license="MIT" keywords=["queue", "processing", "paralellism", "distributed", "batch", "producer", "consumer"] -requires-python = ">=3.14" +requires-python = ">=3.13" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", diff --git a/nix/overlay.nix b/nix/overlay.nix index 70ea2e2f..c2109b43 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -15,7 +15,7 @@ let crane = import sources.crane { pkgs = final; }; craneLib = crane.overrideToolchain (pkgs: rustToolchain); - python3 = final.python314.override { packageOverrides = pythonOverlay; }; + python3 = final.python313.override { packageOverrides = pythonOverlay; }; in { inherit rustToolchain python3; diff --git a/pyproject.toml b/pyproject.toml index bace3854..f15ca35a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "opsqueue" description = "Top level python settings to prevent python tooling from looking further up the directory tree for a pyproject.toml" version = "0.1.0" readme = "README.md" -requires-python = ">= 3.14" +requires-python = ">= 3.13" [tool.mypy] strict = true diff --git a/ruff.toml b/ruff.toml index d46d3dae..fadc41b6 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,5 +1,5 @@ line-length = 88 -target-version = "py314" +target-version = "py313" [format] quote-style = "double" From 7f162cb3bd171f3244f76bf250d2ac64fa693675 Mon Sep 17 00:00:00 2001 From: Reinier Maas Date: Fri, 17 Jul 2026 22:53:05 +0200 Subject: [PATCH 5/6] fixup! fixup! fixup! fixup! Python tooling shouldn't look at `pyproject.toml` outside the repository --- nix/util.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nix/util.nix b/nix/util.nix index fd17252b..83112923 100644 --- a/nix/util.nix +++ b/nix/util.nix @@ -1,6 +1,5 @@ # Utility functions to use in nix code -{ lib }: -{ +{ lib }: { # A powerful way of filtering the right files for the src attribute of a derivation. fileFilter = { From c9d08e0208fecfe82608d0fd700b8553dae04a82 Mon Sep 17 00:00:00 2001 From: Reinier Maas Date: Fri, 17 Jul 2026 22:56:26 +0200 Subject: [PATCH 6/6] fixup! fixup! fixup! fixup! fixup! Python tooling shouldn't look at `pyproject.toml` outside the repository --- libs/opsqueue_python/examples/tracing/tracing_producer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/opsqueue_python/examples/tracing/tracing_producer.py b/libs/opsqueue_python/examples/tracing/tracing_producer.py index 24f0f136..967c23ec 100644 --- a/libs/opsqueue_python/examples/tracing/tracing_producer.py +++ b/libs/opsqueue_python/examples/tracing/tracing_producer.py @@ -1,12 +1,12 @@ import logging import typing -import opentelemetry import opentelemetry.context from opentelemetry.context import Context import contextlib from typing import Optional, Generator from opentelemetry import trace +from opentelemetry import baggage as otel_baggage from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import ( BatchSpanProcessor, @@ -66,7 +66,7 @@ def added_baggage( if baggage: for key, value in baggage.items(): - attached_token = opentelemetry.baggage.set_baggage(key, value, context) + attached_token = otel_baggage.set_baggage(key, value, context) attached_context_tokens.append( typing.cast(Context, opentelemetry.context.attach(attached_token)) )