-
Notifications
You must be signed in to change notification settings - Fork 3
Modernize Development Tooling #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Replace Poetry with UV for faster, modern Python dependency management - Add comprehensive justfile with 20+ development commands - Update CI to use UV with caching and matrix testing on Python 3.10-3.13 - Migrate pyproject.toml to PEP 621 standard format - Add Towncrier for changelog management with fragments system - Update VS Code configuration to use basedpyright and Just extension - Add comprehensive CLAUDE.md development guide - Simplify Nix flake to focus on development shell - Update README with UV-based setup instructions - Remove legacy Poetry files and workflows 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Rename CI job from build-test to check-code for clarity - Add explicit Python setup step for better version control - Replace just commands with direct uv calls for consistency - Update Nix workflow trigger to include test-ci branch - Reorganize justfile commands and add new check command - Set Python version support to 3.10-3.12 range - Update dependencies via uv.lock refresh Note: PyO3 does not support CPython 3.13 as of now
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughSwitches project tooling from Poetry/Make to UV/Just/Hatchling, updates Nix flake and editor configs, restructures CI to a unified “Check Code” workflow, removes legacy workflows and Makefile, adds Towncrier docs and fragments, adjusts ignores, and adds a new CLI test for treasury-address. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant GH as GitHub
participant Runner as Ubicloud Runner
Dev->>GH: Push / PR / Dispatch
GH->>Runner: Start "Check Code" workflow (matrix py310, py312)
Runner->>Runner: Checkout repo
Runner->>Runner: Setup Python (actions/setup-python)
Runner->>Runner: Setup uv (astral-sh/setup-uv)
Runner->>Runner: uv sync --frozen
Runner->>Runner: uv run ruff check / format --check
Runner->>Runner: uv run basedpyright ./src
Runner->>Runner: uv run pytest (with coverage)
Runner->>GH: Upload coverage.xml artifact
Runner->>Runner: uv build
Runner-->>GH: Job status per matrix
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes the development toolchain by migrating from Poetry to UV for dependency management, introduces comprehensive testing infrastructure, and streamlines CI/CD workflows while maintaining full compatibility with existing functionality.
- Replaced Poetry with UV for 10-100x faster dependency resolution and installation
- Added comprehensive testing infrastructure with pytest and coverage reporting
- Introduced Just task runner with 20+ development commands and Towncrier for changelog management
Reviewed Changes
Copilot reviewed 17 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Migrated from Poetry to UV-compatible PEP 621 format with modern tooling configuration |
| justfile | Added comprehensive task runner with 20+ development commands for streamlined workflows |
| tests/cli/test_misc.py | Introduced first test suite with unit and integration tests for treasury-address command |
| flake.nix | Updated Nix configuration to use UV and Just instead of Poetry |
| changes/README.md | Added Towncrier changelog management documentation |
| README.md | Updated setup instructions to focus on UV workflow |
| CLAUDE.md | Added comprehensive 245-line development documentation |
| .vscode/tasks.json | Updated VS Code tasks for new tooling (BasedPyright, Ruff, Just) |
| .github/workflows/check-code.yml | New unified CI workflow using UV with matrix testing |
Comments suppressed due to low confidence (1)
justfile:138
- The coverage source path points to 'src' but the actual source code is in 'src/torusdk'. This may result in incorrect coverage reporting.
# Open the new fragment in $EDITOR instead of passing content:
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
+ update docs with correct Python version Note: CPython 3.13 incompatible because PyO3
eec58c8 to
9d80356
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (23)
.vscode/settings.json (2)
22-22: Be explicit about analyzer ownership to avoid confusing duplicate diagnostics.Setting python.analysis.typeCheckingMode to "off" disables Pylance checks, which is fine if BasedPyright is the only analyzer in use. If some contributors still rely on Pylance, consider adding a short note in CLAUDE.md or keeping this off but clarifying that BasedPyright in CI (and the VS Code extension recommendation) is the source of truth.
Would you like me to add a brief note in CLAUDE.md under “Editor setup” clarifying that Pylance type checking is disabled in-workspace in favor of BasedPyright?
23-25: Remove absolute, user-specific extraPaths.The hardcoded path is machine-specific and not portable. It can cause noisy editor diagnostics for other contributors.
Apply this diff to remove the personal path:
- "python.autoComplete.extraPaths": [ - "/home/manjairo/tcheco/torustrate-interface" - ].gitignore (1)
1-7: Add Ruff cache to ignores.Ruff creates a .ruff_cache/ directory that’s safe to ignore and not covered by .cache/.
Apply this diff to include it near the “Local files” section:
# Local files *.local.* +.ruff_cache/.github/workflows/check-nix.yml (2)
10-10: Confirm runner label or add actionlint config for self-hosted.“ubicloud-standard-2” is not a GitHub-hosted label. If you’re targeting a self-hosted runner, ensure that:
- A runner with this label is registered, and
- actionlint is configured with this label (to silence the lint warning), or add the generic “self-hosted” label as well.
If you intended to use GitHub-hosted runners, switch to ubuntu-latest.
15-26: Pin GitHub Actions to specific release versionsTo ensure stability and avoid unexpected breaking changes, update the workflow to use the latest stable tags:
• File:
.github/workflows/check-nix.yml
- Change
- uses: DeterminateSystems/nix-installer-action@main + uses: DeterminateSystems/nix-installer-action@v19- Change
- uses: DeterminateSystems/flake-checker-action@main + uses: DeterminateSystems/flake-checker-action@v12.envrc (2)
28-43: Add ahas uvguard and clearer failure modeCurrently,
layout_uvassumesuvis installed. Mirror the robustness oflayout_poetryby checking foruvand emitting a helpful error if missing.Apply this diff:
layout_uv() { - if [[ -d ".venv" ]]; then + if ! has uv; then + log_error "uv is not installed" + return 1 + fi + + if [[ -d ".venv" ]]; then VIRTUAL_ENV="$(pwd)/.venv" fi
47-48: Consideruv sync --frozento catch drift and speed up reloadsRunning
uv syncon every direnv load can be noisy and may mask lockfile drift.--frozenfails fast if the lock and project are out of sync and avoids needless resolution.-layout uv -uv sync +layout uv +uv sync --frozenIf you prefer automatic installs only when the environment is missing, keep as-is and rely on uv’s caching.
.vscode/extensions.json (1)
3-8:ms-python.debugpyis likely not a valid VS Code extension IDDebugpy ships inside the Python extension; there isn’t a standalone Marketplace extension named
ms-python.debugpy. This recommendation will show as “unknown” in VS Code.Apply this diff to remove it:
"recommendations": [ "skellock.just", // Python "ms-python.python", - "ms-python.debugpy", "detachhead.basedpyright", "charliermarsh.ruff" ]Optionally recommend Pylance if you want general IntelliSense alongside BasedPyright:
+ "ms-python.vscode-pylance",tests/cli/test_misc.py (1)
14-27: Use MagicMock or set enter/exit.return_value for the context managerThe test manually assigns
__enter__/__exit__as plain Mocks. UsingMagicMock(or setting.return_value) is safer and avoids subtle context-manager behavior discrepancies.- with patch("torusdk.cli.misc.make_custom_context") as mock_context: - mock_client = Mock() + with patch("torusdk.cli.misc.make_custom_context") as mock_context: + mock_client = Mock() mock_client.get_dao_treasury_address.return_value = ( "5D4x123abc...treasury" ) - mock_ctx = Mock() + from unittest.mock import MagicMock + mock_ctx = MagicMock() mock_ctx.com_client.return_value = mock_client - mock_ctx.progress_status.return_value.__enter__ = Mock() - mock_ctx.progress_status.return_value.__exit__ = Mock() + # Ensure context manager methods behave as expected + mock_ctx.progress_status.return_value.__enter__.return_value = None + mock_ctx.progress_status.return_value.__exit__.return_value = False mock_ctx.output = Mock()CLAUDE.md (1)
88-90: Minor: consistent spacingNit: Align spacing for the docs commands for a clean look.
-just docs-build # Generate documentation files +just docs-build # Generate documentation filesREADME.md (1)
31-35: Nit: wording vs package name (“torus” vs “torusdk”)Right below, the text says “Install the
torusPython package” but the command installstorusdk. Update the wording for consistency.-Install the `torus` Python package directly with `pip`: +Install the `torusdk` Python package directly with `pip`:flake.nix (2)
16-16: Align devShell Python (3.11) with CI matrix (3.10/3.12) to avoid env driftDev env uses 3.11 while CI validates 3.10 and 3.12. Consider either adding 3.11 to CI or switching devShell to 3.12 for closer parity.
Option A (align devShell to 3.12):
- python = pkgs.python311; + python = pkgs.python312;Option B (keep devShell 3.11) — see my separate CI comment to add 3.11 to the matrix.
30-45: No Nix packages exported; verify this is intentionalWith packages={}, nix build won’t expose a default package. If you expect “nix build” to work, consider wiring a simple package/app (even a stub) or add a default app that runs “just check”.
Would you like a minimal Nix app stub that runs just targets?
justfile (3)
181-184: Remove duplicate asset copying in docs-builddocs-build repeats docs-copy-assets; it’s redundant.
-docs-build: docs-copy-assets docs-generate - mkdir -p ./docs/_build/assets - cp -r ./docs/assets ./docs/_build/ - @echo "Documentation built to ./docs/_build" +docs-build: docs-copy-assets docs-generate + @echo "Documentation built to ./docs/_build"
49-55: Optional: include tests in formattingFormatting only src excludes tests, which can drift stylistically.
fmt-check: - uv run ruff format --check ./src + uv run ruff format --check ./src ./tests fmt: - uv run ruff format ./src + uv run ruff format ./src ./tests
57-63: Optional: lint tests tooCatching issues in tests improves signal in CI.
lint: - uv run ruff check ./src + uv run ruff check ./src ./tests.vscode/tasks.json (2)
7-10: Make typecheck task portable by running via uvWithout Nix devShell or global installs, this may fail. Running via uv guarantees project-pinned tooling.
- "command": "basedpyright ${file}" + "command": "uv run basedpyright ${file}"
12-20: Do the same for Ruff tasksUse uv to ensure the correct tool version is used consistently.
- "command": "ruff format ${file}" + "command": "uv run ruff format ${file}"- "command": "ruff check --fix ${file}" + "command": "uv run ruff check --fix ${file}".github/workflows/check-code.yml (4)
28-29: Verify Ubicloud runner label availability or provide a fallbackactionlint flags “ubicloud-standard-2” as unknown unless configured. If this repo/org isn’t wired to Ubicloud, consider ubuntu-latest (or 22.04) as a fallback.
Option A (switch to GitHub-hosted Ubuntu):
- runs-on: ubicloud-standard-2 + runs-on: ubuntu-22.04Option B (keep Ubicloud) — add actionlint config for custom labels to silence false positives.
31-34: Optional: include Python 3.11 in the matrixDevShell uses 3.11 (flake.nix). Adding 3.11 here improves parity and catches 3.11-specific regressions.
matrix: - python-version: ["3.10", "3.12"] + python-version: ["3.10", "3.11", "3.12"]
83-86: Enable Towncrier fragment enforcement on PRsYou’ve already got the check scripted; enforcing it on PRs helps maintain changelog hygiene.
-# - name: Enforce Towncrier fragment on PRs -# if: ${{ github.event_name == 'pull_request' }} -# run: uv run --python ${{ matrix.python-version }} towncrier check --compare-with origin/main + - name: Enforce Towncrier fragment on PRs + if: ${{ github.event_name == 'pull_request' }} + run: uv run --python ${{ matrix.python-version }} towncrier check --compare-with origin/main
87-88: Avoid nested uv: call uv build directlyuv build is a uv subcommand; running it via “uv run … uv build” is redundant.
- - name: Build package - run: uv run --python ${{ matrix.python-version }} uv build + - name: Build package + run: uv buildpyproject.toml (1)
88-99: Remove leftover autopep8 configuration to avoid confusionRuff is now the formatter; keeping autopep8 config can mislead contributors and tools.
-# configure autopep to not format type ignores !!! -[tool.autopep8] -ignore_local_config = true -aggressive = 2 -in-place = true -recursive = true -max_line_length = 80 -ignore = [ - "E265", # block comment should start with '# ' - "E501", # line too long -]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (5)
docs/assets/favicon.icois excluded by!**/*.icodocs/assets/logo.pngis excluded by!**/*.pngflake.lockis excluded by!**/*.lockpoetry.lockis excluded by!**/*.lockuv.lockis excluded by!**/*.lock
📒 Files selected for processing (18)
.envrc(1 hunks).github/workflows/check-code.yml(1 hunks).github/workflows/check-nix.yml(1 hunks).github/workflows/tests.yml(0 hunks).github/workflows/type-checker.yml(0 hunks).gitignore(1 hunks).vscode/extensions.json(1 hunks).vscode/settings.json(1 hunks).vscode/tasks.json(1 hunks)CLAUDE.md(1 hunks)Makefile(0 hunks)README.md(4 hunks)changes/+.misc.md(1 hunks)changes/README.md(1 hunks)flake.nix(1 hunks)justfile(1 hunks)pyproject.toml(2 hunks)tests/cli/test_misc.py(1 hunks)
💤 Files with no reviewable changes (3)
- .github/workflows/tests.yml
- Makefile
- .github/workflows/type-checker.yml
🧰 Additional context used
🧬 Code Graph Analysis (1)
tests/cli/test_misc.py (2)
src/torusdk/client.py (1)
get_dao_treasury_address(2708-2709)src/torusdk/cli/_common.py (3)
com_client(155-177)progress_status(204-205)output(179-185)
🪛 LanguageTool
changes/README.md
[grammar] ~22-~22: There might be a mistake here.
Context: ...feature**: New features and enhancements - bugfix: Bug fixes - doc: Documenta...
(QB_NEW_EN)
[grammar] ~23-~23: There might be a mistake here.
Context: ...and enhancements - bugfix: Bug fixes - doc: Documentation updates - **removal...
(QB_NEW_EN)
[grammar] ~24-~24: There might be a mistake here.
Context: ...g fixes - doc: Documentation updates - removal: Deprecated feature removals -...
(QB_NEW_EN)
[grammar] ~25-~25: There might be a mistake here.
Context: ...removal: Deprecated feature removals - misc: Miscellaneous changes - **securi...
(QB_NEW_EN)
[grammar] ~26-~26: There might be a mistake here.
Context: ...movals - misc: Miscellaneous changes - security: Security-related fixes ## F...
(QB_NEW_EN)
[grammar] ~31-~31: There might be a mistake here.
Context: ...sue}.{type}.md(e.g.,123.feature.md) - Without issue: +.{type}.md(e.g.,+.b...
(QB_NEW_EN)
CLAUDE.md
[grammar] ~31-~31: There might be a mistake here.
Context: ...V**: Modern Python dependency management - Just: Task runner for development comm...
(QB_NEW_EN)
[grammar] ~32-~32: There might be a mistake here.
Context: ...**: Task runner for development commands - Nix (optional): Provides reproducible ...
(QB_NEW_EN)
[grammar] ~150-~150: There might be a mistake here.
Context: ...ion, dependencies (UV-compatible format) - Build system: Hatchling for modern Pyt...
(QB_NEW_EN)
[grammar] ~151-~151: There might be a mistake here.
Context: ...*: Hatchling for modern Python packaging - Ruff: Linting and formatting settings ...
(QB_NEW_EN)
[grammar] ~152-~152: There might be a mistake here.
Context: ...Ruff*: Linting and formatting settings - BasedPyright: Type checking configurat...
(QB_NEW_EN)
[grammar] ~153-~153: There might be a mistake here.
Context: ...edPyright**: Type checking configuration - Pytest: Test configuration and coverag...
(QB_NEW_EN)
[grammar] ~154-~154: There might be a mistake here.
Context: ...Test configuration and coverage settings - Towncrier: Changelog generation settin...
(QB_NEW_EN)
[grammar] ~155-~155: There might be a mistake here.
Context: ...wncrier**: Changelog generation settings - UV: Default dependency groups configur...
(QB_NEW_EN)
[grammar] ~160-~160: There might be a mistake here.
Context: ... - Line length: 80 characters (Ruff) - Python version: 3.10+ target - **Type ...
(QB_NEW_EN)
[grammar] ~161-~161: There might be a mistake here.
Context: ...Ruff) - Python version: 3.10+ target - Type checking: Strict mode with BasedP...
(QB_NEW_EN)
[grammar] ~162-~162: There might be a mistake here.
Context: ...hecking**: Strict mode with BasedPyright - Import sorting: Handled by Ruff ## CI...
(QB_NEW_EN)
[grammar] ~169-~169: There might be a mistake here.
Context: ...dependency management: - Workflow: .github/workflows/check-code.yml - Matrix testing: Python 3.10, 3.12 - **...
(QB_NEW_EN)
[grammar] ~170-~170: There might be a mistake here.
Context: ... - Matrix testing: Python 3.10, 3.12 - Setup: astral-sh/setup-uv with caching...
(QB_NEW_EN)
[grammar] ~171-~171: There might be a mistake here.
Context: ... astral-sh/setup-uv with caching enabled - Checks: Linting, type checking, testin...
(QB_NEW_EN)
[grammar] ~172-~172: There might be a mistake here.
Context: ...ing, testing, coverage, build validation - PR Requirements: Towncrier fragment mu...
(QB_NEW_EN)
[grammar] ~208-~208: There might be a mistake here.
Context: ...ommand 1. Create the command module in src/torusdk/cli/ 2. Register it in `src/torusdk/cli/init...
(QB_NEW_EN)
[grammar] ~209-~209: There might be a mistake here.
Context: ...in src/torusdk/cli/ 2. Register it in src/torusdk/cli/__init__.py 3. Add tests in tests/cli/ (when tests ar...
(QB_NEW_EN)
[grammar] ~210-~210: There might be a mistake here.
Context: ...in tests/cli/ (when tests are enabled) 4. Create news fragment: `just news feature...
(QB_NEW_EN)
[grammar] ~211-~211: There might be a mistake here.
Context: ...s are enabled) 4. Create news fragment: just news feature "Add new command" 5. Update documentation if needed ### Upda...
(QB_NEW_EN)
[grammar] ~234-~234: There might be a mistake here.
Context: ... 1. Import errors: Ensure you have activated UV environment (uv sync) or are in Ni...
(QB_NEW_EN)
[grammar] ~234-~234: There might be a mistake here.
Context: ...vated UV environment (uv sync) or are in Nix development shell 2. **Type checkin...
(QB_NEW_EN)
🪛 actionlint (1.7.7)
.github/workflows/check-code.yml
28-28: label "ubicloud-standard-2" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
.github/workflows/check-nix.yml
10-10: label "ubicloud-standard-2" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
🔇 Additional comments (16)
.vscode/settings.json (1)
3-20: CSpell additions align with repo tooling (LGTM).Entries for basedpyright, towncrier, pdoc, typeguard, etc., are appropriate and reduce false positives in-editor.
changes/+.misc.md (1)
1-1: Towncrier fragment looks correct (LGTM).Filename and single-line content follow the documented convention for a misc orphan fragment.
.github/workflows/check-nix.yml (1)
15-15: Checkout v4 upgrade (LGTM).actions/checkout@v4 is current and improves performance/security.
changes/README.md (1)
1-52: Clear, actionable Towncrier fragment guide (LGTM).Conventions, commands, and processing flow are well documented and match the justfile/pyproject setup in this PR.
tests/cli/test_misc.py (3)
28-33: LGTM: solid unit test of happy-path behaviorGood verification of exit code, DAO method call count, and printed output. The runner-based invocation keeps this as a true CLI test without network dependency.
34-43: Nice registration check via--helpThis is a simple, effective integration-style check to ensure the command is wired into the app and doesn’t require network access. Good balance.
14-15: Patch target verified – no changes neededThe function
make_custom_contextis imported directly insrc/torusdk/cli/misc.pyviafrom torusdk.cli._common import make_custom_contextso
patch("torusdk.cli.misc.make_custom_context")correctly intercepts all calls.README.md (3)
15-16: LGTM: Navigation now reflects pip install focusHiding the Nix install link in ToC while keeping the section commented below is a pragmatic choice.
47-54: LGTM: Nix install section hidden, but preservedKeeping the Nix section in comments is useful for future restoration without confusing users today.
172-207: Great addition: concise UV/Just development quickstart and Nix alternativeThis aligns well with the new tooling and gives contributors a clear starting path. Linking to CLAUDE.md is a nice touch.
flake.nix (1)
21-28: DevShell inputs look solid and match the new toolingjust/uv/ruff/basedpyright in the devShell is consistent with the migration. Good cleanup removing Poetry.
.github/workflows/check-code.yml (1)
3-5: Good: minimal GITHUB_TOKEN permissions setThis addresses prior security guidance to limit default token permissions.
pyproject.toml (4)
1-12: Project metadata migration looks correctHatchling config and PEP 621 fields are well-formed. Authors/license/readme/classifiers look good.
40-55: Build-system + dev tooling sections LGTMHatchling, uv default groups, and Towncrier integration are consistent with the rest of the PR.
8-8: Confirm docs/README reflect supported Python versions (3.10–3.12)This matches requires-python and CI. Make sure README/docs were updated accordingly.
14-35: Confirm torustrateinterface availabilityVerified that
torustrateinterfacev0.1.0 is published on PyPI. Ensure your CI can resolve this dependency; to guarantee reproducible builds, consider pinning totorustrateinterface==0.1.0or documenting its source if it’s a private/forked package.
| ```text | ||
| torusdk/ | ||
| ├── src/torusdk/ # Main package source | ||
| │ ├── cli/ # CLI command implementations | ||
| │ ├── compat/ # Compatibility utilities | ||
| │ ├── faucet/ # Faucet functionality | ||
| │ ├── types/ # Type definitions | ||
| │ └── util/ # Utility modules | ||
| ├── nix/ # Nix configuration files | ||
| ├── changes/ # Towncrier news fragments | ||
| ├── tests/ # Test files (currently empty) | ||
| ├── pyproject.toml # Python project configuration | ||
| ├── poetry.lock # Dependency lockfile | ||
| ├── flake.nix # Nix flake configuration | ||
| └── justfile # Task runner recipes | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Project structure is out of date: poetry.lock listed, tests marked “currently empty”
Given this PR removes Poetry and adds tests/cli/test_misc.py, this section is misleading. Replace poetry.lock with uv.lock and note that tests exist.
Apply this diff:
torusdk/
├── src/torusdk/ # Main package source
│ ├── cli/ # CLI command implementations
│ ├── compat/ # Compatibility utilities
│ ├── faucet/ # Faucet functionality
│ ├── types/ # Type definitions
│ └── util/ # Utility modules
├── nix/ # Nix configuration files
├── changes/ # Towncrier news fragments
-├── tests/ # Test files (currently empty)
+├── tests/ # Test files (e.g., CLI tests under tests/cli/)
├── pyproject.toml # Python project configuration
-├── poetry.lock # Dependency lockfile
+├── uv.lock # Dependency lockfile (UV)
├── flake.nix # Nix flake configuration
└── justfile # Task runner recipes📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ```text | |
| torusdk/ | |
| ├── src/torusdk/ # Main package source | |
| │ ├── cli/ # CLI command implementations | |
| │ ├── compat/ # Compatibility utilities | |
| │ ├── faucet/ # Faucet functionality | |
| │ ├── types/ # Type definitions | |
| │ └── util/ # Utility modules | |
| ├── nix/ # Nix configuration files | |
| ├── changes/ # Towncrier news fragments | |
| ├── tests/ # Test files (currently empty) | |
| ├── pyproject.toml # Python project configuration | |
| ├── poetry.lock # Dependency lockfile | |
| ├── flake.nix # Nix flake configuration | |
| └── justfile # Task runner recipes | |
| ``` | |
| torusdk/ | |
| ├── src/torusdk/ # Main package source | |
| │ ├── cli/ # CLI command implementations | |
| │ ├── compat/ # Compatibility utilities | |
| │ ├── faucet/ # Faucet functionality | |
| │ ├── types/ # Type definitions | |
| │ └── util/ # Utility modules | |
| ├── nix/ # Nix configuration files | |
| ├── changes/ # Towncrier news fragments | |
| ├── tests/ # Test files (e.g., CLI tests under tests/cli/) | |
| ├── pyproject.toml # Python project configuration | |
| ├── uv.lock # Dependency lockfile (UV) | |
| ├── flake.nix # Nix flake configuration | |
| └── justfile # Task runner recipes |
🤖 Prompt for AI Agents
In CLAUDE.md around lines 129 to 145, the project tree is outdated: it still
lists poetry.lock and describes tests as “currently empty” despite this PR
removing Poetry and adding tests/cli/test_misc.py. Update the listing to replace
"poetry.lock" with "uv.lock" and change the tests line to indicate that test
files now exist (e.g., mention tests/cli/test_misc.py or state "Test files
(includes CLI tests)"). Ensure the updated tree and brief note reflect the new
lockfile and the presence of tests.
| - **Line length**: 80 characters (Ruff) | ||
| - **Python version**: 3.10+ target | ||
| - **Type checking**: Strict mode with BasedPyright | ||
| - **Import sorting**: Handled by Ruff | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align Python version with supported range (3.10–3.12)
Docs elsewhere in this PR (README) and PR description state support for 3.10–3.12. Update this section to match.
-- **Python version**: 3.10+ target
+- **Python version**: 3.10–3.12 target📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - **Line length**: 80 characters (Ruff) | |
| - **Python version**: 3.10+ target | |
| - **Type checking**: Strict mode with BasedPyright | |
| - **Import sorting**: Handled by Ruff | |
| - **Line length**: 80 characters (Ruff) | |
| - **Python version**: 3.10–3.12 target | |
| - **Type checking**: Strict mode with BasedPyright | |
| - **Import sorting**: Handled by Ruff |
🧰 Tools
🪛 LanguageTool
[grammar] ~160-~160: There might be a mistake here.
Context: ... - Line length: 80 characters (Ruff) - Python version: 3.10+ target - **Type ...
(QB_NEW_EN)
[grammar] ~161-~161: There might be a mistake here.
Context: ...Ruff) - Python version: 3.10+ target - Type checking: Strict mode with BasedP...
(QB_NEW_EN)
[grammar] ~162-~162: There might be a mistake here.
Context: ...hecking**: Strict mode with BasedPyright - Import sorting: Handled by Ruff ## CI...
(QB_NEW_EN)
🤖 Prompt for AI Agents
In CLAUDE.md around lines 160 to 164, the Python version note currently reads
"3.10+ target" but must explicitly state the supported range 3.10–3.12 to match
README and PR description; update the line to state the supported versions
(e.g., "Python version: 3.10–3.12 target") or equivalent wording so the docs are
consistent across the PR.
| uv run pdoc torusdk \ | ||
| --docformat google \ | ||
| --output-directory ./docs/_build \ | ||
| --favicon /assets/favicon.ico \ | ||
| --logo-link https://github.com/renlabs-dev/torusdk \ | ||
| --logo /assets/logo.png \ | ||
| --edit-url torusdk=https://github.com/renlabs-dev/torusdk/blob/main/src/torusdk/ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Fix pdoc asset paths: current absolute paths likely break
Using “/assets/…” will resolve to the filesystem root and likely fail. Use repo-relative paths so pdoc can embed/copy them.
docs-generate:
uv run pdoc torusdk \
--docformat google \
--output-directory ./docs/_build \
- --favicon /assets/favicon.ico \
+ --favicon ./docs/assets/favicon.ico \
--logo-link https://github.com/renlabs-dev/torusdk \
- --logo /assets/logo.png \
+ --logo ./docs/assets/logo.png \
--edit-url torusdk=https://github.com/renlabs-dev/torusdk/blob/main/src/torusdk/📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| uv run pdoc torusdk \ | |
| --docformat google \ | |
| --output-directory ./docs/_build \ | |
| --favicon /assets/favicon.ico \ | |
| --logo-link https://github.com/renlabs-dev/torusdk \ | |
| --logo /assets/logo.png \ | |
| --edit-url torusdk=https://github.com/renlabs-dev/torusdk/blob/main/src/torusdk/ | |
| docs-generate: | |
| uv run pdoc torusdk \ | |
| --docformat google \ | |
| --output-directory ./docs/_build \ | |
| --favicon ./docs/assets/favicon.ico \ | |
| --logo-link https://github.com/renlabs-dev/torusdk \ | |
| --logo ./docs/assets/logo.png \ | |
| --edit-url torusdk=https://github.com/renlabs-dev/torusdk/blob/main/src/torusdk/ |
🤖 Prompt for AI Agents
In justfile around lines 167 to 174 the pdoc asset paths use absolute paths
("/assets/...") which resolve to the filesystem root and will break; update the
flags to use repository-relative paths (for example "./assets/favicon.ico" and
"./assets/logo.png" or "assets/favicon.ico") so pdoc can locate and embed/copy
them, and confirm the assets exist at that relative location in the repo.
Modernize Development Tooling: Poetry to UV Migration
This PR modernizes the development toolchain by migrating from Poetry to UV for dependency management, introduces testing infrastructure, and streamlines CI/CD workflows. The changes provide significant performance improvements in dependency resolution and installation while maintaining full compatibility with existing functionality.
Changes
🚀 Dependency Management Migration
pyproject.tomlto standard format with UV-native configurationpoetry.lockwithuv.lock(1,986 lines vs 2,731 lines - more efficient)🛠️ Development Experience
just boot,just sync,just updatejust fmt,just lint,just typecheck,just cijust test,just cov,just cov-htmljust docs-run,just docs-buildjust release,just build,just publishbasedpyrightfor type checking (replacing Pyright)justextension for task runner support📋 Testing Infrastructure
tests/cli/test_misc.pywith comprehensive tests fortreasury-addresscommand📝 Changelog Management
changes/directory🔄 CI/CD Improvements
check-code.yml📚 Documentation
🗂️ Project Structure
.envrcwith UV layout supportTesting
Automated Testing
Local Testing
Development Workflow Testing
Breaking Changes
Migration Required for Contributors
Contributors must update their local development setup:
Before (Poetry):
After (UV + Just):
Tool Changes
Performance Impact
Dependency Installation Performance
Development Experience
just --listshows all available commandsDeployment Notes
For Maintainers
just release VERSIONjust publishwith PYPI_API_TOKENFor CI/CD
Reviewer Checklist
just test,just cov)Related Issues
This modernization effort addresses several development experience issues:
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]
Summary by CodeRabbit