Skip to content

Commit 2a32636

Browse files
lets pray 🙏
1 parent 23f0307 commit 2a32636

15 files changed

Lines changed: 583 additions & 541 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
id: setup-python
2222
uses: actions/setup-python@v4
2323
with:
24-
python-version: "3.10"
24+
python-version: "3.14"
2525

2626
- name: Install pre-commit
2727
run: pip install pre-commit

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
rev: v4.4.0
66
hooks:
77
- id: check-ast
8-
language_version: python3.10
8+
language_version: python3.14
99
- id: check-merge-conflict
1010
- id: check-case-conflict
1111
- id: check-json
@@ -35,7 +35,7 @@ repos:
3535
rev: 23.7.0
3636
hooks:
3737
- id: black
38-
language_version: python3.10
38+
language_version: python3.14
3939
args: [--target-version, py310]
4040
files: ^src/.*\.py$
4141
exclude: ^src/dmss_api/

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10-slim as base
1+
FROM python:3.14-slim AS base
22
ENV PYTHONUNBUFFERED=1
33
ENV PYTHONPATH=/code/src
44
WORKDIR /code
@@ -14,7 +14,7 @@ RUN pip install --upgrade pip && \
1414

1515
COPY pyproject.toml poetry.lock ./
1616

17-
FROM base as development
17+
FROM base AS development
1818
RUN poetry install
1919
WORKDIR /code/src
2020
COPY src /code/src/
@@ -23,7 +23,7 @@ COPY .flake8 .bandit ./
2323
RUN chown -R 1000:1000 /code/app/
2424
USER 0
2525

26-
FROM base as prod
26+
FROM base AS prod
2727
RUN poetry install --without dev
2828
WORKDIR /code/src
2929
COPY src /code/src/

poetry.lock

Lines changed: 526 additions & 484 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@ requires-poetry = ">=2.0"
1010
package-mode = false
1111

1212
[tool.poetry.dependencies]
13-
python = "^3.10.4"
14-
redis = "^5.0.5"
15-
APScheduler = "^3.10.4"
13+
python = "^3.14"
14+
redis = "^7.2.1"
15+
APScheduler = "^3.11.2"
1616
docker = "^7.1.0"
17-
fastapi = "0.92.0" # Migrate to pydantic V2 before upgrading
18-
uvicorn = "^0.30.1"
17+
fastapi = "^0.135.1"
18+
uvicorn = "^0.41.0"
1919
azure-mgmt-containerinstance = "^10.1.0"
20-
azure-mgmt-resource = "^23.1.1"
21-
azure-identity = "^1.16.1"
20+
azure-mgmt-resource = "^25.0.0"
21+
azure-identity = "^1.25.2"
2222
dm-cli = "^1.7.1"
23-
azure-monitor-opentelemetry = "^1.2.0"
24-
opentelemetry-instrumentation-fastapi = "^0.43b0"
23+
azure-monitor-opentelemetry = "^1.8.6"
24+
opentelemetry-instrumentation-fastapi = "0.60b0"
2525

2626
[tool.poetry.group.dev.dependencies]
27-
pytest = "^7.2.1"
28-
pre-commit = "^3.3.3"
29-
flake8 = "^5.0.4"
30-
bandit = "^1.7.4"
31-
black = "^22.6.0"
32-
types-redis = "^4.3.21"
33-
httpx = "^0.23.3"
34-
icecream = "^2.1.3"
27+
pytest = "^9.0.2"
28+
pre-commit = "^4.5.1"
29+
flake8 = "^7.3.0"
30+
bandit = "^1.9.4"
31+
black = "^26.1.0"
32+
types-redis = "^4.6.0.20241004"
33+
httpx = "^0.28.1"
34+
icecream = "^2.1.10"
3535

3636
[tool.isort]
3737
profile = "black"
@@ -50,7 +50,7 @@ all=true
5050

5151
[tool.black]
5252
line-length = 119
53-
target-version = ['py10']
53+
target-version = ['py314']
5454
exclude = '''
5555
/(
5656
\.eggs

src/domain_classes/progress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pydantic.main import BaseModel
1+
from pydantic import BaseModel
22

33
from services.job_handler_interface import JobStatus
44

src/features/jobs/jobs.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def start(job_dmss_id: str):
3535
3636
The PROTOCOL is optional, and the default is dmss.
3737
"""
38-
return start_job_use_case(job_dmss_id=job_dmss_id).dict()
38+
return start_job_use_case(job_dmss_id=job_dmss_id).model_dump()
3939

4040

4141
@router.get("/{job_uid}", operation_id="job_status", response_model=StatusJobResponse)
@@ -45,7 +45,7 @@ def status(job_uid: UUID):
4545
4646
- **job_uid**: the job API's internal uid for the job.
4747
"""
48-
return status_job_use_case(job_id=job_uid).dict()
48+
return status_job_use_case(job_id=job_uid).model_dump()
4949

5050

5151
@router.delete("/{job_uid}", operation_id="remove_job", response_model=DeleteJobResponse)
@@ -56,7 +56,7 @@ def remove(job_uid: UUID):
5656
5757
- **job_uid**: the job API's internal uid for the job.
5858
"""
59-
return delete_job_use_case(job_id=job_uid).dict()
59+
return delete_job_use_case(job_id=job_uid).model_dump()
6060

6161

6262
@router.get("/{job_uid}/result", operation_id="job_result", response_model=GetJobResultResponse)
@@ -66,7 +66,7 @@ def result(job_uid: UUID):
6666
6767
- **job_uid**: the job API's internal uid for the job.
6868
"""
69-
return get_job_result_use_case(job_uid=job_uid).dict()
69+
return get_job_result_use_case(job_uid=job_uid).model_dump()
7070

7171

7272
@router.put("/{job_uid}", operation_id="update_job_progress", response_model=UpdateJobProgressResponse)
@@ -77,4 +77,6 @@ def progress(job_uid: UUID, overwrite_log: bool, job_progress: Progress):
7777
- **job_uid**: the job API's internal uid for the job.
7878
- **progress**: progress object with percentage and logs
7979
"""
80-
return update_job_progress_use_case(job_uid=job_uid, overwrite_log=overwrite_log, progress=job_progress).dict()
80+
return update_job_progress_use_case(
81+
job_uid=job_uid, overwrite_log=overwrite_log, progress=job_progress
82+
).model_dump()

src/features/jobs/use_cases/delete_job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from uuid import UUID
22

3-
from pydantic.main import BaseModel
3+
from pydantic import BaseModel
44

55
from services.job_handler_interface import JobStatus
66
from services.job_service import remove_job

src/features/jobs/use_cases/start_job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pydantic.main import BaseModel
1+
from pydantic import BaseModel
22

33
from services.job_handler_interface import JobStatus
44
from services.job_service import register_job

src/features/jobs/use_cases/status_job.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
from uuid import UUID
22

3-
from pydantic import BaseModel
3+
from pydantic import BaseModel, ConfigDict
44

55
from services.job_handler_interface import JobStatus
66
from services.job_service import status_job
77

88

99
class StatusJobResponse(BaseModel):
10+
model_config = ConfigDict(use_enum_values=True)
11+
1012
status: JobStatus
1113
log: list[str] | None
1214
percentage: float | None
1315

14-
class Config:
15-
use_enum_values = True
16-
1716

1817
def status_job_use_case(job_id: UUID) -> StatusJobResponse:
1918
status, log, percentage = status_job(job_id)

0 commit comments

Comments
 (0)