From 980b4c55b28e02346dd47f6e02ede490534c8e10 Mon Sep 17 00:00:00 2001 From: Dan Parizher <105245560+danparizher@users.noreply.github.com> Date: Wed, 29 Oct 2025 17:37:39 -0400 Subject: [PATCH] [`ruff-ecosystem`] Fix CLI crash on Python 3.14 (#21092) --- .github/workflows/ci.yaml | 3 +-- python/ruff-ecosystem/ruff_ecosystem/cli.py | 3 ++- scripts/check_ecosystem.py | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7541b715a4..806949d81e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -531,8 +531,7 @@ jobs: persist-credentials: false - uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0 with: - # TODO: figure out why `ruff-ecosystem` crashes on Python 3.14 - python-version: "3.13" + python-version: ${{ env.PYTHON_VERSION }} activate-environment: true - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 diff --git a/python/ruff-ecosystem/ruff_ecosystem/cli.py b/python/ruff-ecosystem/ruff_ecosystem/cli.py index 6dda945a4b..b996504c22 100644 --- a/python/ruff-ecosystem/ruff_ecosystem/cli.py +++ b/python/ruff-ecosystem/ruff_ecosystem/cli.py @@ -87,7 +87,8 @@ def entrypoint(): ) with cache_context as cache: - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) main_task = asyncio.ensure_future( main( command=RuffCommand(args.ruff_command), diff --git a/scripts/check_ecosystem.py b/scripts/check_ecosystem.py index 824cdcc217..00b691dc51 100755 --- a/scripts/check_ecosystem.py +++ b/scripts/check_ecosystem.py @@ -528,7 +528,8 @@ if __name__ == "__main__": else: logging.basicConfig(level=logging.INFO) - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) if args.checkouts: args.checkouts.mkdir(exist_ok=True, parents=True) main_task = asyncio.ensure_future(