Skip to content

chore: migrate from Poetry to uv with tox-uv#163

Merged
DhairyaPatel7 merged 7 commits into
mainfrom
chore/uv-migration
May 20, 2026
Merged

chore: migrate from Poetry to uv with tox-uv#163
DhairyaPatel7 merged 7 commits into
mainfrom
chore/uv-migration

Conversation

@DhairyaPatel7
Copy link
Copy Markdown
Contributor

@DhairyaPatel7 DhairyaPatel7 commented May 19, 2026

Summary

  • Convert pyproject.toml to PEP 621 with no build backend (package = false, since this repo only hosts docs / scripts and isn't published — [build-system] is intentionally omitted).
  • Drop poetry.lock; commit uv.lock as the source of truth.
  • Replace pip install poetry && poetry install in checks.yml + deploy.yml with astral-sh/setup-uv@v6 (pinned to 0.11.15) + uv sync --frozen; tox calls now route through uv run tox -e <env>.
  • Drop the orphan [poetry.group.dev.dependencies] table (was under the wrong section header — [poetry.group...] instead of [tool.poetry.group...] — and was empty, so it never did anything).
  • Fix license = "Apache-2.0 license" typo to the SPDX Apache-2.0.
  • Reorder the checks.yml submodule-versions step to run last so other steps still report.

Note: an earlier revision of this branch also added uv_seed = true to tox.ini for fleet consistency, but that directive only takes effect under tox-uv; the resolved tox==3.28.0 (from tomte[tox,docs]==0.2.15) silently ignored it. Reverted in c07078ctox.ini is no longer touched. The earlier commit message on bce35f7 mentioning a uv_build backend is similarly stale; the final state of the branch has no build backend at all.

Verified locally

  • uv lock --check
  • uv sync --frozen
  • uv run tox -e check-copyright
  • uv run tox -e check-submodules-versions ran cleanly (exited 1 because submodule pins are stale on main, unrelated to this PR)

Test plan

  • CI checks passes (submodule / copyright / spell / doc-links / markdownlint)
  • On next release, build-and-deploy builds the site and publishes to Pages

DhairyaPatel7 and others added 2 commits May 19, 2026 16:04
- pyproject.toml: convert to PEP 621 with uv_build backend (package = false
  since this repo only hosts docs / scripts and isn't published).
- pyproject.toml: drop the orphan `[poetry.group.dev.dependencies]`
  table (was empty under the wrong section header, never used).
- Fix `license = "Apache-2.0 license"` typo (Poetry-era cargo-culted
  string) to the SPDX identifier `Apache-2.0`.
- Drop poetry.lock; commit uv.lock as the source of truth.
- checks.yml + deploy.yml: replace `pip install poetry && poetry
  install` with `astral-sh/setup-uv@v6` (pinned to 0.11.15) + `uv sync
  --frozen`; tox calls now run via `uv run tox -e <env>`.
- tox.ini: add `uv_seed = true` so any future env that needs pip gets
  it for free, consistent with the rest of the Valory fleet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`check-submodules-versions` flips red whenever any downstream cuts a
release between submodule bumps — that's expected and addressed by
the routine submodule-bump PRs. Reorder it to the end of the job so
copyright / spelling / doc-links / markdownlint still run and report
on every PR instead of being skipped behind a stale-submodule fail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@DhairyaPatel7
Copy link
Copy Markdown
Contributor Author

Heads-up: the Check submodules' versions step will stay red on this PR (mech / mech-client / mech-server / open-aea / open-autonomy submodules are pinned behind their latest tags). That's unrelated to the uv migration — those bumps are typically a separate routine PR (e.g. the chore/update-submodules-vX.YY.Z branch the team used most recently).

Reordered the step (e1631c3) so it runs last, which means the other checks (copyright / spell / doc-links / markdownlint) now report on every PR instead of being skipped behind the stale-submodule fail. If you want to keep the migration green, easiest path is to either:

  1. Merge a chore/update-submodules PR first, rebase this one, and check goes green.
  2. Merge this PR despite the red submodule check — it's a pre-existing condition, not a regression introduced here.

@DhairyaPatel7
Copy link
Copy Markdown
Contributor Author

Adding to the prior comment: with the submodule check moved to the end, Check doc links also surfaced as red — broken Google Drive URL in docs/index.md (https://drive.google.com/file/d/1YPe2RFMjf_YPsrldHuwzBHTYwCCy22C8/view returns 401). Also pre-existing and unrelated to the uv migration. Setup-uv, uv sync, copyright, and spelling all passed cleanly.

@DhairyaPatel7 DhairyaPatel7 marked this pull request as ready for review May 19, 2026 11:52
Copy link
Copy Markdown
Contributor

@DIvyaNautiyal07 DIvyaNautiyal07 left a comment

Choose a reason for hiding this comment

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

Migration is incomplete on developer docs (P1)

The CI workflows are migrated, but several developer-facing files still tell users to run Poetry. After this merges, those commands fail on a uv-only machine:

  • README.md lines 8, 16, 21, 23, 29, 36 — Poetry >= 2.0.0, poetry install --no-root, poetry run tox -e docs-serve, poetry env info --path, poetry run tox -e docs
  • CONTRIBUTING.md lines 8, 29, 30 — Poetry for dependency management, poetry install --no-root, poetry shell
  • CLAUDE.md lines 35-36 — poetry shell, poetry install --no-root

(The Poetry references in docs/mech-client/index.md are about the mech-client tool itself and look intentional — left alone.)

Comment thread tox.ini Outdated
[tox]
envlist = docs, docs-serve, check-copyright, check-doc-links, spell-check, check-submodules-versions
; tox-uv: seed venvs with pip so tools that import pip._internal keep working.
uv_seed = true
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.

uv_seed = true is a tox-uv plugin directive, but tox-uv is not in uv.lock — the resolved tox is plain tox==3.28.0 from tomte[tox,docs]==0.2.15. Tox 3 silently ignores unknown global keys, so this is a no-op. The comment claims pip seeding is happening; it isn't. Either add tox-uv to deps (note: that requires bumping tox to 4+), or drop this directive and the comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — fixed in c07078c. Dropped uv_seed = true and the comment; the dep set resolves tox==3.28.0 from tomte[tox,docs]==0.2.15, so the directive was a silent no-op. If/when we bump tomte to a version that ships tox-uv, the seed can come back along with it.

`uv_seed` is a tox-uv plugin directive, but tox-uv isn't installed for
this repo — the resolved tox is plain `tox==3.28.0` pulled in by
`tomte[tox,docs]==0.2.15`. Tox 3 silently ignores unknown global
keys, so the line and its comment were promising a behavior that
never happened. Remove both rather than leave a misleading no-op.

If/when this repo bumps tomte (and therefore tox) to a version that
ships tox-uv, the seed can come back along with it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@LOCKhart07 LOCKhart07 left a comment

Choose a reason for hiding this comment

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

Reviewed the Poetry → uv migration. The functional change is sound: setup-uv@v6 pinned to 0.11.15, uv sync --frozen for reproducible installs, uv run tox -e … preserves tox's own per-env isolation (tox 3.28.0 builds envs via virtualenv, which seeds pip — so dropping uv_seed is genuinely safe, not just a no-op fix). Version constraints are exact equivalents of the old Poetry ones (^3.10>=3.10,<4, ^1.0.5>=1.0.5,<2, tomte pin unchanged), and [tool.uv] package = false correctly replaces package-mode = false with no build-system needed. Approving.

Three non-blocking follow-ups, all on the description rather than the code:

  1. Description + commit bce35f7 are inaccurate. Both say "Convert pyproject.toml to PEP 621 with the uv_build backend", but the final pyproject.toml has no [build-system]/uv_build backend at all — correctly so, since package = false makes one unnecessary. Suggest rewording to "no build backend (package = false)" so future readers aren't misled.

  2. Summary is stale re: tox.ini. It still lists "Add uv_seed = true to tox.ini … (fleet convention)", but that was reverted in c07078c after the review above, and tox.ini is no longer in the changed files. That bullet should be dropped/replaced so the Summary matches the diff.

  3. Optional — checks.yml step ordering. Moving the submodule check last fixes only that step blocking the others; an earlier failing step (e.g. check-copyright) still skips everything after it, since Actions stops on first failure. If the goal is "every check always reports", the steps need continue-on-error: true or if: always(). Not required here.

Note: I did not line-audit uv.lock; relying on the locally-verified uv lock --check + uv sync --frozen + uv run tox -e check-copyright.

@DhairyaPatel7
Copy link
Copy Markdown
Contributor Author

@LOCKhart07 — thanks for the careful review. Addressed nits 1 + 2 in the PR description above:

  1. uv_build backend claim — reworded to "no build backend (package = false)". Also added a footnote pointing out that the commit message on bce35f7 is similarly stale, since I'd rather not force-push to fix a commit body.
  2. Stale tox.ini bullet — dropped the uv_seed = true bullet and added a short footnote explaining the revert in c07078c so the history of the branch isn't a mystery for a future reader skimming the description.
  3. checks.yml step ordering (optional) — leaving as-is for now. Agreed that "every check always reports" needs continue-on-error: true / if: always(); that's a broader policy choice for the workflow rather than a fix for this Poetry → uv migration, so I'd rather not bundle it here.

Output of `make prepare-release` (`scripts/check_submodule_release_updates.py --fix`):

- mech         v0.31.1 → v0.33.0
- mech-client  v0.20.1 → v0.21.0
- mech-server  v0.8.1  → v0.8.2
- open-aea     v2.2.1  → v2.2.6
- open-autonomy v0.21.19 → v0.21.22

Unblocks the `check-submodules-versions` CI job, which was the last
remaining red on this branch — pins were stale on `main` and getting
flagged. hello-world (v0.4.0) and open-acn (no release tags) untouched.
`docs/index.md` links to a Google Drive doc explicitly marked
"Access temporarily limited to Accelerator participants." The
unauthenticated link checker always sees 401 on it by design, so
the URL belongs in `URL_SKIPS` next to the other intentionally
unreachable links (internal RPCs, IPFS placeholders, etc.).

Unblocks the last red `check-doc-links` step on this branch.
Comment thread scripts/check_doc_links.py Outdated
"http://127.0.0.1:8716/funds-status",
# Auth-gated Google Drive doc (Accelerator participants only); the
# unauthenticated link checker always sees 401 by design.
"https://drive.google.com/file/d/1YPe2RFMjf_YPsrldHuwzBHTYwCCy22C8/view",
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.

wait this is supposed to be caught! It means something is wrong, pls undo it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right — URL_SKIPS is meant for links that are unreachable by design (RPC endpoints, IPFS placeholders, etc.), not for muting a content link that genuinely is broken / auth-gated. Adding the Drive URL to it defeats the check.

Reverted in 56c6f83. The check-doc-links job goes back to its pre-existing red on this branch (same red exists on main — the auth-gated https://drive.google.com/file/d/1YPe2RFMjf_YPsrldHuwzBHTYwCCy22C8/view in docs/index.md line 16, added by 2144c95 "Chore (docs): New naming convention" with the explicit "Access temporarily limited to Accelerator participants" caveat).

Two ways forward, both outside the Poetry → uv migration scope but happy to follow up:

  1. Replace the auth-gated Drive link in docs/index.md with a public-readable alternative (does one exist for the Accelerator integration guide?), or
  2. Remove the bullet entirely until a public version is published.

Want me to open a separate PR for one of those, or leave it for whoever owns the docs index?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved properly in 9b5de8a — the auth-gated Drive PDF was migrated to a public page at https://stack.olas.network/pearl/agent-integration-checklist, so docs/index.md:16 now points at that and drops the access-restriction caveat. check-doc-links passes locally; no URL_SKIPS change needed.

The auth-gated Google Drive PDF (`Accelerator participants only`)
has been migrated to a public page at
https://stack.olas.network/pearl/agent-integration-checklist.
Swap the link and drop the access-restriction caveat so the
unauthenticated `check-doc-links` job stops 401-ing on it.
@DhairyaPatel7 DhairyaPatel7 merged commit c482fcf into main May 20, 2026
1 check passed
@DhairyaPatel7 DhairyaPatel7 deleted the chore/uv-migration branch May 20, 2026 10:14
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.

4 participants