ImperialCollegeLondon / safedata_validator

Python tools to validate and publish datasets using the safedata metadata format.
https://safedata-validator.readthedocs.io/
MIT License
2 stars 4 forks source link

Add `args_list` to CLI entry points to facilitate debugging. #107

Closed davidorme closed 6 months ago

davidorme commented 6 months ago

It's a useful pattern to have the entry point functions accepts args_list: Optinal[list] = None and then use:

    if args_list is None:
        args_list = sys.argv[1:]

This is a developer and testing facing argument that is used to simulate command line arguments, allowing this function to be called directly. For example, safedata_validate show_resources can be replicated by calling _safedata_validate_cli(['show_resources']).

This is motivated by trying to track down a currently undiagnosed issue with file handling. More to come.