From f1ac82c2d2121f37ece23ab3606345c5ebe31432 Mon Sep 17 00:00:00 2001
From: Erwan Rouchet <rouchet@teklia.com>
Date: Thu, 13 Feb 2025 17:01:52 +0000
Subject: [PATCH] Switch to Python 3.12

---
 .gitlab-ci.yml                        | 6 +++---
 Dockerfile                            | 4 ++--
 arkindex/documents/export/__init__.py | 2 +-
 base/Dockerfile                       | 2 +-
 base/requirements.txt                 | 6 ++----
 requirements.txt                      | 6 ++----
 setup.py                              | 2 +-
 7 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6183a928f0..571548691a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,7 +11,7 @@ include:
 
 # For jobs that run backend scripts directly
 .backend-setup:
-  image: registry.gitlab.teklia.com/arkindex/backend/base:psycopg3
+  image: registry.gitlab.teklia.com/arkindex/backend/base:python3.12
 
   cache:
     paths:
@@ -61,7 +61,7 @@ backend-tests:
     - arkindex test
 
 backend-lint:
-  image: python:3.10
+  image: python:3.12
   stage: test
 
   except:
@@ -159,7 +159,7 @@ backend-build:
 backend-build-binary:
   stage: build
 
-  image: python:3.10
+  image: python:3.12
 
   before_script:
     - pip install nuitka
diff --git a/Dockerfile b/Dockerfile
index b1092bf632..9ebc012df1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,11 +1,11 @@
 # syntax=docker/dockerfile:1
-FROM registry.gitlab.teklia.com/arkindex/backend/base:psycopg3 AS build
+FROM registry.gitlab.teklia.com/arkindex/backend/base:python3.12 AS build
 
 RUN mkdir build
 ADD . build
 RUN cd build && python3 setup.py sdist
 
-FROM registry.gitlab.teklia.com/arkindex/backend/base:psycopg3
+FROM registry.gitlab.teklia.com/arkindex/backend/base:python3.12
 
 # Install arkindex and its deps
 # Uses a source archive instead of full local copy to speedup docker build
diff --git a/arkindex/documents/export/__init__.py b/arkindex/documents/export/__init__.py
index bd51e010f4..cdf88ee5ec 100644
--- a/arkindex/documents/export/__init__.py
+++ b/arkindex/documents/export/__init__.py
@@ -86,7 +86,7 @@ def save_sqlite(rows, table, cursor):
             return float(value)
 
         # Show very explicit error messages if we stumble upon an unexpected type
-        # https://docs.python.org/3.10/library/sqlite3.html#sqlite-and-python-types
+        # https://docs.python.org/3.12/library/sqlite3.html#sqlite-and-python-types
         assert value is None or isinstance(value, (int, float, str, bytes)), f"Type {type(value)} is not supported by sqlite3"
 
         return value
diff --git a/base/Dockerfile b/base/Dockerfile
index 5bf809476c..1efe60a29f 100644
--- a/base/Dockerfile
+++ b/base/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.10-slim-bookworm
+FROM python:3.12-slim-bookworm
 
 # Install some runtime deps and python dependencies that are slow to install or require specific build deps
 ADD requirements.txt bootstrap.sh /
diff --git a/base/requirements.txt b/base/requirements.txt
index 1ff54d70b0..691940d4e5 100644
--- a/base/requirements.txt
+++ b/base/requirements.txt
@@ -1,5 +1,3 @@
-boto3==1.18.13
-cryptography==3.4.7
+boto3==1.36.16
+cryptography==44.0.1
 Django==5.0.8
-ed25519==1.5
-lxml==4.9.2
diff --git a/requirements.txt b/requirements.txt
index 811e308e35..0deadcac3b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,5 @@
 # -r ./base/requirements.txt
 
-
 bleach==6.0.0
 django-admin-hstore-widget==1.2.1
 django-cors-headers==3.14.0
@@ -8,13 +7,12 @@ django-enumfields2==3.0.2
 django-pgtrigger==4.7.0
 django-rq==2.10.1
 djangorestframework==3.15.2
-djangorestframework-simplejwt==5.2.2
+djangorestframework-simplejwt==5.4.0
 docker==7.0.0
 drf-spectacular==0.27.2
 psycopg[binary]==3.2.4
 python-magic==0.4.27
 python-memcached==1.59
-PyYAML==6.0
 requests==2.28.2
 rq==1.16.0
 sentry-sdk==2.7.1
@@ -23,4 +21,4 @@ SolrClient==0.3.1
 teklia-toolbox==0.1.3
 tenacity==8.2.2
 uritemplate==4.1.1
-zstandard==0.20.0
+zstandard==0.23.0
diff --git a/setup.py b/setup.py
index fdd40bb80d..6dce684b6c 100755
--- a/setup.py
+++ b/setup.py
@@ -30,7 +30,7 @@ setup(
     license_files=("LICENSE",),
     description="Manuscripts indexation framework",
     author="Teklia",
-    author_email="abadie@teklia.com",
+    author_email="contact@teklia.com",
     url="https://arkindex.teklia.com",
     python_requires=">=3.10",
     install_requires=install_requires,
-- 
GitLab