Skip to content

Replace argparse with configargparse and default yaml config#106

Open
paulwuertz wants to merge 2 commits intoHBehrens:masterfrom
paulwuertz:argparse_configuration_file
Open

Replace argparse with configargparse and default yaml config#106
paulwuertz wants to merge 2 commits intoHBehrens:masterfrom
paulwuertz:argparse_configuration_file

Conversation

@paulwuertz
Copy link

@paulwuertz paulwuertz commented Feb 9, 2025

Hej :)

Found some open issues and have some new ideas I would like to fix and propose to contribute over the next weekends ^^

Having a config file would be the first step, as most other stuff requires a lot of arguments.
So this could close #18

With configargparse the command line arguments can be reused in a config file.

So

./runner.py --elf_file ~/git/cannectivity/build/zephyr/zephyr.elf --build_dir ~/git/cannectivity/build/ --port 7245

is equivilent to

./runner.py -c punconfig.yaml with punconfig.yaml as

elf_file: ~/git/cannectivity/build/zephyr/zephyr.elf
build_dir: ~/git/cannectivity/build/
port: 7245

@paulwuertz paulwuertz marked this pull request as draft February 17, 2025 00:04
@paulwuertz paulwuertz force-pushed the argparse_configuration_file branch 2 times, most recently from b74fcd7 to 72338db Compare September 30, 2025 21:42
@paulwuertz paulwuertz marked this pull request as ready for review September 30, 2025 21:43
@paulwuertz
Copy link
Author

Just saw the new release of puncover, nice :)

Did a rebase for this proposal, any opinions if you agree with the configargparse package and yaml a config format?

Cheers ^^

pyproject.toml Outdated
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"configargparse>=1.7.1",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should either specify configargparse[yaml] or add a separate dependency on pyyaml

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, added the [yaml] extra, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configuration file instead of parameters

2 participants