Skip to content

Commit f6571ca

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 505e56d commit f6571ca

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

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"
@@ -270,16 +269,8 @@ shell = "./build_api_reference.sh && corepack enable && yarn && uv run yarn star
270269
cwd = "website"
271270

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

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

0 commit comments

Comments
 (0)