Skip to content

Bump ty from 0.0.1a31 to 0.0.2#2636

Closed
dependabot[bot] wants to merge 2 commits into
mainfrom
dependabot/pip/ty-0.0.2
Closed

Bump ty from 0.0.1a31 to 0.0.2#2636
dependabot[bot] wants to merge 2 commits into
mainfrom
dependabot/pip/ty-0.0.2

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot Bot commented on behalf of github Dec 17, 2025

Bumps ty from 0.0.1a31 to 0.0.2.

Release notes

Sourced from ty's releases.

0.0.2

Release Notes

Released on 2025-12-16.

This is the first Beta release of ty, which we're now ready to recommend to motivated users for production use. See our blog post for more details.

LSP server

  • Improve display of completions to show actual insertion text (#21988)
  • Improve highlighting of special type syntax in hovers (#22005)
  • Improve syntax highlighting of constants (#22006)

Core type checking

  • Infer precise types for isinstance(…) calls involving type variables (#21999)
  • Infer TypeVar specializations for Callable types (#21551)
  • Propagate classmethod-ness through decorators returning Callables (#21958)
  • Improve rendering of default values for function args (#22010)
  • Don't use implicit superclass annotation when converting a class constructor into a Callable (#22011)

Other

  • Type checking performance improvement (#22000)

Contributors

Install ty 0.0.2

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.2/ty-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.2/ty-installer.ps1 | iex"

Download ty 0.0.2

... (truncated)

Changelog

Sourced from ty's changelog.

0.0.2

Released on 2025-12-16.

This is the first Beta release of ty, which we're now ready to recommend to motivated users for production use. See our blog post for more details.

LSP server

  • Improve display of completions to show actual insertion text (#21988)
  • Improve highlighting of special type syntax in hovers (#22005)
  • Improve syntax highlighting of constants (#22006)

Core type checking

  • Infer precise types for isinstance(…) calls involving type variables (#21999)
  • Infer TypeVar specializations for Callable types (#21551)
  • Propagate classmethod-ness through decorators returning Callables (#21958)
  • Improve rendering of default values for function args (#22010)
  • Don't use implicit superclass annotation when converting a class constructor into a Callable (#22011)

Other

  • Type checking performance improvement (#22000)

Contributors

0.0.1-alpha.35

Released on 2025-12-16.

Bug fixes

  • Fix panic for stringified comprehensions and boolean expressions in type expression (#21967)
  • Avoid stack overflow when determining inferable typevars (#21971)
  • Fix false-positive invalid-method-override diagnostic on method that uses Callable with a ParamSpec (#21934)
  • Disallow explicit specialization of type variables themselves (#21938)
  • Fix hover type on named expression ("walrus expression") targets (#21952)

LSP server

  • Add "qualify ..." code fix for undefined references (#21968)
  • Add new goto-definition targets on inlay hints (#21950)

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [ty](https://github.com/astral-sh/ty) from 0.0.1a31 to 0.0.2.
- [Release notes](https://github.com/astral-sh/ty/releases)
- [Changelog](https://github.com/astral-sh/ty/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ty@0.0.1-alpha.31...0.0.2)

---
updated-dependencies:
- dependency-name: ty
  dependency-version: 0.0.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added the dependencies Updates to project dependencies. Automatically applied to dependabot PRs. label Dec 17, 2025
@marvin-context-protocol marvin-context-protocol Bot added the enhancement Improvement to existing functionality. For issues and smaller PR improvements. label Dec 17, 2025
@marvin-context-protocol
Copy link
Copy Markdown
Contributor

Test Failure Analysis

Summary: The type checker was upgraded from version 0.0.1a31 to 0.0.2 (beta release), which has stricter type checking. This caught a type error in the AWS Cognito auth provider where base_url (which can be None) is passed to a constructor that doesn't accept None.

Root Cause: In src/fastmcp/server/auth/providers/aws.py:226, settings.base_url has type AnyHttpUrl | str | None but the parent class OIDCProxyAuthProvider.__init__ expects parameter base_url to be AnyHttpUrl | str (non-optional). The code doesn't validate or provide a default for base_url before passing it to the parent constructor.

Suggested Solution: Add validation for base_url similar to the validation for user_pool_id, client_id, and client_secret. The base_url field is already documented as required in the docstring.

Add this validation after line 199:

if not settings.base_url:
    raise ValueError(
        "base_url is required - set via parameter or FASTMCP_SERVER_AUTH_AWS_COGNITO_BASE_URL"
    )

This will ensure base_url is never None when passed to the parent constructor, satisfying the stricter type checking in ty 0.0.2.

Detailed Analysis

The error from ty 0.0.2:

error[invalid-argument-type]: Argument to bound method `__init__` is incorrect
     --> src/fastmcp/server/auth/providers/aws.py:226:13
      |
  226 |             base_url=settings.base_url,
      |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `AnyHttpUrl | str`, found `AnyHttpUrl | str | None`
      |
  info: Element `None` of this union is not assignable to `AnyHttpUrl | str`

The settings model defines base_url as optional:

base_url: AnyHttpUrl | str | None = None

But the parent class OIDCProxyAuthProvider requires it:

def __init__(
    self,
    *,
    # ...
    base_url: AnyHttpUrl | str,  # <- not optional
    # ...
)

The AWSCognitoProvider constructor already validates other required fields (user_pool_id, client_id, client_secret) but not base_url, even though the docstring marks it as required.

Related Files
  • src/fastmcp/server/auth/providers/aws.py:226 - Where the error occurs (passing base_url to parent)
  • src/fastmcp/server/auth/providers/aws.py:55 - Settings model defining base_url as optional
  • src/fastmcp/server/auth/providers/aws.py:188-199 - Existing validation logic for other required fields
  • src/fastmcp/server/auth/oidc_proxy.py:213 - Parent class constructor signature requiring non-optional base_url

ty 0.0.2 (first beta) introduced stricter checking that catches several
patterns that are valid at runtime but hard for static analysis:

- invalid-parameter-default: Depends() DI pattern uses markers as defaults
- invalid-return-type: functools.partial doesn't preserve return types
- invalid-argument-type: Optional->required, generics, datetime coercion

Each rule is documented with affected files and TODO for future fixes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Comment thread pyproject.toml
Comment on lines +152 to +174
# ty 0.0.2 introduced stricter checking - these need incremental fixes:

# invalid-parameter-default: ty doesn't understand Depends() dependency injection pattern
# where default values are dependency markers resolved at runtime, not actual defaults.
# Affects: tests/server/test_dependencies.py, tests/server/tasks/test_task_dependencies.py
# TODO: Investigate if ty will add support for FastAPI/Depends-style DI patterns
invalid-parameter-default = "ignore" # 13 errors

# invalid-return-type: ty doesn't understand functools.partial preserves callable signatures.
# partial(self.tool, ...) returns a callable with same return type as self.tool.
# Affects: src/fastmcp/server/server.py (tool/prompt decorator partials)
# TODO: Check if ty improves partial() type inference
invalid-return-type = "ignore" # 2 errors

# invalid-argument-type: Multiple causes needing individual investigation:
# 1. Auth providers pass settings.base_url (Optional) to parent expecting non-Optional
# - Could add validation, but tests rely on base_url being optional for some scenarios
# 2. PydanticAdapter accepts list[Model] via TypeAdapter but ty expects type[T]
# 3. Client.new() generic Self bound not understood for ProxyClient
# 4. createdAt expects datetime but code passes ISO string (pydantic coerces)
# Affects: auth/providers/*.py, middleware/caching.py, server.py, tasks/protocol.py
# TODO: Fix individually - some may need code changes, others ty improvements
invalid-argument-type = "ignore" # 14 errors
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.

add some more ignores

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.

@zzstoatzz these seem so broad that disabling them invalidates a lot of type checking benefits, no? in particular return types and argument types? Is it worth it to have targeted ignores (or use pyright)?

@dependabot @github
Copy link
Copy Markdown
Contributor Author

dependabot Bot commented on behalf of github Dec 18, 2025

A newer version of ty exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

@jlowin
Copy link
Copy Markdown
Member

jlowin commented Dec 22, 2025

Closed for #2676

@jlowin jlowin closed this Dec 22, 2025
@dependabot @github
Copy link
Copy Markdown
Contributor Author

dependabot Bot commented on behalf of github Dec 22, 2025

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot dependabot Bot deleted the dependabot/pip/ty-0.0.2 branch December 22, 2025 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Updates to project dependencies. Automatically applied to dependabot PRs. enhancement Improvement to existing functionality. For issues and smaller PR improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants