From f67c70258d83a6db54f3136141be1151007c1403 Mon Sep 17 00:00:00 2001 From: Jean-Etienne Castagnede Date: Mon, 7 Oct 2024 16:00:45 +0200 Subject: [PATCH] Fix dependencies in python 3.10 (zoneinfo / tzdata) (#587) * dependencies in 3.10 --- CHANGES.md | 6 ++++++ Dockerfile | 9 ++++++--- docker-compose.yml | 5 +++-- requirements-dev.txt | 2 +- requirements.txt | 8 ++++++-- setup.py | 2 ++ 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 03de6d1f..801a82f0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,12 @@ CHANGELOG ========= +2.2.4 (2024-10-04) +------------------------- + +* Fix dependencies with python 3.10 + + 2.2.3 (2024-10-04) ------------------------- diff --git a/Dockerfile b/Dockerfile index cb366587..91e8f2eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,11 @@ -FROM ubuntu:jammy AS base +ARG BASE_IMAGE=jammy + +FROM ubuntu:${BASE_IMAGE} AS base ENV PYTHONUNBUFFERED=1 ENV DEBIAN_FRONTEND=noninteractive ENV LANG=C.UTF-8 +ENV TZ=UTC ENV COLLECTSTATIC=1 ENV TIMEOUT=60 ENV WORKERS=1 @@ -71,14 +74,14 @@ ARG NODE_ENV=production RUN apt-get -qq update && apt-get install -qq -y \ build-essential \ - python3.10-dev python3.10-venv python3.10-distutils libmagic1 && \ + python3-dev python3-venv python3-distutils libmagic1 && \ apt-get clean all && rm -rf /var/apt/lists/* && rm -rf /var/cache/apt/* # install pip & requirements RUN wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py && rm get-pip.py USER django -RUN python3.10 -m venv /app/venv +RUN python3 -m venv /app/venv RUN /app/venv/bin/pip3 install --no-cache-dir pip setuptools wheel -U COPY requirements.txt /app/ diff --git a/docker-compose.yml b/docker-compose.yml index 706492bb..34576273 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,12 @@ -version: '3.4' services: web: build: context: . target: dev args: - - NODE_ENV=development + NODE_ENV: development + BASE_IMAGE: focal + volumes: - ./src/:/app/src/ ports: diff --git a/requirements-dev.txt b/requirements-dev.txt index 3517fe7b..391b8a13 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -48,7 +48,7 @@ pyproject-hooks==1.0.0 # pip-tools python-magic==0.4.27 # via -r requirements-dev.in -sqlparse==0.5.0 +sqlparse==0.5.1 # via # -c ./requirements.txt # django diff --git a/requirements.txt b/requirements.txt index be6ec4f8..7115f3f7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,8 +6,10 @@ # asgiref==3.8.1 # via django -backports.zoneinfo==0.2.1;python_version<"3.9" - # via django +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # django + # screamshotter (setup.py) certifi==2024.8.30 # via # requests @@ -52,6 +54,8 @@ sqlparse==0.5.1 # via django typing-extensions==4.12.2 # via asgiref +tzdata==2024.2 + # via screamshotter (setup.py) uritemplate==4.1.1 # via coreapi urllib3==2.2.3 diff --git a/setup.py b/setup.py index f0a47ebb..04f07378 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,8 @@ scripts=['src/manage.py'], install_requires=[ 'django==4.2.*', + 'backports.zoneinfo==0.2.1;python_version<"3.9"', + 'tzdata', 'nodeenv', 'djangorestframework', 'coreapi',