Skip to content

feat(types)!: expose installed SDK annotations (DXP-537 prerequisite) - #125

Open
jmlago wants to merge 1 commit into
v0.19-devfrom
legatus/dxp-537-typing
Open

jmlago wants to merge 1 commit into
v0.19-devfrom
legatus/dxp-537-typing

Conversation

@jmlago

@jmlago jmlago commented Nov 19, 2026

Copy link
Copy Markdown
Member

Release hold and dependency

Do not merge into the frozen v0.19-dev / 0.19.0 train. Hold until the next development branch exists and retarget there, or until the repository owner explicitly approves inclusion. This is the independently reviewed typing prerequisite requested in #124. The feature PR must not merge before this change is approved and lands on the selected development base.

Change

Ship the PEP 561 py.typed marker explicitly in package data. Installed SDK imports become typed instead of Any, so downstream consumers can see new type-checking errors even when their code still runs. Correct ContractMethod to describe the schema dictionary with inherited parameter fields. Include an unreleased compatibility note and docs/TYPING.md with the package-wide strict audit and known limitations.

This is intentionally independent of the contract generator. PR #124 currently carries identical prerequisite changes for testing; once this prerequisite lands, its diff will disappear from that PR on rebase. Neither PR is authorized to bypass the release freeze.

Validation

  • uv run pytest tests/unit --disable-warnings -q -m "not testnet": 244 passed, 17 deselected.
  • uv build: wheel and sdist built; inspected the wheel ZIP and verified genlayer_py/py.typed is packaged.
  • Python 3.12.12 / mypy 2.4.1 package audit: mypy --python-executable .venv/bin/python --strict --no-incremental genlayer_py reports 373 existing errors across 33 files, checking 55 files. This is not a strict-clean claim. Diagnostic counts, examples, consumer impact and reproduction command are recorded in docs/TYPING.md.
  • git diff --check passes.

Assumptions

  • Package-wide typing enablement deserves its own compatibility/release decision, as requested by the human reviewer, even though the generated-binding feature depends on it.
  • Preserve actual SDK address types rather than suppress missing-typing errors or degrade them to Any.
  • Document existing strict issues instead of expanding this prerequisite into a rewrite of SDK annotations.
  • Keep the current declared active base while the release hold is in effect; retarget only when a new active development branch exists or an owner authorizes inclusion.

Ticket: https://linear.app/genlayer-labs/issue/DXP-537/generate-contract-types-from-schema

@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 76b17b88-756c-47ef-add1-bc663a46117d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@jmlago

jmlago commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

/run-e2e

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally.

@danieljrc888 danieljrc888 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed at fa10255. This is the split I asked for in #124 and the change itself is correct. Requesting changes only to hold the merge: the base is the frozen v0.19-dev, as the PR body itself says, and genlayer-py has no next development branch yet. The owner decides whether this enters 0.19.0.

What I verified

  • py.typed is listed in package-data, so it ships in the wheel, not only in an editable install.
  • ContractMethod as a TypedDict matches how it is used (ContractSchema.methods values are plain dicts from the RPC). The previous plain class was never instantiated in genlayer_py.
  • The ! in the title does not force a major: releaserc.toml has major_on_zero = false.
  • The audit in docs/TYPING.md is honest about the 373 strict errors and does not claim a clean SDK.

To fix before it lands, wherever it lands

  1. CHANGELOG.md is managed by semantic-release in mode = "update" with the <!-- version list --> insertion flag. A hand-written Unreleased section placed right after the flag will end up below the next generated version entry and stay there labelled as unreleased. Drop the manual section; the squash commit message and docs/TYPING.md already carry the note.
  2. docs/TYPING.md mixes durable content (the audit and known limitations) with release-process text ("not approved for the frozen v0.19-dev / 0.19.0 release", "hold it until"). The second kind is false the moment this merges. Keep it in the PR body only.
  3. The audit pins a base SHA and an error count that will drift. Say so in one line, or add the count to CI as a non-blocking report so the document can be checked.

This branch has not been deployed

No deployments
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.

2 participants