From b934e2bad9484fe97bfe461253ba03c81ead9e7c Mon Sep 17 00:00:00 2001 From: Probably Nate <159125401+Nebula434@users.noreply.github.com> Date: Sat, 21 Mar 2026 13:14:07 -0700 Subject: [PATCH 1/2] Python Version checker Purpose: Raise error before reaching the torch incompat with Python 3.13+ --- Backend/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Backend/main.py b/Backend/main.py index 7f46c7ae..4fc4541f 100644 --- a/Backend/main.py +++ b/Backend/main.py @@ -1,4 +1,13 @@ import os +import sys + + +#Version check before the code continues to mitigate torch incompat later on. +py_version = sys.version +if py_version != '3.12.0': + print(py_version) + raise Exception("Python Version must be 3.12.0 or earlier") + from dotenv import load_dotenv from flask import Flask, jsonify, request From 2067ada5cfcd283866ce3b30dcbdf6c328b0e19b Mon Sep 17 00:00:00 2001 From: Probably Nate <159125401+Nebula434@users.noreply.github.com> Date: Sat, 21 Mar 2026 13:23:37 -0700 Subject: [PATCH 2/2] Python Version Adjustments This to correlate with existing version checker. Clearly shows what version is needed to avoid confusion. --- AGENTS.md | 2 +- Backend/db.py | 1 + Backend/gpt.py | 1 + Backend/logstream.py | 1 + Backend/main.py | 9 ++++++--- Backend/models.py | 1 + Backend/pipeline.py | 1 + Backend/repository.py | 1 + Backend/search.py | 1 + Backend/tiktokvoice.py | 2 +- Backend/utils.py | 1 + Backend/video.py | 1 + Backend/worker.py | 1 + Backend/youtube.py | 1 + pyproject.toml | 2 +- 15 files changed, 20 insertions(+), 6 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 04259aa6..01d68d08 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,7 +20,7 @@ Follow it before making changes. ## 3) Environment and Setup Commands -- Python version: `>=3.11` (from `pyproject.toml`). +- Python version: `>=3.12` (from `pyproject.toml`). - Dependency manager used in docs: `uv`. - Create local env file: `cp .env.example .env`. - Install dependencies: `uv sync`. diff --git a/Backend/db.py b/Backend/db.py index f2f373b7..10a61e05 100644 --- a/Backend/db.py +++ b/Backend/db.py @@ -1,3 +1,4 @@ +#Requires Python 3.12 or sooner import os from sqlalchemy import create_engine diff --git a/Backend/gpt.py b/Backend/gpt.py index d2bef57d..c9d8b1b6 100644 --- a/Backend/gpt.py +++ b/Backend/gpt.py @@ -1,3 +1,4 @@ +#Requires Python 3.12 or sooner import re import os import json diff --git a/Backend/logstream.py b/Backend/logstream.py index 22fb6cb7..74630282 100644 --- a/Backend/logstream.py +++ b/Backend/logstream.py @@ -1,3 +1,4 @@ +#Requires Python 3.12 or sooner import json import queue import re diff --git a/Backend/main.py b/Backend/main.py index 4fc4541f..99ce6376 100644 --- a/Backend/main.py +++ b/Backend/main.py @@ -4,9 +4,12 @@ #Version check before the code continues to mitigate torch incompat later on. py_version = sys.version -if py_version != '3.12.0': - print(py_version) - raise Exception("Python Version must be 3.12.0 or earlier") +print(py_version) +if '3.11' or '3.12' in py_version: + pass +if '3.13' in py_version: + raise Exception("Need Python Version 3.12 or 3.11") + from dotenv import load_dotenv diff --git a/Backend/models.py b/Backend/models.py index 88b63230..26ad864d 100644 --- a/Backend/models.py +++ b/Backend/models.py @@ -1,3 +1,4 @@ +#Requires Python 3.12 or sooner from datetime import datetime from typing import Optional diff --git a/Backend/pipeline.py b/Backend/pipeline.py index 43180ee1..4d456de3 100644 --- a/Backend/pipeline.py +++ b/Backend/pipeline.py @@ -1,3 +1,4 @@ +#Requires Python 3.12 or sooner import os import shutil import subprocess diff --git a/Backend/repository.py b/Backend/repository.py index 0ef4f38a..f0cd7b60 100644 --- a/Backend/repository.py +++ b/Backend/repository.py @@ -1,3 +1,4 @@ +#Requires Python 3.12 or sooner from datetime import datetime, timezone from typing import Optional from uuid import uuid4 diff --git a/Backend/search.py b/Backend/search.py index bbfe59d5..68482580 100644 --- a/Backend/search.py +++ b/Backend/search.py @@ -1,3 +1,4 @@ +#Requires Python 3.12 or sooner import requests from typing import List diff --git a/Backend/tiktokvoice.py b/Backend/tiktokvoice.py index 86fa7e60..da319b7c 100644 --- a/Backend/tiktokvoice.py +++ b/Backend/tiktokvoice.py @@ -3,7 +3,7 @@ # topic: TikTok-Voice-TTS # version: 1.0 # credits: https://github.com/oscie57/tiktok-voice - +#Requires Python 3.12 or sooner # --- MODIFIED VERSION --- # import base64 diff --git a/Backend/utils.py b/Backend/utils.py index e52ad175..e5e415d6 100644 --- a/Backend/utils.py +++ b/Backend/utils.py @@ -1,3 +1,4 @@ +#Requires Python 3.12 or sooner import os import sys import random diff --git a/Backend/video.py b/Backend/video.py index 9775db36..a2210719 100644 --- a/Backend/video.py +++ b/Backend/video.py @@ -1,3 +1,4 @@ +#Requires Python 3.12 or sooner import os import uuid diff --git a/Backend/worker.py b/Backend/worker.py index a638eb2e..421df6d2 100644 --- a/Backend/worker.py +++ b/Backend/worker.py @@ -1,3 +1,4 @@ +#Requires Python 3.12 or sooner import time from dotenv import load_dotenv diff --git a/Backend/youtube.py b/Backend/youtube.py index 4a09dec2..ef2b8feb 100644 --- a/Backend/youtube.py +++ b/Backend/youtube.py @@ -1,3 +1,4 @@ +#Requires Python 3.12 or sooner import os import sys import time diff --git a/pyproject.toml b/pyproject.toml index de7414a4..a7525a88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "moneyprinter" version = "1.0.0" description = "Automate the creation of YouTube Shorts by providing a video topic." readme = "README.md" -requires-python = ">=3.11" +requires-python = "<=3.12.0" dependencies = [ "requests==2.31.0", "ollama==0.5.1",