Skip to content

fix: declare worker dependencies + migrate ddtrace v2→v4#148

Draft
zzstoatzz wants to merge 1 commit intoroostorg:mainfrom
zzstoatzz:fix/declare-worker-deps-v2
Draft

fix: declare worker dependencies + migrate ddtrace v2→v4#148
zzstoatzz wants to merge 1 commit intoroostorg:mainfrom
zzstoatzz:fix/declare-worker-deps-v2

Conversation

@zzstoatzz
Copy link
Copy Markdown

@zzstoatzz zzstoatzz commented Feb 25, 2026

Motivation

We're building a plugin that depends on osprey-worker and ran into two issues:

  1. pip install osprey-worker fails — the package only declares flask-cors and osprey_rpc as dependencies. Everything else lives in the root workspace [dependency-groups], so standalone installation outside the monorepo is broken. On Python 3.14, the install pulls 10 packages instead of ~50 and immediately fails on from osprey.engine.udf.base import UDFBase with ModuleNotFoundError: No module named 'typing_inspect'.

  2. ddtrace v2 doesn't build on Python 3.14ddtrace==2.21.11 (and the <3.0.0 cap in override-dependencies) blocks resolution on 3.14 entirely. ddtrace v4 adds 3.14 support but changes several APIs.

Changes

Declare worker dependencies: added the full runtime dependency list to osprey_worker/pyproject.toml (grouped by subsystem) so the package is installable outside the monorepo.

Migrate ddtrace v2 → v4: updated all imports in osprey_worker/src/ — module moves (ddtrace.spanddtrace.trace, Pin relocation), removed APIs (span.sampled), and tightened types (set_tag value narrowed to str | None).

Bump root pins: updated ddtrace (2.21.11 → 4.5.0), envier (0.5.2 → 0.6.1), bytecode (0.16.2 → 0.17.0), and widened override-dependencies to >=4.0.0. These are the minimum transitive dep bumps needed to keep the lockfile consistent — all other pins, workspace config, and [tool.uv.sources] are untouched.

Verification

  • uv sync resolves and installs cleanly on Python 3.11 (no regression from existing setup)
  • standalone pip install osprey-worker succeeds on Python 3.14 with all core engine imports working
  • ruff check, ruff format --check, and mypy pass on all changed files

@zzstoatzz zzstoatzz force-pushed the fix/declare-worker-deps-v2 branch from 89810fe to 57a2daa Compare February 25, 2026 02:18
osprey_worker/pyproject.toml only declared flask-cors and osprey_rpc,
making standalone installation broken — all transitive deps lived only
in the root workspace dependency groups. this adds the full dependency
list (grouped by subsystem) so `pip install osprey-worker` works
outside the monorepo.

ddtrace v2→v4 migration across osprey_worker/src/:
- ddtrace.span.Span → ddtrace.trace.Span
- ddtrace.Span, ddtrace.Tracer → ddtrace.trace.Span, ddtrace.trace.Tracer
- ddtrace.filters.TraceFilter → ddtrace.trace.TraceFilter
- ddtrace.contrib.grpc.constants.GRPC_STATUS_CODE_KEY → inlined string
- ddtrace.Pin → ddtrace._trace.pin.Pin
- span.sampled → span.context.sampling_priority check
- span.set_tag() value args: int/bool/type → str (v4 tightened types)
- dict[str|bytes, str] tag annotations → dict[str, str]

root pyproject.toml: bumps ddtrace pin 2.21.11 → 4.5.0 along with its
transitive deps (envier 0.5.2 → 0.6.1, bytecode 0.16.2 → 0.17.0) and
widens override-dependencies to >=4.0.0. all workspace config, sources,
and other pins are unchanged.

passes: ruff check, ruff format, mypy (on changed files)
@zzstoatzz zzstoatzz force-pushed the fix/declare-worker-deps-v2 branch from 57a2daa to 693d128 Compare February 25, 2026 02:26
{ name = "graphviz" },
{ name = "greenlet" },
{ name = "grpcio", version = "1.49.1", source = { registry = "https://pypi.org/simple" }, marker = "platform_machine == 'x86_64'" },
{ name = "grpcio", version = "1.53.2", source = { registry = "https://pypi.org/simple" }, marker = "platform_machine != 'x86_64'" },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, why is this added twice?

interestingly, grpcio >1.49 is known to effectively "break" osprey in production, which is very scary

i would not be surprised if this compatibility pr also has similar issues, but its hard to say

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from this i think #141

context is that latest uv versions on silicon macs dont work for building osprey with grpicio 1.49, so doing any local dev isnt really possible :/ tho i do agree it probably breaks osprey if u were really trying to use it. maybe there's a better way to fix that tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants