# Mypy에서 Ty로: Ruff 제작사가 만든 초고속 Rust 기반 Python 타입 체커 도입 가이드

> Clean Markdown view of GeekNews topic #25713. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=25713](https://news.hada.io/topic?id=25713)
- GeekNews Markdown: [https://news.hada.io/topic/25713.md](https://news.hada.io/topic/25713.md)
- Type: news
- Author: [darjeeling](https://news.hada.io/@darjeeling)
- Published: 2026-01-10T14:46:46+09:00
- Updated: 2026-01-10T14:46:46+09:00
- Original source: [blog.pythonlibrary.org](https://www.blog.pythonlibrary.org/2026/01/09/how-to-switch-to-ty-from-mypy/)
- Points: 12
- Comments: 0

## Summary

Rust로 개발된 **초고속 Python 타입 체커 ‘Ty’**가 Astral(Ruff 제작사)에 의해 공개되었습니다. Mypy의 strict 모드와 유사한 기본 동작을 제공하면서도, `uv`를 통한 설치·실행으로 개발 환경 통합이 간결해졌습니다. 아직 공식 pre-commit 지원은 없지만 커뮤니티 워크어라운드를 활용할 수 있으며, GitHub Actions 연동으로 CI 단계에서 타입 검증 자동화를 구현할 수 있습니다.

## Topic Body

요약:   
* Astral(Ruff 제작사)에서 공개한 Rust 기반의 새로운 Python 타입 체커 'ty'의 도입 및 마이그레이션 방법을 다룹니다.  
* 'ty'는 기본적으로 Mypy의 엄격(strict) 모드와 유사하게 동작하며, 'uv'를 통한 설치 및 실행을 기본적으로 지원합니다.  
* 아직 공식 pre-commit 지원은 없으나 커뮤니티 워크어라운드를 사용할 수 있으며, GitHub Actions 연동 방법도 상세히 소개합니다.  
  
  
상세요약:   
**1. Ty 소개 및 특징**  
Mypy와 Pyright가 주도하던 Python 타입 체킹 생태계에 Astral이 개발한 'ty'가 새롭게 등장했습니다. Ruff와 마찬가지로 Rust로 작성되어 매우 빠른 속도를 자랑합니다.  
  
**2. 설치 및 로컬 실행**  
'ty'는 `uv`를 통해 간편하게 설치하고 실행할 수 있습니다.  
  
* **설치:**  
    ```bash  
    # uv를 통한 도구 설치  
    uv tool install ty@latest  
    
    # 또는 standalone 설치 지원 (문서 참조)  
    ```  
* **실행:**  
    ```bash  
    # 설치 후 실행  
    uv run ty  
    
    # 설치 없이 실행 (uvx 사용)  
    uvx ty  
    
    # 직접 실행  
    ty check  
    ```  
  
**3. 설정 (Configuration)**  
`pyproject.toml` 또는 `ty.toml`을 통해 설정이 가능합니다.  
* **기본 동작:** 별도 설정 없이 실행 시 Mypy의 strict 모드와 매우 유사하게 동작합니다.  
* **제약 사항:** 현재 누락된 타입 힌트(missing type hints)를 강조 표시하지 않습니다. 이를 강제하려면 Ruff의 `flake8-annotations` 규칙을 `pyproject.toml`에 추가하여 보완해야 합니다.  
  
**4. GitHub Actions 연동**  
CI 환경에서 PR 생성 시 자동으로 타입 체킹을 수행하도록 `.github/workflows/ty.yml`을 생성하여 설정할 수 있습니다.  
  
```yaml  
name: ty  
on:  
  pull_request:  
    types: [opened, synchronize, reopened, ready_for_review]  
  workflow_dispatch:  
jobs:  
  build:  
    if: github.event.pull_request.draft == false  
    runs-on: self-hosted  
    steps:  
      - uses: actions/checkout@v3  
      - name: Install Python  
        uses: actions/setup-python@v4  
        with:  
          python-version: "3.12"  
      - name: Install dependencies  
        run: |  
          python -m pip install --upgrade pip  
          pip install ty==0.0.7      
      - name: Run ty  
        run: ty check  
        continue-on-error: false  
  
```  
  
*(참고: ty 버전은 릴리스 상황에 맞춰 업데이트가 필요합니다.)*  
  
**5. Pre-commit 통합**  
현재 공식적인 pre-commit 훅은 지원되지 않으나(이슈 #269), 커뮤니티에서 제공하는 워크어라운드(예: `ty-pre-commit`)를 사용하여 `.pre-commit-config.yaml`에 통합할 수 있습니다. 추후 공식 지원 시 설정 업데이트가 권장됩니다.

## Comments



_No public comments on this page._
