rapidsai / dependency-file-generator

https://pypi.org/project/rapids-dependency-file-generator/
Apache License 2.0
15 stars 13 forks source link

Accept empty `--matrix` values as CLI flag #17

Closed ajschmidt8 closed 2 years ago

ajschmidt8 commented 2 years ago

Currently, if you run the following command:

rapids-dependency-file-generator \
  --output conda \
  --file_key test \
  --matrix "" 

you'll get an error that says:

Traceback (most recent call last):
  File "/home/aj/miniconda3/bin/rapids-dependency-file-generator", line 33, in <module>
    sys.exit(load_entry_point('rapids-dependency-file-generator', 'console_scripts', 'rapids-dependency-file-generator')())
  File "/home/aj/code/nvidia/dependency-file-generator/src/rapids_dependency_file_generator/cli.py", line 63, in main
    args = validate_args(argv)
  File "/home/aj/code/nvidia/dependency-file-generator/src/rapids_dependency_file_generator/cli.py", line 44, in validate_args
    raise ValueError(
ValueError: The following arguments must be used together:
  --file_key
  --output
  --matrix

Empty --matrix values should probably be allowed. One use case is for environments generated for the check_style.sh scripts, where most of the dependencies will just be pure Python dependencies that don't vary per CUDA version, Python version, or architecture.

ajschmidt8 commented 2 years ago

This bug was found in the code below