Skip to content

Commit f18b3ff

Browse files
committed
make file inputs either a path or list of paths
1 parent feb1ef3 commit f18b3ff

1 file changed

Lines changed: 25 additions & 25 deletions

File tree

src/somesy/core/models.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import re
88
from datetime import date
99
from pathlib import Path
10-
from typing import Any, Dict, List, Optional
10+
from typing import Any, Dict, List, Optional, Union
1111

1212
from pydantic import (
1313
BaseModel,
@@ -179,56 +179,56 @@ def at_least_one_target(cls, values):
179179
no_sync_pyproject: Annotated[
180180
bool, Field(description="Do not sync with pyproject.toml.")
181181
] = False
182-
pyproject_file: Annotated[Path, Field(description="pyproject.toml file path.")] = (
183-
Path("pyproject.toml")
184-
)
182+
pyproject_file: Annotated[
183+
Union[Path, List[Path]], Field(description="pyproject.toml file path.")
184+
] = Path("pyproject.toml")
185185

186186
no_sync_package_json: Annotated[
187187
bool, Field(description="Do not sync with package.json.")
188188
] = False
189-
package_json_file: Annotated[Path, Field(description="package.json file path.")] = (
190-
Path("package.json")
191-
)
189+
package_json_file: Annotated[
190+
Union[Path, List[Path]], Field(description="package.json file path.")
191+
] = Path("package.json")
192192

193193
no_sync_julia: Annotated[
194194
bool, Field(description="Do not sync with Project.toml.")
195195
] = False
196-
julia_file: Annotated[Path, Field(description="Project.toml file path.")] = Path(
197-
"Project.toml"
198-
)
196+
julia_file: Annotated[
197+
Union[Path, List[Path]], Field(description="Project.toml file path.")
198+
] = Path("Project.toml")
199199

200200
no_sync_fortran: Annotated[
201201
bool, Field(description="Do not sync with fpm.toml.")
202202
] = False
203-
fortran_file: Annotated[Path, Field(description="fpm.toml file path.")] = Path(
204-
"fpm.toml"
205-
)
203+
fortran_file: Annotated[
204+
Union[Path, List[Path]], Field(description="fpm.toml file path.")
205+
] = Path("fpm.toml")
206206

207207
no_sync_pom_xml: Annotated[bool, Field(description="Do not sync with pom.xml.")] = (
208208
False
209209
)
210-
pom_xml_file: Annotated[Path, Field(description="pom.xml file path.")] = Path(
211-
"pom.xml"
212-
)
210+
pom_xml_file: Annotated[
211+
Union[Path, List[Path]], Field(description="pom.xml file path.")
212+
] = Path("pom.xml")
213213

214214
no_sync_mkdocs: Annotated[
215215
bool, Field(description="Do not sync with mkdocs.yml.")
216216
] = False
217-
mkdocs_file: Annotated[Path, Field(description="mkdocs.yml file path.")] = Path(
218-
"mkdocs.yml"
219-
)
217+
mkdocs_file: Annotated[
218+
Union[Path, List[Path]], Field(description="mkdocs.yml file path.")
219+
] = Path("mkdocs.yml")
220220

221221
no_sync_rust: Annotated[bool, Field(description="Do not sync with Cargo.toml.")] = (
222222
False
223223
)
224-
rust_file: Annotated[Path, Field(description="Cargo.toml file path.")] = Path(
225-
"Cargo.toml"
226-
)
224+
rust_file: Annotated[
225+
Union[Path, List[Path]], Field(description="Cargo.toml file path.")
226+
] = Path("Cargo.toml")
227227

228228
no_sync_cff: Annotated[bool, Field(description="Do not sync with CFF.")] = False
229-
cff_file: Annotated[Path, Field(description="CFF file path.")] = Path(
230-
"CITATION.cff"
231-
)
229+
cff_file: Annotated[
230+
Union[Path, List[Path]], Field(description="CFF file path.")
231+
] = Path("CITATION.cff")
232232

233233
no_sync_codemeta: Annotated[
234234
bool, Field(description="Do not sync with codemeta.json.")

0 commit comments

Comments
 (0)