From 616c0f4a22c029cd31d95ff1b28be98110f51d18 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 1 Apr 2025 08:34:14 -0700 Subject: [PATCH 1/6] Move CI to "ubuntu-latest" GitHub is decommissioning Ubuntu 20.04. I wouldn't expect our tests to have a lot of OS version dependencies, so let's try just running ubuntu-latest everywhere. --- .github/workflows/ci.yml | 2 +- .github/workflows/third_party.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cbeaf5f..d9c17e25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: - "pypy3.9" - "pypy3.10" - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/third_party.yml b/.github/workflows/third_party.yml index 5f444c9f..f946b765 100644 --- a/.github/workflows/third_party.yml +++ b/.github/workflows/third_party.yml @@ -312,7 +312,7 @@ jobs: checkout-ref: [ "main", "rel_2_0" ] # sqlalchemy tests fail when using the Ubuntu 24.04 runner # https://github.com/sqlalchemy/sqlalchemy/commit/8d73205f352e68c6603e90494494ef21027ec68f - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: Setup Python From 29bde2dde26a09d49e80277ce704e04c51b71eb5 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 1 Apr 2025 08:41:22 -0700 Subject: [PATCH 2/6] try --- .github/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9c17e25..af034f1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,17 +60,16 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v5 + uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} - allow-prereleases: true - name: Test typing_extensions run: | # Be wary of running `pip install` here, since it becomes easy for us to # accidentally pick up typing_extensions as installed by a dependency cd src - python -m unittest test_typing_extensions.py + $UV_PYTHON -m unittest test_typing_extensions.py - name: Test CPython typing test suite # Test suite fails on PyPy even without typing_extensions @@ -79,7 +78,7 @@ jobs: cd src # Run the typing test suite from CPython with typing_extensions installed, # because we monkeypatch typing under some circumstances. - python -c 'import typing_extensions; import test.__main__' test_typing -v + $UV_PYTHON -c 'import typing_extensions; import test.__main__' test_typing -v linting: name: Lint From ae6f37a63197ca289bbae5681735ce73397c5e9a Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 1 Apr 2025 08:45:16 -0700 Subject: [PATCH 3/6] this way? --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af034f1f..f5f8bed2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,8 @@ jobs: # Be wary of running `pip install` here, since it becomes easy for us to # accidentally pick up typing_extensions as installed by a dependency cd src - $UV_PYTHON -m unittest test_typing_extensions.py + python --version + python -m unittest test_typing_extensions.py - name: Test CPython typing test suite # Test suite fails on PyPy even without typing_extensions @@ -78,7 +79,7 @@ jobs: cd src # Run the typing test suite from CPython with typing_extensions installed, # because we monkeypatch typing under some circumstances. - $UV_PYTHON -c 'import typing_extensions; import test.__main__' test_typing -v + python -c 'import typing_extensions; import test.__main__' test_typing -v linting: name: Lint From 2fc53d327047cff2709f8440530da61fcaba1711 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 1 Apr 2025 08:48:31 -0700 Subject: [PATCH 4/6] Do not depend on test.support --- src/test_typing_extensions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test_typing_extensions.py b/src/test_typing_extensions.py index da4e3e44..e8d07813 100644 --- a/src/test_typing_extensions.py +++ b/src/test_typing_extensions.py @@ -8844,9 +8844,12 @@ def test_name_lookup_without_eval(self): self.assertIs(evaluate_forward_ref(typing.ForwardRef("int"), globals={"int": str}), str) import builtins - from test import support - with support.swap_attr(builtins, "int", dict): + real_int = builtins.int + try: + builtins.int = dict self.assertIs(evaluate_forward_ref(typing.ForwardRef("int")), dict) + finally: + builtins.int = real_int def test_nested_strings(self): # This variable must have a different name TypeVar From 58b4ab2b0c59b59e8c793c4084e2cae1cb230dda Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 1 Apr 2025 08:50:46 -0700 Subject: [PATCH 5/6] Don't need cache --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5f8bed2..def2c235 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,7 @@ jobs: uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} + enable-cache: false - name: Test typing_extensions run: | From f91313caafc3805c796d6472344152d2dd78df40 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 1 Apr 2025 08:59:10 -0700 Subject: [PATCH 6/6] try 22.04 --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index def2c235..44201cea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,23 +54,23 @@ jobs: - "pypy3.9" - "pypy3.10" - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Set up Python - uses: astral-sh/setup-uv@v5 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - enable-cache: false + allow-prereleases: true - name: Test typing_extensions run: | # Be wary of running `pip install` here, since it becomes easy for us to # accidentally pick up typing_extensions as installed by a dependency cd src - python --version + python --version # just to make sure we're running the right one python -m unittest test_typing_extensions.py - name: Test CPython typing test suite