update to python3.12

This commit is contained in:
Aarni Halinen
2025-02-09 19:47:10 +02:00
parent 8fc3ee534d
commit f0a5b6e8e7
8 changed files with 1151 additions and 944 deletions
+5 -5
View File
@@ -20,20 +20,20 @@ install:
expire_in: 1 week expire_in: 1 week
audit: audit:
image: python:3.9 image: python:3.12.9
stage: audit stage: audit
only: only:
- pushes - pushes
needs: [] needs: []
before_script: before_script:
- pip install poetry==1.3.1 - pip install poetry==2.0.1
- poetry config virtualenvs.create false - poetry config virtualenvs.create false
- poetry install --no-interaction --no-ansi - poetry install --no-interaction --no-ansi
script: script:
- safety check - safety check
test: test:
image: python:3.9 image: python:3.12.9
stage: test stage: test
only: only:
- pushes - pushes
@@ -47,7 +47,7 @@ test:
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB" DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
DB_HOST: postgres DB_HOST: postgres
before_script: before_script:
- pip install poetry==1.3.1 - pip install poetry==2.0.1
- poetry config virtualenvs.create false - poetry config virtualenvs.create false
- poetry install --no-interaction --no-ansi - poetry install --no-interaction --no-ansi
script: script:
@@ -56,7 +56,7 @@ test:
- python manage.py test - python manage.py test
lint:py: lint:py:
image: python:3.9 image: python:3.12.9
stage: lint stage: lint
only: only:
- pushes - pushes
+1
View File
@@ -0,0 +1 @@
20.15.0
+1 -1
View File
@@ -1 +1 @@
3.9 3.12.9
+4 -3
View File
@@ -1,13 +1,14 @@
FROM python:3.9-slim-buster AS builder FROM python:3.12.9-slim-bullseye AS builder
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
COPY . ./ COPY . ./
ENV POETRY_VERSION=1.3.1 ENV POETRY_VERSION=2.0.1
RUN pip install "poetry==$POETRY_VERSION" RUN pip install "poetry==$POETRY_VERSION"
RUN poetry self add poetry-plugin-export
RUN poetry export --without-hashes > requirements.txt RUN poetry export --without-hashes > requirements.txt
FROM python:3.9-slim-buster AS server FROM python:3.12.9-slim-bullseye AS server
WORKDIR /app WORKDIR /app
COPY . ./ COPY . ./
+3 -3
View File
@@ -31,13 +31,13 @@ For depedencies and virtual environment, we use [poetry](https://python-poetry.o
First install [python](https://wiki.python.org/moin/BeginnersGuide/Download). Then install poetry: First install [python](https://wiki.python.org/moin/BeginnersGuide/Download). Then install poetry:
```bash ```bash
python3 -m pip install poetry==1.3.1 python -m pip install poetry==2.0.1
``` ```
The easiest integration with VSCode is to have poetry install virtual environment in project folder, configured with CMD The easiest integration with VSCode is to have poetry install virtual environment in project folder, configured with CMD
```bash ```bash
python3 -m poetry config virtualenvs.in-project true python -m poetry config virtualenvs.in-project true
``` ```
### Node ### Node
@@ -65,7 +65,7 @@ docker run --name sik.web.db -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postg
Activate virtual environment in shell Activate virtual environment in shell
```bash ```bash
python3 -m poetry shell eval $(python -m poetry env activate)
``` ```
Install dependencies Install dependencies
Generated
+961 -767
View File
File diff suppressed because it is too large Load Diff
+15 -4
View File
@@ -1,11 +1,22 @@
[tool.poetry] [project]
name = "web2.0-backend" name = "web2.0-backend"
version = "0.1.0" version = "0.1.0"
description = "Backend for sahkoinsinoorikilta.fi" description = "Backend for sahkoinsinoorikilta.fi"
authors = ["Aarni Halinen aarni.halinen@sahkoinsinoorikilta.fi"] authors = [
{ name="Aarni Halinen", email="aarni.halinen@sahkoinsinoorikilta.fi"}
]
readme = "README.md"
requires-python = ">=3.12"
[tool.poetry]
package-mode = false
[tool.poetry.requires-plugins]
poetry-plugin-export = "^1.9"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.9" python = "^3.12"
decorator = "^4.0.9" decorator = "^4.0.9"
Django = "^4.1" Django = "^4.1"
requests = "^2.28.1" requests = "^2.28.1"
@@ -28,7 +39,7 @@ django-filter = "^22.1"
whitenoise = "^6.2.0" whitenoise = "^6.2.0"
jsonschema = "^4.9.0" jsonschema = "^4.9.0"
Markdown = "^3.2.2" Markdown = "^3.2.2"
uWSGI = "^2.0.18" uWSGI = "^2.0.28"
gunicorn = "^20.1.0" gunicorn = "^20.1.0"
Pillow = "^10.0.0" Pillow = "^10.0.0"
sendgrid = "^6.7.0" sendgrid = "^6.7.0"
+1 -1
View File
@@ -12,5 +12,5 @@
"reportMissingImports": true, "reportMissingImports": true,
"reportMissingTypeStubs": false, "reportMissingTypeStubs": false,
"pythonVersion": "3.9" "pythonVersion": "3.12.9"
} }