File tree Expand file tree Collapse file tree 3 files changed +12
-14
lines changed
exasol/toolbox/util/dependencies Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 11# Unreleased
22
3+ ## Refactoring
4+ * Switched deprecated Pydantic class-based ` config ` to ` ConfigDict `
5+
36## Security
4- * #477 : Switched ` sonar:check ` to use ` SONAR_TOKEN ` from the environment
7+ * #477 : Switched ` sonar:check ` to use ` SONAR_TOKEN ` from the environment
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3- import re
43import subprocess
5- import sys
64from pathlib import Path
75from typing import Optional
86
97import tomlkit
108from pydantic import (
119 BaseModel ,
10+ ConfigDict ,
1211)
1312from tomlkit import TOMLDocument
1413
1514from exasol .toolbox .util .dependencies .shared_models import Package
1615
1716
1817class PoetryGroup (BaseModel ):
18+ model_config = ConfigDict (frozen = True )
19+
1920 name : str
2021 toml_section : Optional [str ]
2122
22- class Config :
23- frozen = True
24-
2523
2624TRANSITIVE_GROUP = PoetryGroup (name = "transitive" , toml_section = None )
2725
2826
2927class PoetryToml (BaseModel ):
30- content : TOMLDocument
28+ model_config = ConfigDict ( frozen = True , arbitrary_types_allowed = True )
3129
32- class Config :
33- frozen = True
34- arbitrary_types_allowed = True
30+ content : TOMLDocument
3531
3632 @classmethod
3733 def load_from_toml (cls , working_directory : Path ) -> PoetryToml :
Original file line number Diff line number Diff line change 33from packaging .version import Version
44from pydantic import (
55 BaseModel ,
6+ ConfigDict ,
67 field_validator ,
78)
89
910
1011class Package (BaseModel ):
12+ model_config = ConfigDict (frozen = True , arbitrary_types_allowed = True )
13+
1114 name : str
1215 version : Version
1316
14- class Config :
15- frozen = True
16- arbitrary_types_allowed = True
17-
1817 @field_validator ("version" , mode = "before" )
1918 def convert_version (cls , v : str ) -> Version :
2019 return Version (v )
You can’t perform that action at this time.
0 commit comments