Skip to content

Commit 6def27d

Browse files
vdusekclaude
andcommitted
ci: move url/input args from datamodel-codegen config to poe tasks
Remove `url` from [tool.datamodel-codegen] config and pass it explicitly via --url/--input in poe tasks. This eliminates the sed workaround in generate-models-from-file and prevents --input from being silently ignored when url is set in config. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f5ed650 commit 6def27d

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

pyproject.toml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ context = 7
208208

209209
# https://koxudaxi.github.io/datamodel-code-generator/
210210
[tool.datamodel-codegen]
211-
url = "https://docs.apify.com/api/openapi.json"
212211
input_file_type = "openapi"
213212
output = "src/apify_client/_models.py"
214213
target_python_version = "3.11"
@@ -269,16 +268,8 @@ shell = "./build_api_reference.sh && corepack enable && yarn && uv run yarn star
269268
cwd = "website"
270269

271270
[tool.poe.tasks.generate-models]
272-
shell = "uv run datamodel-codegen && python scripts/fix_generated_models.py"
271+
shell = "uv run datamodel-codegen --url https://docs.apify.com/api/openapi.json && python scripts/fix_generated_models.py"
273272

274273
[tool.poe.tasks.generate-models-from-file]
275-
# The --input flag is ignored when url is set in pyproject.toml, so we temporarily
276-
# replace url with input, run the generator, and restore the original pyproject.toml.
277-
shell = """
278-
sed -i 's|^url = .*|input = "'"$input_file"'"|' pyproject.toml
279-
uv run datamodel-codegen && python scripts/fix_generated_models.py
280-
STATUS=$?
281-
git checkout pyproject.toml
282-
exit $STATUS
283-
"""
274+
shell = "uv run datamodel-codegen --input $input_file && python scripts/fix_generated_models.py"
284275
args = [{ name = "input-file", positional = true, required = true }]

0 commit comments

Comments
 (0)