From 2d8f1dc90060c21df9793f9481583ca9d9bb17c0 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 1 Feb 2024 13:01:34 +0100 Subject: [PATCH] Use None default value where items are optional For compatibility with pydantic 2 --- src/ephemeris/_config_models.py | 34 ++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/ephemeris/_config_models.py b/src/ephemeris/_config_models.py index 75daa24..d593c35 100644 --- a/src/ephemeris/_config_models.py +++ b/src/ephemeris/_config_models.py @@ -18,13 +18,13 @@ class RepositoryInstallTarget(BaseModel): name: str owner: str - tool_shed_url: Optional[str] - tool_panel_section_id: Optional[str] - tool_panel_section_label: Optional[str] - revisions: Optional[List[str]] - install_tool_dependencies: Optional[bool] - install_repository_dependencies: Optional[bool] - install_resolver_dependencies: Optional[bool] + tool_shed_url: Optional[str] = None + tool_panel_section_id: Optional[str] = None + tool_panel_section_label: Optional[str] = None + revisions: Optional[List[str]] = None + install_tool_dependencies: Optional[bool] = None + install_repository_dependencies: Optional[bool] = None + install_resolver_dependencies: Optional[bool] = None class RepositoryInstallTargets(BaseModel): @@ -46,22 +46,26 @@ class DataManagers(BaseModel, extra=Extra.forbid): class Genome(BaseModel): id: str # The unique id of the data in Galaxy - description: str # The description of the data, including its taxonomy, version and date - dbkey: Optional[str] - source: Optional[str] # The source of the data. Can be: 'ucsc', an NCBI accession number or a URL to a fasta file. + description: Optional[str] = None # The description of the data, including its taxonomy, version and date + dbkey: Optional[str] = None + source: Optional[str] = ( + None # The source of the data. Can be: 'ucsc', an NCBI accession number or a URL to a fasta file. + ) # The following fields are currently purely for human consumption and unused by # IDC infrastructure. - doi: Optional[str] # Any DOI associated with the data - blob: Optional[str] # A blob for any other pertinent information - checksum: Optional[str] # A SHA256 checksum of the original - version: Optional[str] # Any version information associated with the data + doi: Optional[str] = None # Any DOI associated with the data + blob: Optional[str] = None # A blob for any other pertinent information + checksum: Optional[str] = None # A SHA256 checksum of the original + version: Optional[str] = None # Any version information associated with the data # Description of actions (data managers) to run on target genome. indexers: Optional[ List[str] ] # indexers to run - keyed on repository name - see data_managers.yml for how to resolve these to tools - skiplist: Optional[List[str]] # unimplemented: but if we implement classes of indexers, these will be ones to skip + skiplist: Optional[List[str]] = ( + None # unimplemented: but if we implement classes of indexers, these will be ones to skip + ) class Genomes(BaseModel):