MetroStar / conda-vendor

Conda package for artifact creation that enables offline environments. Ideal for air-gapped deployments.
MIT License
14 stars 8 forks source link

Excluding `--output-manifest-path` results in error when trying to create a custom manifest #21

Closed rigzba21 closed 3 years ago

rigzba21 commented 3 years ago

Description

Given a generated meta_manifest.yaml file that is passed as an option to the create-custom-manifest command, but excluding the --output-manifest-path option, produces an error.

Help Message for create-custom-manifest sub-command:

conda vendor create-custom-manifest --help
Usage: conda-vendor create-custom-manifest [OPTIONS]

  custom manifest from meta-manifest file

Options:
  -v, --verbose                verbose logging
  --manifest-type TEXT         type of custom manifest to create
  --meta-manifest-path TEXT    path to meta manifest file
  --output-manifest-path TEXT  output manifest path
  --help                       Show this message and exit.

Attempted Usage:

conda vendor create-custom-manifest --meta-manifest-path meta_manifest.yaml

results in the following error:

INFO:conda_vendor.custom_manifest:Input Manifest : /Users/rigzba21/meta_manifest.yaml
INFO:conda_vendor.custom_manifest:Output Custom Manifest : /Users/rigzba21
Traceback (most recent call last):
  File "/Users/rigzba21/mambaforge/bin/conda-vendor", line 10, in <module>
    sys.exit(cli())
  File "/Users/rigzba21/mambaforge/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/Users/rigzba21/mambaforge/lib/python3.9/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/Users/rigzba21/mambaforge/lib/python3.9/site-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/rigzba21/mambaforge/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/rigzba21/mambaforge/lib/python3.9/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/Users/rigzba21/mambaforge/lib/python3.9/site-packages/conda_vendor/__main__.py", line 104, in create_custom_manifest
    create_ironbank_from_meta_manifest(
  File "/Users/rigzba21/mambaforge/lib/python3.9/site-packages/conda_vendor/cli.py", line 26, in create_ironbank_from_meta_manifest
    custom_manifest.write_custom_manifest(output_manifest_dir)
  File "/Users/rigzba21/mambaforge/lib/python3.9/site-packages/conda_vendor/custom_manifest.py", line 40, in write_custom_manifest
    with open(output_file_path, "w") as f:
IsADirectoryError: [Errno 21] Is a directory: '.'

conda vendor --version:

conda-vendor, version 0.1.8

Discussion Points

It is not clear which options are required for the create-custom-manifest sub-command. Should we update the --help message output to show required options? Should the create-custom-manifest sub-command generate a custom manifest file with a default name, instead of requiring the --output-manifest-path option?

rigzba21 commented 3 years ago

Fixed with https://github.com/MetroStar/conda-vendor/pull/23