Skip to content

Commit

Permalink
Merge branch 'main' into Concatenate/typing-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Daraan authored Nov 27, 2024
2 parents ab01bf7 + f2d0667 commit 6c0c603
Show file tree
Hide file tree
Showing 5 changed files with 384 additions and 84 deletions.
126 changes: 53 additions & 73 deletions .github/workflows/third_party.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,27 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout pydantic
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
repository: pydantic/pydantic
- name: Edit pydantic pyproject.toml
# pydantic's python-requires means pdm won't let us add typing-extensions-latest
# as a requirement unless we do this
run: sed -i 's/^requires-python = .*/requires-python = ">=3.8"/' pyproject.toml
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Checkout pydantic
run: git clone --depth=1 https://github.com/pydantic/pydantic.git || git clone --depth=1 https://github.com/pydantic/pydantic.git
- name: Checkout typing_extensions
uses: actions/checkout@v4
with:
path: typing-extensions-latest
- name: Setup pdm for pydantic tests
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
allow-python-prereleases: true
- name: Add local version of typing_extensions as a dependency
run: pdm add ./typing-extensions-latest
run: cd pydantic; uv add --editable ../typing-extensions-latest
- name: Install pydantic test dependencies
run: pdm install -G testing -G email
run: cd pydantic; uv sync --group dev
- name: List installed dependencies
run: pdm list -vv # pdm equivalent to `pip list`
run: cd pydantic; uv pip list
- name: Run pydantic tests
run: pdm run pytest
run: cd pydantic; uv run pytest

typing_inspect:
name: typing_inspect tests
Expand All @@ -93,21 +89,18 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout typing_inspect
uses: actions/checkout@v4
with:
repository: ilevkivskyi/typing_inspect
path: typing_inspect
- name: Checkout typing_extensions
uses: actions/checkout@v4
with:
path: typing-extensions-latest
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Checkout typing_inspect
run: git clone --depth=1 https://github.com/ilevkivskyi/typing_inspect.git || git clone --depth=1 https://github.com/ilevkivskyi/typing_inspect.git
- name: Checkout typing_extensions
uses: actions/checkout@v4
with:
path: typing-extensions-latest
- name: Install typing_inspect test dependencies
run: |
set -x
Expand Down Expand Up @@ -141,22 +134,19 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Check out pyanalyze
uses: actions/checkout@v4
with:
repository: quora/pyanalyze
path: pyanalyze
- name: Checkout typing_extensions
uses: actions/checkout@v4
with:
path: typing-extensions-latest
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Check out pyanalyze
run: git clone --depth=1 https://github.com/quora/pyanalyze.git || git clone --depth=1 https://github.com/quora/pyanalyze.git
- name: Checkout typing_extensions
uses: actions/checkout@v4
with:
path: typing-extensions-latest
- name: Install pyanalyze test requirements
run: |
set -x
Expand Down Expand Up @@ -190,22 +180,19 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Check out typeguard
uses: actions/checkout@v4
with:
repository: agronholm/typeguard
path: typeguard
- name: Checkout typing_extensions
uses: actions/checkout@v4
with:
path: typing-extensions-latest
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Check out typeguard
run: git clone --depth=1 https://github.com/agronholm/typeguard.git || git clone --depth=1 https://github.com/agronholm/typeguard.git
- name: Checkout typing_extensions
uses: actions/checkout@v4
with:
path: typing-extensions-latest
- name: Install typeguard test requirements
run: |
set -x
Expand Down Expand Up @@ -240,21 +227,18 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Check out typed-argument-parser
uses: actions/checkout@v4
with:
repository: swansonk14/typed-argument-parser
path: typed-argument-parser
- name: Checkout typing_extensions
uses: actions/checkout@v4
with:
path: typing-extensions-latest
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Check out typed-argument-parser
run: git clone --depth=1 https://github.com/swansonk14/typed-argument-parser.git || git clone --depth=1 https://github.com/swansonk14/typed-argument-parser.git
- name: Checkout typing_extensions
uses: actions/checkout@v4
with:
path: typing-extensions-latest
- name: Configure git for typed-argument-parser tests
# typed-argument parser does this in their CI,
# and the tests fail unless we do this
Expand Down Expand Up @@ -295,22 +279,19 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout mypy for stubtest and mypyc tests
uses: actions/checkout@v4
with:
repository: python/mypy
path: mypy
- name: Checkout typing_extensions
uses: actions/checkout@v4
with:
path: typing-extensions-latest
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Checkout mypy for stubtest and mypyc tests
run: git clone --depth=1 https://github.com/python/mypy.git || git clone --depth=1 https://github.com/python/mypy.git
- name: Checkout typing_extensions
uses: actions/checkout@v4
with:
path: typing-extensions-latest
- name: Install mypy test requirements
run: |
set -x
Expand Down Expand Up @@ -346,30 +327,29 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout cattrs
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
repository: python-attrs/cattrs
python-version: ${{ matrix.python-version }}
- name: Checkout cattrs
run: git clone --depth=1 https://github.com/python-attrs/cattrs.git || git clone --depth=1 https://github.com/python-attrs/cattrs.git
- name: Checkout typing_extensions
uses: actions/checkout@v4
with:
path: typing-extensions-latest
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pdm for cattrs
run: pip install pdm
- name: Add latest typing-extensions as a dependency
run: |
cd cattrs
pdm remove typing-extensions
pdm add --dev ./typing-extensions-latest
pdm add --dev ../typing-extensions-latest
- name: Install cattrs test dependencies
run: pdm install --dev -G :all
run: cd cattrs; pdm install --dev -G :all
- name: List all installed dependencies
run: pdm list -vv
run: cd cattrs; pdm list -vv
- name: Run cattrs tests
run: pdm run pytest tests
run: cd cattrs; pdm run pytest tests

create-issue-on-failure:
name: Create an issue if daily tests failed
Expand Down Expand Up @@ -412,5 +392,5 @@ jobs:
owner: "python",
repo: "typing_extensions",
title: `Third-party tests failed on ${new Date().toDateString()}`,
body: "Runs listed here: https://github.com/python/typing_extensions/actions/workflows/third_party.yml",
body: "Full history of runs listed here: https://github.com/python/typing_extensions/actions/workflows/third_party.yml",
})
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ aliases that have a `Concatenate` special form as their argument.
`Ellipsis` as an argument. Patch by [Daraan](https://github.com/Daraan).
- Fix error in subscription of `Unpack` aliases causing nested Unpacks
to not be resolved correctly. Patch by [Daraan](https://github.com/Daraan).
- Backport CPython PR [#124795](https://github.com/python/cpython/pull/124795):
fix `TypeAliasType` not raising an error on non-tuple inputs for `type_params`.
Patch by [Daraan](https://github.com/Daraan).
- Fix that lists and ... could not be used for parameter expressions for `TypeAliasType`
instances before Python 3.11.
Patch by [Daraan](https://github.com/Daraan).

# Release 4.12.2 (June 7, 2024)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version = "4.12.2"
description = "Backported and Experimental Type Hints for Python 3.8+"
readme = "README.md"
requires-python = ">=3.8"
license = { file = "LICENSE" }
license = { text = "PSF-2.0" }
keywords = [
"annotations",
"backport",
Expand Down
Loading

0 comments on commit 6c0c603

Please sign in to comment.