Skip to content

Commit 09d92a1

Browse files
committed
chore: update pydantic dependency to version 2.7.0
1 parent dd87778 commit 09d92a1

File tree

3 files changed

+71
-70
lines changed

3 files changed

+71
-70
lines changed

fortls/fortls.schema.json

+67-67
Original file line numberDiff line numberDiff line change
@@ -1,193 +1,193 @@
11
{
2-
"title": "fortls schema",
32
"description": "Schema for the fortls Fortran Language Server",
4-
"type": "object",
53
"properties": {
64
"config": {
7-
"title": "Config",
8-
"description": "Configuration options file (default file name: .fortlsrc, other default supported names: .fortls.json, .fortls)",
95
"default": ".fortlsrc",
6+
"description": "Configuration options file (default file name: .fortlsrc, other default supported names: .fortls.json, .fortls)",
7+
"title": "Config",
108
"type": "string"
119
},
1210
"nthreads": {
13-
"title": "Nthreads",
14-
"description": "Number of threads to use during workspace initialization (default: 4)",
1511
"default": 4,
12+
"description": "Number of threads to use during workspace initialization (default: 4)",
13+
"title": "Nthreads",
1614
"type": "integer"
1715
},
1816
"notify_init": {
19-
"title": "Notify Init",
20-
"description": "Send notification message when workspace initialization is complete",
2117
"default": false,
18+
"description": "Send notification message when workspace initialization is complete",
19+
"title": "Notify Init",
2220
"type": "boolean"
2321
},
2422
"incremental_sync": {
25-
"title": "Incremental Sync",
26-
"description": "Use incremental document synchronization (beta)",
2723
"default": false,
24+
"description": "Use incremental document synchronization (beta)",
25+
"title": "Incremental Sync",
2826
"type": "boolean"
2927
},
3028
"recursion_limit": {
31-
"title": "Recursion Limit",
32-
"description": "Set the maximum recursion depth for the parser (default: 1000)",
3329
"default": 1000,
30+
"description": "Set the maximum recursion depth for the parser (default: 1000)",
31+
"title": "Recursion Limit",
3432
"type": "integer"
3533
},
3634
"sort_keywords": {
37-
"title": "Sort Keywords",
38-
"description": "Display variable keywords information, function/subroutine definitions, etc. in a consistent (sorted) manner default: no sorting, display code as is)",
3935
"default": false,
36+
"description": "Display variable keywords information, function/subroutine definitions, etc. in a consistent (sorted) manner default: no sorting, display code as is)",
37+
"title": "Sort Keywords",
4038
"type": "boolean"
4139
},
4240
"disable_autoupdate": {
43-
"title": "Disable Autoupdate",
44-
"description": "fortls automatically checks PyPi for newer version and installs them.Use this option to disable the autoupdate feature.",
4541
"default": false,
42+
"description": "fortls automatically checks PyPi for newer version and installs them.Use this option to disable the autoupdate feature.",
43+
"title": "Disable Autoupdate",
4644
"type": "boolean"
4745
},
4846
"preserve_keyword_order": {
49-
"title": "Preserve Keyword Order",
50-
"description": "DEPRECATED, this is now the default. To sort use sort_keywords",
5147
"default": false,
48+
"description": "DEPRECATED, this is now the default. To sort use sort_keywords",
49+
"title": "Preserve Keyword Order",
5250
"type": "boolean"
5351
},
5452
"debug_log": {
55-
"title": "Debug Log",
56-
"description": "Generate debug log in project root folder",
5753
"default": false,
54+
"description": "Generate debug log in project root folder",
55+
"title": "Debug Log",
5856
"type": "boolean"
5957
},
6058
"source_dirs": {
61-
"title": "Source Dirs",
62-
"description": "Folders containing source files (default: set())",
6359
"default": [],
64-
"type": "array",
60+
"description": "Folders containing source files (default: set())",
6561
"items": {},
62+
"title": "Source Dirs",
63+
"type": "array",
6664
"uniqueItems": true
6765
},
6866
"incl_suffixes": {
69-
"title": "Incl Suffixes",
70-
"description": "Consider additional file extensions to the default (default: .F, .F77, .F90, .F95, .F03, .F08, .FOR, .FPP (lower & upper casing))",
7167
"default": [],
72-
"type": "array",
68+
"description": "Consider additional file extensions to the default (default: .F, .F77, .F90, .F95, .F03, .F08, .FOR, .FPP (lower & upper casing))",
7369
"items": {},
70+
"title": "Incl Suffixes",
71+
"type": "array",
7472
"uniqueItems": true
7573
},
7674
"excl_suffixes": {
77-
"title": "Excl Suffixes",
78-
"description": "Source file extensions to be excluded (default: set())",
7975
"default": [],
80-
"type": "array",
76+
"description": "Source file extensions to be excluded (default: set())",
8177
"items": {},
78+
"title": "Excl Suffixes",
79+
"type": "array",
8280
"uniqueItems": true
8381
},
8482
"excl_paths": {
85-
"title": "Excl Paths",
86-
"description": "Folders to exclude from parsing",
8783
"default": [],
88-
"type": "array",
84+
"description": "Folders to exclude from parsing",
8985
"items": {},
86+
"title": "Excl Paths",
87+
"type": "array",
9088
"uniqueItems": true
9189
},
9290
"autocomplete_no_prefix": {
93-
"title": "Autocomplete No Prefix",
94-
"description": "Do not filter autocomplete results by variable prefix",
9591
"default": false,
92+
"description": "Do not filter autocomplete results by variable prefix",
93+
"title": "Autocomplete No Prefix",
9694
"type": "boolean"
9795
},
9896
"autocomplete_no_snippets": {
99-
"title": "Autocomplete No Snippets",
100-
"description": "Do not use snippets with place holders in autocomplete results",
10197
"default": false,
98+
"description": "Do not use snippets with place holders in autocomplete results",
99+
"title": "Autocomplete No Snippets",
102100
"type": "boolean"
103101
},
104102
"autocomplete_name_only": {
105-
"title": "Autocomplete Name Only",
106-
"description": "Complete only the name of procedures and not the parameters",
107103
"default": false,
104+
"description": "Complete only the name of procedures and not the parameters",
105+
"title": "Autocomplete Name Only",
108106
"type": "boolean"
109107
},
110108
"lowercase_intrinsics": {
111-
"title": "Lowercase Intrinsics",
112-
"description": "Use lowercase for intrinsics and keywords in autocomplete requests",
113109
"default": false,
110+
"description": "Use lowercase for intrinsics and keywords in autocomplete requests",
111+
"title": "Lowercase Intrinsics",
114112
"type": "boolean"
115113
},
116114
"use_signature_help": {
117-
"title": "Use Signature Help",
118-
"description": "Use signature help instead of subroutine/function snippets. This effectively sets --autocomplete_no_snippets",
119115
"default": false,
116+
"description": "Use signature help instead of subroutine/function snippets. This effectively sets --autocomplete_no_snippets",
117+
"title": "Use Signature Help",
120118
"type": "boolean"
121119
},
122120
"variable_hover": {
123-
"title": "Variable Hover",
124-
"description": "DEPRECATED: This option is always on. Show hover information for variables",
125121
"default": false,
122+
"description": "DEPRECATED: This option is always on. Show hover information for variables",
123+
"title": "Variable Hover",
126124
"type": "boolean"
127125
},
128126
"hover_signature": {
129-
"title": "Hover Signature",
130-
"description": "Show signature information in hover for arguments ",
131127
"default": false,
128+
"description": "Show signature information in hover for arguments ",
129+
"title": "Hover Signature",
132130
"type": "boolean"
133131
},
134132
"hover_language": {
135-
"title": "Hover Language",
136-
"description": "Language used for responses to hover requests a VSCode language id (default: fortran90)",
137133
"default": "fortran90",
134+
"description": "Language used for responses to hover requests a VSCode language id (default: fortran90)",
135+
"title": "Hover Language",
138136
"type": "string"
139137
},
140138
"max_line_length": {
141-
"title": "Max Line Length",
142-
"description": "Maximum line length (default: -1)",
143139
"default": -1,
140+
"description": "Maximum line length (default: -1)",
141+
"title": "Max Line Length",
144142
"type": "integer"
145143
},
146144
"max_comment_line_length": {
147-
"title": "Max Comment Line Length",
148-
"description": "Maximum comment line length (default: -1)",
149145
"default": -1,
146+
"description": "Maximum comment line length (default: -1)",
147+
"title": "Max Comment Line Length",
150148
"type": "integer"
151149
},
152150
"disable_diagnostics": {
153-
"title": "Disable Diagnostics",
154-
"description": "Disable diagnostics",
155151
"default": false,
152+
"description": "Disable diagnostics",
153+
"title": "Disable Diagnostics",
156154
"type": "boolean"
157155
},
158156
"pp_suffixes": {
159-
"title": "Pp Suffixes",
160-
"description": "File extensions to be parsed ONLY for preprocessor commands (default: all uppercase source file suffixes)",
161157
"default": [],
162-
"type": "array",
158+
"description": "File extensions to be parsed ONLY for preprocessor commands (default: all uppercase source file suffixes)",
163159
"items": {},
160+
"title": "Pp Suffixes",
161+
"type": "array",
164162
"uniqueItems": true
165163
},
166164
"include_dirs": {
167-
"title": "Include Dirs",
168-
"description": "Folders containing preprocessor files with extensions PP_SUFFIXES.",
169165
"default": [],
170-
"type": "array",
166+
"description": "Folders containing preprocessor files with extensions PP_SUFFIXES.",
171167
"items": {},
168+
"title": "Include Dirs",
169+
"type": "array",
172170
"uniqueItems": true
173171
},
174172
"pp_defs": {
175-
"title": "Pp Defs",
176-
"description": "A dictionary with additional preprocessor definitions. Preprocessor definitions are normally included via INCLUDE_DIRS",
177173
"default": {},
174+
"description": "A dictionary with additional preprocessor definitions. Preprocessor definitions are normally included via INCLUDE_DIRS",
175+
"title": "Pp Defs",
178176
"type": "object"
179177
},
180178
"symbol_skip_mem": {
181-
"title": "Symbol Skip Mem",
182-
"description": "Do not include type members in document symbol results",
183179
"default": false,
180+
"description": "Do not include type members in document symbol results",
181+
"title": "Symbol Skip Mem",
184182
"type": "boolean"
185183
},
186184
"enable_code_actions": {
187-
"title": "Enable Code Actions",
188-
"description": "Enable experimental code actions (default: false)",
189185
"default": false,
186+
"description": "Enable experimental code actions (default: false)",
187+
"title": "Enable Code Actions",
190188
"type": "boolean"
191189
}
192-
}
190+
},
191+
"title": "fortls schema",
192+
"type": "object"
193193
}

fortls/schema.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import json
34
import pathlib
45

56
from pydantic import Field, create_model
@@ -23,13 +24,13 @@ def create_schema(root: pathlib.Path | None = None):
2324
continue
2425
val = arg.default
2526
desc: str = arg.help.replace("%(default)s", str(val)) # type: ignore
26-
only_vals[arg.dest] = Field(val, description=desc) # type: ignore
27+
only_vals[arg.dest] = (type(val), Field(val, description=desc)) # type: ignore
2728

2829
m = create_model("fortls schema", **only_vals)
2930
m.__doc__ = "Schema for the fortls Fortran Language Server"
3031

3132
with open(str(root / "fortls.schema.json"), "w", encoding="utf-8") as f:
32-
print(m.schema_json(indent=2), file=f)
33+
print(json.dumps(m.model_json_schema(), indent=2), file=f)
3334
print(f"Created schema file: {root / 'fortls.schema.json'}")
3435

3536

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ dev =
6262
black
6363
isort
6464
pre-commit
65-
pydantic==1.10.13
65+
pydantic==2.7.0
6666
docs =
6767
sphinx >= 4.0.0
6868
sphinx-argparse

0 commit comments

Comments
 (0)