@@ -148,38 +148,49 @@ def at_least_one_target(cls, values):
148148 return values
149149
150150 # cli flags
151- show_info : bool = Field (
152- False , description = "Show basic information messages on run (-v flag)."
153- )
154- verbose : bool = Field (False , description = "Show verbose messages on run (-vv flag)." )
155- debug : bool = Field (False , description = "Show debug messages on run (-vvv flag)." )
156-
157- input_file : Path = Field (
158- Path ("somesy.toml" ), description = "Project metadata input file path."
159- )
151+ show_info : Annotated [
152+ bool ,
153+ Field (
154+ description = "Show basic information messages on run (-v flag)." ,
155+ ),
156+ ] = False
157+ verbose : Annotated [
158+ bool , Field (description = "Show verbose messages on run (-vv flag)." )
159+ ] = False
160+ debug : Annotated [
161+ bool , Field (description = "Show debug messages on run (-vvv flag)." )
162+ ] = False
160163
161- no_sync_pyproject : bool = Field (
162- False , description = "Do not sync with pyproject.toml."
163- )
164- pyproject_file : Path = Field (
165- Path ("pyproject.toml" ), description = "pyproject.toml file path."
166- )
164+ input_file : Annotated [
165+ Path , Field (description = "Project metadata input file path." )
166+ ] = Path ("somesy.toml" )
167167
168- no_sync_package_json : bool = Field (
169- False , description = "Do not sync with package.json."
170- )
171- package_json_file : Path = Field (
172- Path ( "package.json" ), description = "package.json file path."
173- )
168+ no_sync_pyproject : Annotated [
169+ bool , Field ( description = "Do not sync with pyproject.toml." )
170+ ] = False
171+ pyproject_file : Annotated [
172+ Path , Field ( description = "pyproject.toml file path." )
173+ ] = Path ( "pyproject.toml" )
174174
175- no_sync_cff : bool = Field (False , description = "Do not sync with CFF." )
176- cff_file : Path = Field (Path ("CITATION.cff" ), description = "CFF file path." )
175+ no_sync_package_json : Annotated [
176+ bool , Field (description = "Do not sync with package.json." )
177+ ] = False
178+ package_json_file : Annotated [
179+ Path , Field (description = "package.json file path." )
180+ ] = Path ("package.json" )
177181
178- no_sync_codemeta : bool = Field (False , description = "Do not sync with codemeta.json." )
179- codemeta_file : Path = Field (
180- Path ( "codemeta.json" ), description = "codemeta.json file path. "
182+ no_sync_cff : Annotated [ bool , Field (description = "Do not sync with CFF." )] = False
183+ cff_file : Annotated [ Path , Field ( description = "CFF file path." )] = Path (
184+ "CITATION.cff "
181185 )
182186
187+ no_sync_codemeta : Annotated [
188+ bool , Field (description = "Do not sync with codemeta.json." )
189+ ] = False
190+ codemeta_file : Annotated [
191+ Path , Field (description = "codemeta.json file path." )
192+ ] = Path ("codemeta.json" )
193+
183194 def log_level (self ) -> SomesyLogLevel :
184195 """Return log level derived from this configuration."""
185196 return SomesyLogLevel .from_flags (
@@ -375,23 +386,30 @@ def at_least_one_author(cls, people):
375386 raise ValueError ("At least one person must be an author of this project." )
376387 return people
377388
378- name : str = Field (description = "Project name." )
379- description : str = Field (description = "Project description." )
380- version : Optional [str ] = Field (description = "Project version." )
381- license : LicenseEnum = Field (description = "SPDX License string." )
382-
383- repository : Optional [AnyUrl ] = Field (
384- None , description = "URL of the project source code repository."
385- )
386- homepage : Optional [AnyUrl ] = Field (None , description = "URL of the project homepage." )
387-
388- keywords : Optional [List [str ]] = Field (
389- None , min_items = 1 , description = "Keywords that describe the project."
390- )
389+ name : Annotated [str , Field (description = "Project name." )]
390+ description : Annotated [str , Field (description = "Project description." )]
391+ version : Annotated [Optional [str ], Field (description = "Project version." )]
392+ license : Annotated [LicenseEnum , Field (description = "SPDX License string." )]
391393
392- people : List [Person ] = Field (
393- min_items = 1 , description = "Project authors, maintainers and contributors."
394- )
394+ repository : Annotated [
395+ Optional [AnyUrl ],
396+ Field (description = "URL of the project source code repository." ),
397+ ] = None
398+ homepage : Annotated [
399+ Optional [AnyUrl ], Field (description = "URL of the project homepage." )
400+ ] = None
401+
402+ keywords : Annotated [
403+ Optional [List [str ]],
404+ Field (min_items = 1 , description = "Keywords that describe the project." ),
405+ ] = None
406+
407+ people : Annotated [
408+ List [Person ],
409+ Field (
410+ min_items = 1 , description = "Project authors, maintainers and contributors."
411+ ),
412+ ]
395413
396414 def authors (self ):
397415 """Return people marked as authors."""
@@ -407,12 +425,14 @@ class SomesyInput(SomesyBaseModel):
407425
408426 _origin : Optional [Path ]
409427
410- project : ProjectMetadata = Field (
411- description = "Project metadata to be used and synchronized."
412- )
413- config : Optional [SomesyConfig ] = Field (
414- description = "somesy tool configuration (matches CLI flags)."
415- )
428+ project : Annotated [
429+ ProjectMetadata ,
430+ Field (description = "Project metadata to be used and synchronized." ),
431+ ]
432+ config : Annotated [
433+ Optional [SomesyConfig ],
434+ Field (description = "somesy tool configuration (matches CLI flags)." ),
435+ ]
416436
417437 def is_somesy_file (self ) -> bool :
418438 """Return whether this somesy input is from a somesy config file.
0 commit comments