From 616c0f4a22c029cd31d95ff1b28be98110f51d18 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 1 Apr 2025 08:34:14 -0700 Subject: [PATCH 01/12] 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 02/12] 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 03/12] 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 04/12] 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 05/12] 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 06/12] 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 From da686cb5bc72d983fc7a6e24360d0c71eb6c4f34 Mon Sep 17 00:00:00 2001 From: Brian Schubert Date: Wed, 2 Apr 2025 12:33:02 -0400 Subject: [PATCH 07/12] Bump 3.{8,9,10}.0 to earliest versions supported by 22.04 runner Available versions listed here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44201cea..56026f23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,11 +39,11 @@ jobs: # https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json python-version: - "3.8" - - "3.8.0" + - "3.8.12" - "3.9" - - "3.9.0" + - "3.9.12" - "3.10" - - "3.10.0" + - "3.10.4" - "3.11" - "3.11.0" - "3.12" From 524a5c20a8586f29dd9f42b20a55e2415bc847ae Mon Sep 17 00:00:00 2001 From: Brian Schubert Date: Wed, 2 Apr 2025 12:34:39 -0400 Subject: [PATCH 08/12] Use 22.04 runner for SQLAlchemy tests --- .github/workflows/third_party.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/third_party.yml b/.github/workflows/third_party.yml index f946b765..5f444c9f 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-latest + runs-on: ubuntu-22.04 timeout-minutes: 60 steps: - name: Setup Python From 67205cb3b55f6779a1142a919976085b9fcdea7e Mon Sep 17 00:00:00 2001 From: Brian Schubert Date: Wed, 2 Apr 2025 13:17:03 -0400 Subject: [PATCH 09/12] Use ubuntu-latest --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56026f23..bda5f1ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: - "pypy3.9" - "pypy3.10" - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From bb7c7dd4021614e42fcd59a9a8eb07643469a51a Mon Sep 17 00:00:00 2001 From: Brian Schubert Date: Wed, 2 Apr 2025 13:24:25 -0400 Subject: [PATCH 10/12] Drop 3.8 --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bda5f1ee..dacd76c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,8 +38,6 @@ jobs: # For available versions, see: # https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json python-version: - - "3.8" - - "3.8.12" - "3.9" - "3.9.12" - "3.10" From 310393407b1dd697c4907067cb56dd30e965c0bd Mon Sep 17 00:00:00 2001 From: Brian Schubert Date: Wed, 2 Apr 2025 13:36:01 -0400 Subject: [PATCH 11/12] Leave test.support dependency for now This is not strictly required for the current workflow to work so might as well keep the status quo --- src/test_typing_extensions.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/test_typing_extensions.py b/src/test_typing_extensions.py index e8d07813..da4e3e44 100644 --- a/src/test_typing_extensions.py +++ b/src/test_typing_extensions.py @@ -8844,12 +8844,9 @@ def test_name_lookup_without_eval(self): self.assertIs(evaluate_forward_ref(typing.ForwardRef("int"), globals={"int": str}), str) import builtins - real_int = builtins.int - try: - builtins.int = dict + from test import support + with support.swap_attr(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 2e72d440e51759723ff0bbd6f6d2c110429cb3cb Mon Sep 17 00:00:00 2001 From: Brian Schubert Date: Wed, 2 Apr 2025 13:55:46 -0400 Subject: [PATCH 12/12] Re-add 3.8 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dacd76c2..d0ced0b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,7 @@ jobs: # For available versions, see: # https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json python-version: + - "3.8" - "3.9" - "3.9.12" - "3.10"