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
audit:
image: python:3.9
image: python:3.12.9
stage: audit
only:
- pushes
needs: []
before_script:
- pip install poetry==1.3.1
- pip install poetry==2.0.1
- poetry config virtualenvs.create false
- poetry install --no-interaction --no-ansi
script:
- safety check
test:
image: python:3.9
image: python:3.12.9
stage: test
only:
- pushes
@@ -47,7 +47,7 @@ test:
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
DB_HOST: postgres
before_script:
- pip install poetry==1.3.1
- pip install poetry==2.0.1
- poetry config virtualenvs.create false
- poetry install --no-interaction --no-ansi
script:
@@ -56,7 +56,7 @@ test:
- python manage.py test
lint:py:
image: python:3.9
image: python:3.12.9
stage: lint
only:
- 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
COPY . ./
ENV POETRY_VERSION=1.3.1
ENV POETRY_VERSION=2.0.1
RUN pip install "poetry==$POETRY_VERSION"
RUN poetry self add poetry-plugin-export
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
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:
```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
```bash
python3 -m poetry config virtualenvs.in-project true
python -m poetry config virtualenvs.in-project true
```
### 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
```bash
python3 -m poetry shell
eval $(python -m poetry env activate)
```
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"
version = "0.1.0"
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]
python = "^3.9"
python = "^3.12"
decorator = "^4.0.9"
Django = "^4.1"
requests = "^2.28.1"
@@ -28,7 +39,7 @@ django-filter = "^22.1"
whitenoise = "^6.2.0"
jsonschema = "^4.9.0"
Markdown = "^3.2.2"
uWSGI = "^2.0.18"
uWSGI = "^2.0.28"
gunicorn = "^20.1.0"
Pillow = "^10.0.0"
sendgrid = "^6.7.0"
+1 -1
View File
@@ -12,5 +12,5 @@
"reportMissingImports": true,
"reportMissingTypeStubs": false,
"pythonVersion": "3.9"
"pythonVersion": "3.12.9"
}