From c5135fa2f075c2e8c800b63a856b9f3043a4089d Mon Sep 17 00:00:00 2001 From: Xavier Mitault Date: Tue, 8 Oct 2024 12:09:46 +0100 Subject: [PATCH] Remove uvloop (no available with python3.13 with hikari) --- Dockerfile | 2 +- pyproject.toml | 2 +- uv.lock | 18 ------------------ worldtimezone/__main__.py | 9 ++++++--- 4 files changed, 8 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 44e2e9d..1cc8c55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-slim-bookworm AS base +FROM python:3.13.0-slim-bookworm AS base RUN apt-get update -y \ && apt-get install -y gcc \ && rm -rf /var/lib/apt/lists/* diff --git a/pyproject.toml b/pyproject.toml index 2be07e4..f485b7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ "hikari[speedups]>=2.0.0", "peewee>=3.17.6", "pytz>=2024.1", - 'uvloop>=0.20.0 ; platform_system != "Windows"', + #'uvloop>=0.21.0 ; platform_system != "Windows"', ] [tool.basedpyright] diff --git a/uv.lock b/uv.lock index 1908618..0d30f90 100644 --- a/uv.lock +++ b/uv.lock @@ -396,8 +396,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/29/c5/7fcdf6564bfcfa75214ed16eb5b5d60a646010d08c6f4140209a6d0ffd93/pycares-4.4.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:64965dc19c578a683ea73487a215a8897276224e004d50eeb21f0bc7a0b63c88", size = 282138 }, { url = "https://files.pythonhosted.org/packages/53/6e/b5487ac50acdfbb8429de0fae2905807c892eec167929cb6326592cf9012/pycares-4.4.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:ed2a38e34bec6f2586435f6ff0bc5fe11d14bebd7ed492cf739a424e81681540", size = 260851 }, { url = "https://files.pythonhosted.org/packages/a6/55/e978a17db1eef47bf2b6b560b07b449e0aaf79e09580245f7316fbda5646/pycares-4.4.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:94d6962db81541eb0396d2f0dfcbb18cdb8c8b251d165efc2d974ae652c547d4", size = 283226 }, - { url = "https://files.pythonhosted.org/packages/c2/eb/ae8685a2900c3cf8c052df6536632b1025b7ad55e65d81b44c32385eb283/pycares-4.4.0-cp312-cp312-win32.whl", hash = "sha256:1168a48a834813aa80f412be2df4abaf630528a58d15c704857448b20b1675c0", size = 61542 }, - { url = "https://files.pythonhosted.org/packages/d3/72/e6af5a0670eb0b5beadef95479387af22b0ed7088e180677be04bf076476/pycares-4.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:db24c4e7fea4a052c6e869cbf387dd85d53b9736cfe1ef5d8d568d1ca925e977", size = 76252 }, ] [[package]] @@ -516,20 +514,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/97/3f/c4c51c55ff8487f2e6d0e618dba917e3c3ee2caae6cf0fbb59c9b1876f2e/tzlocal-5.2-py3-none-any.whl", hash = "sha256:49816ef2fe65ea8ac19d19aa7a1ae0551c834303d5014c6d5a62e4cbda8047b8", size = 17859 }, ] -[[package]] -name = "uvloop" -version = "0.20.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/bc/f1/dc9577455e011ad43d9379e836ee73f40b4f99c02946849a44f7ae64835e/uvloop-0.20.0.tar.gz", hash = "sha256:4603ca714a754fc8d9b197e325db25b2ea045385e8a3ad05d3463de725fdf469", size = 2329938 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2d/64/31cbd379d6e260ac8de3f672f904e924f09715c3f192b09f26cc8e9f574c/uvloop-0.20.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:4b75f2950ddb6feed85336412b9a0c310a2edbcf4cf931aa5cfe29034829676d", size = 1324302 }, - { url = "https://files.pythonhosted.org/packages/1e/6b/9207e7177ff30f78299401f2e1163ea41130d4fd29bcdc6d12572c06b728/uvloop-0.20.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:77fbc69c287596880ecec2d4c7a62346bef08b6209749bf6ce8c22bbaca0239e", size = 738105 }, - { url = "https://files.pythonhosted.org/packages/c1/ba/b64b10f577519d875992dc07e2365899a1a4c0d28327059ce1e1bdfb6854/uvloop-0.20.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6462c95f48e2d8d4c993a2950cd3d31ab061864d1c226bbf0ee2f1a8f36674b9", size = 4090658 }, - { url = "https://files.pythonhosted.org/packages/0a/f8/5ceea6876154d926604f10c1dd896adf9bce6d55a55911364337b8a5ed8d/uvloop-0.20.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:649c33034979273fa71aa25d0fe120ad1777c551d8c4cd2c0c9851d88fcb13ab", size = 4173357 }, - { url = "https://files.pythonhosted.org/packages/18/b2/117ab6bfb18274753fbc319607bf06e216bd7eea8be81d5bac22c912d6a7/uvloop-0.20.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:3a609780e942d43a275a617c0839d85f95c334bad29c4c0918252085113285b5", size = 4029868 }, - { url = "https://files.pythonhosted.org/packages/6f/52/deb4be09060637ef4752adaa0b75bf770c20c823e8108705792f99cd4a6f/uvloop-0.20.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:aea15c78e0d9ad6555ed201344ae36db5c63d428818b4b2a42842b3870127c00", size = 4115980 }, -] - [[package]] name = "worldtimezone" version = "0.1.0" @@ -542,7 +526,6 @@ dependencies = [ { name = "hikari-miru" }, { name = "peewee" }, { name = "pytz" }, - { name = "uvloop", marker = "platform_system != 'Windows'" }, ] [package.dev-dependencies] @@ -559,7 +542,6 @@ requires-dist = [ { name = "hikari-miru", specifier = ">=4.1.1" }, { name = "peewee", specifier = ">=3.17.6" }, { name = "pytz", specifier = ">=2024.1" }, - { name = "uvloop", marker = "platform_system != 'Windows'", specifier = ">=0.20.0" }, ] [package.metadata.requires-dev] diff --git a/worldtimezone/__main__.py b/worldtimezone/__main__.py index 10773ec..e2a38aa 100644 --- a/worldtimezone/__main__.py +++ b/worldtimezone/__main__.py @@ -8,9 +8,12 @@ from lightbulb.ext import tasks if os.name != "nt": - import uvloop - - asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) + try: + import uvloop + except ModuleNotFoundError: + pass + else: + asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) INTENTS = Intents.GUILD_MEMBERS | Intents.GUILDS