Add Python 3.13 support with uuid7 backport compatibility

- Create uuid_compat.py module that provides uuid7 for Python <3.14
  using uuid_extensions package, and native uuid.uuid7 for Python 3.14+
- Update all model files and migrations to use archivebox.uuid_compat
- Add uuid7 conditional dependency in pyproject.toml for Python <3.14
- Update requires-python to >=3.13 (from >=3.14)
- Update GitHub workflows, lock_pkgs.sh to use Python 3.13
- Update tool configs (ruff, pyright, uv) for Python 3.13

This enables running ArchiveBox on Python 3.13 while maintaining
forward compatibility with Python 3.14's native uuid7 support.
This commit is contained in:
Claude
2025-12-27 01:07:30 +00:00
parent cff4077c23
commit ae2ab5b273
15 changed files with 51 additions and 27 deletions

12
pyproject.toml Normal file → Executable file
View File

@@ -1,7 +1,7 @@
[project]
name = "archivebox"
version = "0.9.0rc1"
requires-python = ">=3.14"
requires-python = ">=3.13"
description = "Self-hosted internet archiving solution."
authors = [{name = "Nick Sweeting", email = "pyproject.toml@archivebox.io"}]
license = {text = "MIT"}
@@ -22,6 +22,7 @@ classifiers = [
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
@@ -92,6 +93,9 @@ dependencies = [
### Binary/Package Management
"abx-pkg>=0.1.0", # for: detecting, versioning, and installing binaries via apt/brew/pip/npm
### UUID7 backport for Python <3.14
"uuid7>=0.1.0; python_version < '3.14'", # for: uuid7 support on Python 3.13 (provides uuid_extensions module)
]
[project.optional-dependencies]
@@ -161,7 +165,7 @@ dev-dependencies = [
]
[tool.uv.pip]
python-version = "3.14"
python-version = "3.13"
# compile-bytecode = true
[build-system]
@@ -175,7 +179,7 @@ package-dir = {"archivebox" = "archivebox"}
[tool.ruff]
line-length = 140
target-version = "py314"
target-version = "py313"
src = ["archivebox"]
exclude = ["*.pyi", "typings/", "migrations/"]
@@ -220,7 +224,7 @@ venv = ".venv"
# defineConstant = { DEBUG = true }
reportMissingImports = true
reportMissingTypeStubs = false
pythonVersion = "3.14"
pythonVersion = "3.13"
pythonPlatform = "Linux"