Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/ty-ecosystem-analyzer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
run: rustup show

- name: Compute diagnostic diff
id: compute-diagnostic-diff
shell: bash
run: |
cd ruff
Expand All @@ -86,7 +87,7 @@ jobs:

cd ..

uv tool install "git+https://github.com/astral-sh/ecosystem-analyzer@2907323c61016ffd2cab9c25fb255f3dab8ec256"
uv tool install "git+https://github.com/astral-sh/ecosystem-analyzer@cc6b94ac6d40d7c1cbf891ce48245d6b69e5631b"

ecosystem-analyzer \
--repository ruff \
Expand All @@ -111,13 +112,17 @@ jobs:
--new-name "$REF_NAME" \
--output-html dist/diff.html

set +e
ecosystem-analyzer \
generate-diff-statistics \
diagnostics-old.json \
diagnostics-new.json \
--fail-on-new-abnormal-exits \
--old-name "main (merge base)" \
--new-name "$REF_NAME" \
--output diff-statistics.md
DIFF_STATISTICS_EXIT_CODE=$?
set -e

ecosystem-analyzer \
generate-timing-diff \
Expand All @@ -133,6 +138,8 @@ jobs:

cat diff-statistics.md >> "$GITHUB_STEP_SUMMARY"

echo "diff_statistics_exit_code=$DIFF_STATISTICS_EXIT_CODE" >> "$GITHUB_OUTPUT"

# NOTE: astral-sh-bot uses this artifact to post comments on PRs.
# Make sure to update the bot if you rename the artifact.
- name: "Upload full report"
Expand Down Expand Up @@ -160,3 +167,7 @@ jobs:
with:
name: timing.html
path: dist/timing.html

- name: Fail on new abnormal exits
if: steps.compute-diagnostic-diff.outputs.diff_statistics_exit_code != '0'
run: exit 1
2 changes: 1 addition & 1 deletion .github/workflows/ty-ecosystem-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

cd ..

uv tool install "git+https://github.com/astral-sh/ecosystem-analyzer@2907323c61016ffd2cab9c25fb255f3dab8ec256"
uv tool install "git+https://github.com/astral-sh/ecosystem-analyzer@cc6b94ac6d40d7c1cbf891ce48245d6b69e5631b"

ecosystem-analyzer \
--verbose \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,14 @@ Using `Concatenate` as the first argument to `Callable`:
from typing_extensions import Callable, Concatenate

def _(c: Callable[Concatenate[int, str, ...], int]):
# TODO: Should reveal the correct signature
reveal_type(c) # revealed: (...) -> int
reveal_type(c) # revealed: (int, str, /, *args: Any, **kwargs: Any) -> int
```

Other type expressions can be nested inside `Concatenate`:

```py
def _(c: Callable[[Concatenate[int | str, type[str], ...], int], int]):
# TODO: Should reveal the correct signature
reveal_type(c) # revealed: (...) -> int
def _(c: Callable[Concatenate[int | str, type[str], ...], int]):
reveal_type(c) # revealed: (int | str, type[str], /, *args: Any, **kwargs: Any) -> int
```

But providing fewer than 2 arguments to `Concatenate` is an error:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _(
a: Unpack, # error: [invalid-type-form] "`typing.Unpack` requires exactly one argument when used in a type expression"
b: TypeGuard, # error: [invalid-type-form] "`typing.TypeGuard` requires exactly one argument when used in a type expression"
c: TypeIs, # error: [invalid-type-form] "`typing.TypeIs` requires exactly one argument when used in a type expression"
d: Concatenate, # error: [invalid-type-form] "`typing.Concatenate` requires at least two arguments when used in a type expression"
d: Concatenate, # error: [invalid-type-form] "`typing.Concatenate` is not allowed in this context in a type expression"
e: ParamSpec,
f: Generic, # error: [invalid-type-form] "`typing.Generic` is not allowed in type expressions"
) -> None:
Expand Down
2 changes: 1 addition & 1 deletion crates/ty_python_semantic/resources/mdtest/final.md
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ class Base(ABC):
@abstractproperty # error: [deprecated]
def value(self) -> int:
return 0

# error: [invalid-argument-type]
@abstractclassmethod # error: [deprecated]
def make(cls) -> "Base":
raise NotImplementedError
Expand Down
Loading
Loading