diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c2352f1..c53ff0c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python: ["3.10", "3.13"] + python: ["3.11", "3.13"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dde71ab..7b8ac51 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,7 +39,7 @@ There is no build step: the frontend is plain HTML/CSS/JS in `static/`. 2. Fork the repo and create a branch from `main`: `fix/modrinth-env`, `feat/server-pack-names`, `docs/wiki-typo` … 3. Keep the PR focused on one thing. Small PRs get reviewed faster. 4. Fill in the PR template checklist. -5. CI must be green (tests on Windows + Linux, Python 3.10 and 3.13). +5. CI must be green (tests on Windows + Linux, Python 3.11 and 3.13). 6. PRs are merged with **squash merge**. The PR title becomes the commit message, so please write it like one (see below). ## Commit / PR title style diff --git a/README.md b/README.md index 3307569..2d64bde 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Tests Latest release License: MIT - Python 3.10+ + Python 3.11+ CurseForge Modrinth Languages @@ -47,7 +47,7 @@ It runs on your own computer (`127.0.0.1`), talks only to the official CurseForg ## Quick start -You need **Python 3.10 or newer**. +You need **Python 3.11 or newer**. | Windows | Linux / macOS | |---|---| @@ -96,7 +96,7 @@ Issues, ideas, translations and pull requests are welcome. Please read [CONTRIBU ModFerry ist eine lokale Web-App, mit der du **viele Minecraft-Dateien auf einmal** zu **CurseForge** und/oder **Modrinth** hochlädst: Mods, Resourcepacks, Datapacks, Shaderpacks und Modpacks. Versionen, Loader und Java werden aus den Dateien gelesen (ohne zu raten), alles Weitere stellst du in einer Tabelle ein, einzeln oder per Batch. Dazu gibt es Profile, Changelog-Platzhalter, Trockenlauf, sichere Wiederholung fehlgeschlagener Uploads, einen Upload-Verlauf und verschlüsselt gespeicherte Tokens. Die Oberfläche gibt es auf Deutsch und Englisch. -**Start:** Python 3.10+ installieren, `start-windows.bat` bzw. `./start-linux.sh` ausführen, `http://127.0.0.1:8765` öffnen. Ausführliche Anleitung im [Wiki](../../wiki). +**Start:** Python 3.11+ installieren, `start-windows.bat` bzw. `./start-linux.sh` ausführen, `http://127.0.0.1:8765` öffnen. Ausführliche Anleitung im [Wiki](../../wiki). ## License diff --git a/app.py b/app.py index ef2f94e..6c6a213 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,10 @@ """ModFerry: local batch uploader for CurseForge and Modrinth. Run: python app.py""" +import sys + +if sys.version_info < (3, 11): + sys.exit("ModFerry needs Python 3.11 or newer (found %d.%d). Download: https://www.python.org/downloads/" + % sys.version_info[:2]) + import json import os import re diff --git a/jar_inspect.py b/jar_inspect.py index f066bfb..b3b8154 100644 --- a/jar_inspect.py +++ b/jar_inspect.py @@ -3,10 +3,7 @@ import re import zipfile from pathlib import Path -try: - import tomllib -except ImportError: - import tomli as tomllib +import tomllib # Minecraft 26.x uses a distinct two-part scheme; never infer MC from mod version. MC_VERSION = re.compile(r'(?=2.34.2,<3 cryptography>=50.0.2,<51 Markdown>=3.10.3,<4 bleach>=6.4.0,<7 -tomli>=2.5.0,<3; python_version < "3.11" diff --git a/start-linux.sh b/start-linux.sh index d39cd59..db5f7bb 100644 --- a/start-linux.sh +++ b/start-linux.sh @@ -3,6 +3,10 @@ set -e cd "$(dirname "$0")" [ -x .venv/bin/python ] || python3 -m venv .venv +if ! .venv/bin/python -c 'import sys; sys.exit(sys.version_info < (3, 11))'; then + echo "ModFerry needs Python 3.11 or newer. Install it, delete the .venv folder and start again." >&2 + exit 1 +fi .venv/bin/python -m pip install --disable-pip-version-check -q -r requirements.txt PORT="${MODFERRY_PORT:-8765}" URL="http://127.0.0.1:${PORT}" diff --git a/start-windows.bat b/start-windows.bat index ea874d4..076ff30 100644 --- a/start-windows.bat +++ b/start-windows.bat @@ -3,8 +3,10 @@ title ModFerry cd /d "%~dp0" if not exist .venv\Scripts\python.exe ( py -3 -m venv .venv - if errorlevel 1 (echo Python 3.10+ is required: https://www.python.org/downloads/ & pause & exit /b 1) + if errorlevel 1 (echo Python 3.11+ is required: https://www.python.org/downloads/ & pause & exit /b 1) ) +.venv\Scripts\python.exe -c "import sys; sys.exit(sys.version_info < (3, 11))" +if errorlevel 1 (echo The .venv folder uses an older Python. Install Python 3.11+, delete the .venv folder and start again. & pause & exit /b 1) .venv\Scripts\python.exe -m pip install --disable-pip-version-check -q -r requirements.txt if errorlevel 1 (echo Installation failed. & pause & exit /b 1) if "%MODFERRY_PORT%"=="" set MODFERRY_PORT=8765 diff --git a/wiki/Development.md b/wiki/Development.md index 03dced5..30db091 100644 --- a/wiki/Development.md +++ b/wiki/Development.md @@ -11,7 +11,7 @@ python -m unittest discover -s tests -v python app.py ``` -Use `MODFERRY_DATA` with a scratch folder while developing so your real tokens and profiles stay untouched. The tests do this automatically. CI runs the tests on Windows and Ubuntu with Python 3.10 and 3.13. +Use `MODFERRY_DATA` with a scratch folder while developing so your real tokens and profiles stay untouched. The tests do this automatically. CI runs the tests on Windows and Ubuntu with Python 3.11 and 3.13. ## Layout @@ -74,7 +74,7 @@ To build a ZIP locally: `python tools/make_release.py` (version from `git descri | Workflow | When | What | |---|---|---| -| Tests | every PR, every push to `main`, before a release | unit tests on Windows + Linux, Python 3.10 and 3.13 | +| Tests | every PR, every push to `main`, before a release | unit tests on Windows + Linux, Python 3.11 and 3.13 | | Release | a release is published | tests, build the ZIP with the tag's version, attach it | | PR labels | PR opened or title edited | label from the title type (`feat:`, `fix:`, …) | | Dependabot auto-merge | Dependabot PR for minor/patch updates | enables auto-merge; GitHub merges once the tests are green | diff --git a/wiki/Installation.md b/wiki/Installation.md index 4103fe0..b12f523 100644 --- a/wiki/Installation.md +++ b/wiki/Installation.md @@ -2,7 +2,7 @@ ## Requirements -- **Python 3.10 or newer**: [python.org/downloads](https://www.python.org/downloads/). On Windows, keep the `py` launcher option enabled during setup. +- **Python 3.11 or newer**: [python.org/downloads](https://www.python.org/downloads/). On Windows, keep the `py` launcher option enabled during setup. - An internet connection on the first start (to install the dependencies). - A modern browser. diff --git a/wiki/Troubleshooting.md b/wiki/Troubleshooting.md index d28c225..356aec9 100644 --- a/wiki/Troubleshooting.md +++ b/wiki/Troubleshooting.md @@ -6,7 +6,8 @@ Run a **🔍 Dry run** first: most problems show up there with a clear message. | Problem | Fix | |---|---| -| "Python 3.10+ is required" | Install Python from python.org; on Windows make sure the `py` launcher is installed. | +| "Python 3.11+ is required" | Install Python from python.org; on Windows make sure the `py` launcher is installed. | +| "The .venv folder uses an older Python" / "ModFerry needs Python 3.11 or newer" | ModFerry was set up with an older Python before. Install Python 3.11+, delete the `.venv` folder and start again. | | Installation of dependencies fails | Check your internet connection / proxy and start again. | | Port already in use | Another ModFerry is running, or use a different port: [[Configuration]]. | | "Only local access is allowed" | Open `http://127.0.0.1:8765` or `http://localhost:8765`, not your computer's network name. |