Skip to content

Add ty package#119

Merged
ejfine merged 7 commits intomainfrom
bump-pulumi2
Dec 17, 2025
Merged

Add ty package#119
ejfine merged 7 commits intomainfrom
bump-pulumi2

Conversation

@ejfine
Copy link
Contributor

@ejfine ejfine commented Dec 17, 2025

Why is this change necessary?

Lay framework for starting to use ty type checker

How does this change address the issue?

Adds it to context/pyproject and creates a ty.toml file

What side effects does this change have?

N/A

How is this change tested?

Downstream repos

Other

Bumps pulumi deps

Summary by CodeRabbit

  • Chores
    • Relaxed many dependency pins to range-based constraints and standardized several exact pins; added/activated a new tooling dependency (ty). Updated tooling installer and development environment tool versions and related metadata.
  • Configuration
    • Added a new configuration file with source exclusion patterns to omit common build artifacts, caches, virtual environments, and generated directories.

✏️ Tip: You can customize this high-level summary in your review settings.

@ejfine ejfine self-assigned this Dec 17, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Walkthrough

Relaxed and modernized many dependency version specifiers, added a new "ty" tool and configuration, updated devcontainer UV version and an inline devcontainer context-hash comment, and adjusted installer/template package version syntax. No public API or function signatures were changed.

Changes

Cohort / File(s) Summary
Devcontainer metadata & script
.devcontainer/devcontainer.json, .devcontainer/install-ci-tooling.py
Updated devcontainer context-hash in an inline comment and bumped UV_VERSION from 0.9.17 to 0.9.18 in the installer script.
Central version map
extensions/context.py
Converted many fixed pins to range-based constraints (>=) or exact-match (==) where applicable; added ty_version to the context and updated numerous tool/package baseline versions (pulumi*, pytest*, pyright, vcrpy, structlog, etc.).
Project manifest
pyproject.toml
Moved/copied dependency declarations: introduced ty (exact/modernized pin), ensured copier/copier-template-extensions appear with exact-match pins, and updated the project's dependency lines to reflect templated/version changes.
Template installers & context templates
template/.devcontainer/install-ci-tooling.py.jinja-base, template/extensions/context.py.jinja-base, template/pyproject.toml.jinja-base
Changed installer argument syntax for copier packages (removed == operator in the generated install command), populated context["ty_version"] in the template context, and activated templated dependency entries (pytest, pytest-cov, pytest-randomly, pyright[nodejs], ty, copier packages).
ty configuration files
ty.toml, template/ty.toml, template/template/ty.toml
Added ty.toml with a [src] exclude array listing common build/cache/generated patterns; added templated references at template/ty.toml and template/template/ty.toml pointing to parent ty.toml files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to extensions/context.py (many version-key edits and added ty_version).
  • Verify pyproject.toml dependency entries match intended constraint semantics (exact vs. >=).
  • Confirm installer/template syntaxes produce correct install commands (copier package argument changes).
  • Review ty.toml excludes for over- or under-exclusion.

Possibly related PRs

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add ty package' is concise and directly reflects the primary objective of adding the ty type checker framework, though it omits the secondary change of bumping Pulumi dependencies.
Description check ✅ Passed The pull request description includes most required template sections (Why, How, Side effects, Testing, Other) with substantive information provided for each.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cfb1414 and 161d4e8.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • .devcontainer/devcontainer.json (1 hunks)
  • .devcontainer/install-ci-tooling.py (1 hunks)
  • extensions/context.py (1 hunks)
  • pyproject.toml (1 hunks)
🔇 Additional comments (5)
.devcontainer/devcontainer.json (1)

65-65: Auto-generated context hash update.

This hash is managed by a pre-commit hook as indicated in the comment. No concerns.

extensions/context.py (3)

14-18: Version updates are consistent across the codebase.

  • uv_version matches the UV_VERSION in install-ci-tooling.py
  • The == prefix on copier versions is intentional for template interpolation into dependency strings

22-26: New ty_version context variable added.

The addition of ty_version = ">=0.0.2" enables templates to include ty as a dependency. This aligns with the ty>=0.0.2 addition in pyproject.toml.


29-44: Pulumi and related dependencies relaxed to minimum version constraints.

Changing from exact versions to >= ranges allows downstream projects to use newer compatible versions. This is a reasonable approach for library dependencies, though it shifts the responsibility of testing compatibility to downstream repositories (as noted in the PR description).

.devcontainer/install-ci-tooling.py (1)

8-8: UV version bump looks good.

The update from 0.9.17 to 0.9.18 is consistent with extensions/context.py line 14 where uv_version is also set to "0.9.18".

#!/bin/bash
# Verify UV 0.9.18 release exists and check for any issues
curl -sI "https://astral.sh/uv/0.9.18/install.sh" | head -n 1

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e16443c and cfb1414.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • .devcontainer/devcontainer.json (1 hunks)
  • extensions/context.py (1 hunks)
  • pyproject.toml (1 hunks)
  • template/.devcontainer/install-ci-tooling.py.jinja-base (1 hunks)
  • template/extensions/context.py.jinja-base (1 hunks)
  • template/pyproject.toml.jinja-base (1 hunks)
  • template/template/ty.toml (1 hunks)
  • template/ty.toml (1 hunks)
  • ty.toml (1 hunks)
🔇 Additional comments (9)
.devcontainer/devcontainer.json (1)

65-65: Auto-generated hash update.

This is a pre-commit hook managed context hash - no action needed.

template/.devcontainer/install-ci-tooling.py.jinja-base (1)

79-81: Version specifier now embedded in context variable.

The format strings correctly drop the == prefix since copier_version and copier_template_extensions_version now include the operator (e.g., "==9.11.0"). This differs from pre_commit_version (line 91) which remains a bare version string with explicit == in the format string.

template/pyproject.toml.jinja-base (1)

11-18: LGTM! Templated dependencies properly configured.

The dependencies section correctly uses Jinja template variables for version management. The {% raw %} and {% endraw %} tags properly escape the template syntax, and version variables (including the new ty_version) will resolve from the context hook.

extensions/context.py (2)

17-26: Version constraint strategy change looks intentional.

The split approach makes sense:

  • Exact pins (==) for copier and copier-template-extensions ensure reproducible template generation
  • Minimum versions (>=) for dev/testing tools allow flexibility while ensuring baseline compatibility

New ty_version correctly follows the >= pattern for dev tooling.


29-44: Pulumi and related packages shifted to >= constraints.

This allows downstream repositories to receive compatible updates without template regeneration. Since these are infrastructure-as-code dependencies, ensure downstream CI validates Pulumi deployments against potential version drift.

ty.toml (1)

1-18: LGTM! Sensible exclude patterns for ty type checker.

The configuration correctly uses the [src] section with exclude patterns, which follows ty.toml's identical structure to pyproject.toml but without the [tool.ty] prefix. The exclude patterns appropriately use gitignore-style syntax to exclude directories like generated code, caches, and virtual environments from type checking.

template/extensions/context.py.jinja-base (1)

20-20: LGTM! Consistent with existing pattern.

The addition of ty_version to the context follows the established pattern for version assignments and integrates properly with the template's context hook mechanism.

template/ty.toml (1)

1-1: Verify the intended behavior when this file is deployed to downstream projects.

This file contains ../ty.toml, which references a parent directory. When this template is deployed to a downstream project via copier, this file becomes the root ty.toml of that project. At that point, the reference to ../ty.toml would point outside the project directory, which may not be the intended behavior.

Please clarify:

  1. Is this file meant to reference the template repository's root ty.toml during development?
  2. Should this be a template file (.jinja) that generates actual ty configuration rather than a path reference?
  3. How should ty be configured in downstream projects that use this template?
template/template/ty.toml (1)

1-1: Clarify symlink usage for ty.toml in template deployment.

The template/template/ty.toml is a symbolic link pointing to ../../ty.toml (the root ty.toml file exists and contains valid ty configuration). However, when this template is deployed to downstream projects via Copier, symbolic links may not be preserved depending on the deployment method, potentially resulting in broken references in generated projects. Confirm that symlinks are either:

  1. Preserved during template deployment, or
  2. Converted to actual files/copies as part of the template generation process

"pytest-cov>=7.0.0",
"pytest-randomly>=4.0.1",
"pyright[nodejs]>=1.1.407",
"ty>=0.0.2",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Update dependency constraint to match current stable release.

ty is an extremely fast Python type checker and language server written in Rust, backed by Astral, the creators of uv and Ruff. The constraint should be >=0.0.2 (not >=0.0.2) as 0.0.2 is the beta release, making it the current stable version. However, note that ty is a preview release with missing features and known issues that shouldn't be used in production yet.

🤖 Prompt for AI Agents
In pyproject.toml around line 12 replace the existing ty dependency constraint
with the stable-preview constraint "ty>=0.0.2" (ensure the entry matches the
project’s dependency syntax exactly), updating the version string on that line;
leave a comment or note elsewhere in the file that ty is a preview release and
should not be used in production.

@ejfine ejfine merged commit d23ed13 into main Dec 17, 2025
6 checks passed
@ejfine ejfine deleted the bump-pulumi2 branch December 17, 2025 11:49
@coderabbitai coderabbitai bot mentioned this pull request Jan 5, 2026
@coderabbitai coderabbitai bot mentioned this pull request Jan 23, 2026
@coderabbitai coderabbitai bot mentioned this pull request Mar 2, 2026
@coderabbitai coderabbitai bot mentioned this pull request Mar 23, 2026
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.

1 participant