Fixes: 1) Add `# ty: ignore` comments to suppress type errors in multiple files; 2) Correct method argument annotations and definitions to align with type hints; 3) Fix cases of invalid or missing imports and unresolved attributes; Extra: Refactor method definitions to use tuple-based method declarations; replace custom type aliases with `Any`; improve caching utility and error handling logic in utility scripts.
51 lines
No EOL
888 B
YAML
51 lines
No EOL
888 B
YAML
image: ghcr.io/astral-sh/uv:python3.12-bookworm
|
|
|
|
stages:
|
|
- lint
|
|
- typecheck
|
|
- test
|
|
|
|
variables:
|
|
UV_PYTHON: "3.12"
|
|
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
|
PYTHONDONTWRITEBYTECODE: "1"
|
|
|
|
before_script:
|
|
- uv sync --frozen --extra linting
|
|
|
|
lint:
|
|
stage: lint
|
|
script:
|
|
- uv run ruff format --check .
|
|
- uv run ruff check --force-exclude .
|
|
rules:
|
|
- changes:
|
|
- "**/*.py"
|
|
- "pyproject.toml"
|
|
- ".pre-commit-config.yaml"
|
|
when: on_success
|
|
- when: never
|
|
|
|
typecheck:
|
|
stage: typecheck
|
|
script:
|
|
- uv run ty check
|
|
rules:
|
|
- changes:
|
|
- "**/*.py"
|
|
- "pyproject.toml"
|
|
when: on_success
|
|
- when: never
|
|
|
|
test:
|
|
stage: test
|
|
script:
|
|
- uv run pytest -q
|
|
rules:
|
|
- changes:
|
|
- "**/*.py"
|
|
- "pyproject.toml"
|
|
- "pytest.ini"
|
|
- "pyproject.toml"
|
|
when: on_success
|
|
- when: never |