22from enum import StrEnum
33from inspect import cleandoc
44from pathlib import Path
5- from typing import Optional , Union
65
76from pydantic import BaseModel , ConfigDict , Field
87
@@ -46,14 +45,14 @@ class BotConfigVersionUpdatesNVIDIA(BaseModel):
4645 updates using the NVIDIA source.
4746 """
4847
49- compute_subdir : Optional [ str ] = Field (
48+ compute_subdir : str | None = Field (
5049 default = None ,
5150 description = "For sources from `developer.download.nvidia.com/compute`, this string"
5251 "defines the subdirectory in which to find the JSON blob containing metadata"
5352 "about the latest releases of a package." ,
5453 )
5554
56- json_name : Optional [ str ] = Field (
55+ json_name : str | None = Field (
5756 default = None ,
5857 description = "For sources from `developer.download.nvidia.com/compute`, this string"
5958 "defines the name of the package in the JSON blob containing metadata"
@@ -69,18 +68,18 @@ class BotConfigVersionUpdates(BaseModel):
6968
7069 model_config : ConfigDict = ConfigDict (extra = "forbid" )
7170
72- random_fraction_to_keep : Optional [ float ] = Field (
71+ random_fraction_to_keep : float | None = Field (
7372 None ,
7473 description = "Fraction of versions to keep for frequently updated packages" ,
7574 )
7675
77- exclude : Optional [ list [str ]] = Field (
76+ exclude : list [str ] | None = Field (
7877 default = [],
7978 description = "List of versions to exclude. "
8079 "Make sure branch names are `str` by quoting the value." ,
8180 )
8281
83- sources : Optional [ list [BotConfigVersionUpdatesSourcesChoice ]] = Field (
82+ sources : list [BotConfigVersionUpdatesSourcesChoice ] | None = Field (
8483 None ,
8584 description = cleandoc (
8685 """
@@ -111,35 +110,35 @@ class BotConfigVersionUpdates(BaseModel):
111110 ),
112111 )
113112
114- skip : Optional [ bool ] = Field (
113+ skip : bool | None = Field (
115114 default = False ,
116115 description = "Skip automatic version updates. "
117116 "Useful in cases where the source project's version numbers don't conform to "
118117 "PEP440." ,
119118 )
120119
121- even_odd_versions : Optional [ bool ] = Field (
120+ even_odd_versions : bool | None = Field (
122121 default = None ,
123122 description = "For projects that follow even/odd versioning schemes (like GNOME), "
124123 "set to true to only accept stable versions (even minor numbers: 1.2.x, 1.4.x) "
125124 "and ignore development versions (odd minor numbers: 1.1.x, 1.3.x). "
126125 "Leave unset for projects that don't follow this versioning scheme." ,
127126 )
128127
129- allowed_tag_globs : Optional [ Union [ str , list [str ]]] = Field (
128+ allowed_tag_globs : str | list [str ] | None = Field (
130129 default = None ,
131130 description = "For version sources that parse repo/vcs tags (e.g., "
132131 "`gittags`, `github`, `githubreleases`), "
133132 "the list of glob patterns that define which tags are allowed. This field can be used to "
134133 "filter the set of tags to only those relevant for the feedstock." ,
135134 )
136135
137- nvidia : Optional [ BotConfigVersionUpdatesNVIDIA ] = Field (
136+ nvidia : BotConfigVersionUpdatesNVIDIA | None = Field (
138137 default_factory = BotConfigVersionUpdatesNVIDIA ,
139138 description = "Bot config for version update PRs using the NVIDIA updater." ,
140139 )
141140
142- use_curl : Optional [ bool ] = Field (
141+ use_curl : bool | None = Field (
143142 None ,
144143 description = "If True, use `curl` to test if URLs exist, otherwise use `wget`." ,
145144 )
@@ -199,38 +198,38 @@ class BotConfig(BaseModel):
199198
200199 model_config : ConfigDict = ConfigDict (extra = "forbid" )
201200
202- automerge : Optional [ Union [ bool , BotConfigAutoMergeChoice ]] = Field (
201+ automerge : bool | BotConfigAutoMergeChoice | None = Field (
203202 False ,
204203 description = "Automatically merge PRs if possible" ,
205204 )
206205
207- check_solvable : Optional [ bool ] = Field (
206+ check_solvable : bool | None = Field (
208207 default = True ,
209208 description = "Open PRs only if resulting environment is solvable." ,
210209 )
211210
212- inspection : Optional [ BotConfigInspectionChoice ] = Field (
211+ inspection : BotConfigInspectionChoice | None = Field (
213212 default = "hint" ,
214213 description = "Method for generating hints or updating recipe" ,
215214 )
216215
217- abi_migration_branches : Optional [ list [str ]] = Field (
216+ abi_migration_branches : list [str ] | None = Field (
218217 default = [],
219218 description = "List of branches for additional bot migration PRs. "
220219 "Make sure branch names are `str` by quoting the value." ,
221220 )
222221
223- run_deps_from_wheel : Optional [ bool ] = Field (
222+ run_deps_from_wheel : bool | None = Field (
224223 default = False ,
225224 description = "Update run dependencies from the pip wheel" ,
226225 )
227226
228- version_updates : Optional [ BotConfigVersionUpdates ] = Field (
227+ version_updates : BotConfigVersionUpdates | None = Field (
229228 default_factory = BotConfigVersionUpdates ,
230229 description = "Bot config for version update PRs" ,
231230 )
232231
233- update_static_libs : Optional [ bool ] = Field (
232+ update_static_libs : bool | None = Field (
234233 default = False ,
235234 description = "Update packages in `host` that are used for static "
236235 "linking. For bot to issue update PRs, you must have both an "
@@ -241,7 +240,7 @@ class BotConfig(BaseModel):
241240 "latest package." ,
242241 )
243242
244- remake_prs_with_conflicts : Optional [ bool ] = Field (
243+ remake_prs_with_conflicts : bool | None = Field (
245244 default = True ,
246245 description = "Automatically remake untouched bot PRs with conflicts." ,
247246 )
0 commit comments