From 98ce18e73486f30d940862e335426029dcc2d967 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Sun, 4 May 2025 00:01:38 -0400 Subject: [PATCH 1/2] Bump Python to 3.12 --- .github/workflows/ci.yml | 22 +++++++++++----------- Dockerfile | 2 +- Pipfile | 2 +- Pipfile.lock | 12 ++---------- 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4db7c3706..6c157b02f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,10 +22,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python 3.11 + - name: Set up Python 2 uses: actions/setup-python@v3 with: - python-version: 3.11 + python-version: 3.12 - name: Install pip run: | python -m pip install pip==$(sed -nE 's/pip = "==(.*)"/\1/p' Pipfile) @@ -39,7 +39,7 @@ jobs: - name: Running pytest run: | cd techsupport_bot - python3.11 -m pytest tests/ -p no:warnings + python3.12 -m pytest tests/ -p no:warnings black: if: | @@ -55,10 +55,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v3 with: - python-version: 3.11 + python-version: 3.12 - name: Install dependencies run: | python -m pip install pip==$(sed -nE 's/pip = "==(.*)"/\1/p' Pipfile) @@ -82,10 +82,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v3 with: - python-version: 3.11 + python-version: 3.12 - name: Install dependencies run: | python -m pip install pip==$(sed -nE 's/pip = "==(.*)"/\1/p' Pipfile) @@ -135,10 +135,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v3 with: - python-version: 3.11 + python-version: 3.12 - name: Install dependencies run: | python -m pip install pip==$(sed -nE 's/pip = "==(.*)"/\1/p' Pipfile) @@ -162,10 +162,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v3 with: - python-version: 3.11 + python-version: 3.12 - name: Install dependencies run: | python -m pip install pip==$(sed -nE 's/pip = "==(.*)"/\1/p' Pipfile) diff --git a/Dockerfile b/Dockerfile index a2e00b958..6565403ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-alpine +FROM python:3.12-alpine RUN apk update RUN apk add --no-cache postgresql-dev gcc musl-dev libpq git diff --git a/Pipfile b/Pipfile index 1e5b19626..677b4dfaa 100644 --- a/Pipfile +++ b/Pipfile @@ -37,4 +37,4 @@ pyyaml = "==6.0.1" unidecode = "==1.4.0" [requires] -python_version = "3.11" +python_version = "3.12" diff --git a/Pipfile.lock b/Pipfile.lock index 5f001e7fd..0897b40f6 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "10bc1420d1536ca1722d14fea878db91ca5f5983e0c56c79baa475ddf8790c75" + "sha256": "142ce26df7574c371605117a698b99c9ca3df14a031702749ad3ac1d7b963764" }, "pipfile-spec": 6, "requires": { - "python_version": "3.11" + "python_version": "3.12" }, "sources": [ { @@ -350,14 +350,6 @@ "markers": "python_version >= '3.7'", "version": "==8.1.8" }, - "croniter": { - "hashes": [ - "sha256:2f878c3856f17896979b2a4379ba1f09c83e374931ea15cc835c5dd2eee9b368", - "sha256:37c504b313956114a983ece2c2b07790b1f1094fe9d81cc94739214748255577" - ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==6.0.0" - }, "cronsim": { "hashes": [ "sha256:5aab98716ef90ab5ac6be294b2c3965dbf76dc869f048846a0af74ebb506c10d", From 5d0b9859115284dfe0ec18c3ba682dc6d086d8ba Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Sun, 4 May 2025 13:13:04 -0400 Subject: [PATCH 2/2] Attempt to replace croniter with cronsim --- techsupport_bot/commands/factoids.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/techsupport_bot/commands/factoids.py b/techsupport_bot/commands/factoids.py index 07ac00e7c..b1f7a1f95 100644 --- a/techsupport_bot/commands/factoids.py +++ b/techsupport_bot/commands/factoids.py @@ -32,7 +32,7 @@ from aiohttp.client_exceptions import InvalidURL from botlogging import LogContext, LogLevel from core import auxiliary, cogs, custom_errors, extensionconfig -from croniter import CroniterBadCronError +import cronsim from discord import app_commands from discord.ext import commands @@ -1077,7 +1077,7 @@ async def cronjob( try: await aiocron.crontab(job.cron).next() - except CroniterBadCronError as exception: + except cronsim.CronSimError as exception: log_channel = None log_context = None