Skip to content

Commit 0c362a0

Browse files
committed
fix cli
1 parent bac09d6 commit 0c362a0

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

pum/cli.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def create_parser() -> argparse.ArgumentParser:
313313
)
314314

315315
# Parser for the "info" command
316-
parser_info = subparsers.add_parser("info", help="show info about schema migrations history.")
316+
parser_info = subparsers.add_parser("info", help="show info about schema migrations history.") # NOQA
317317

318318
# Parser for the "install" command
319319
parser_install = subparsers.add_parser("install", help="Installs the module.")
@@ -423,18 +423,15 @@ def cli() -> int:
423423
parser.exit()
424424

425425
# Build parameters dict for install and upgrade commands
426-
parameters: dict[str, Any] = {}
427-
parameters_definition = {
428-
p["name"]: {k: v for k, v in p.items() if k != "name"} for p in config.parameters()
429-
}
426+
parameters = {}
430427
if args.command in ("install", "upgrade"):
431428
for p in args.parameter or ():
432-
if p[0] not in parameters_definition:
429+
if p[0] not in config.parameters_definition():
433430
print(f"Unknown parameter: {p[0]}")
434431
sys.exit(1)
435-
if parameters_definition[p[0]].get("type") == "float":
432+
if config.parameters_definition(p[0]).type_ == "float":
436433
parameters[p[0]] = float(p[1])
437-
elif parameters_definition[p[0]].get("type") == "int":
434+
if config.parameters_definition(p[0]).type_ == "integer":
438435
parameters[p[0]] = int(p[1])
439436
else:
440437
parameters[p[0]] = p[1]

0 commit comments

Comments
 (0)