Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hub cli #537

Merged
merged 39 commits into from
Feb 13, 2024
Merged

Hub cli #537

merged 39 commits into from
Feb 13, 2024

Conversation

CalebCourier
Copy link
Collaborator

Summary

This PR adds the following commands to the guardrails cli for hub support:

  • guardrails configure
  • guardrails hub install

It also refactors cli.py into a directory for better maintainability as we add more cli commands.

Behaviour of guardrails hub install

In order to prevent namespace collisions, the install subcommand will do the following with validator modules during installation:

  1. Create a namespace directory for the validator's authoring organization if one does not exist
  2. Create a directory under the above named after the package name defined in the manifest
  3. Use pip to install the validator module without any dependencies into the package directory from step 2
  4. Use pip to inspect the package directory to determine dependencies for this validator
  5. Install those dependencies in the active site-packages directory from the sys environment
  6. Adds entries to the init files in guardrails.hub and guardrails.hub.{namespace}

Step 5 means that common dependencies will be re-used across validator modules. This means that conflicting dependency versions can be an issue like every other python environment.

Depends On

#530

@CalebCourier
Copy link
Collaborator Author

I didn't write tests for anything under hub/server because that will all be moving to the proxy server this week and likely won't be in python anymore.

Copy link

CLI

Copy link

Copy link

CLI opt-out

@CalebCourier CalebCourier marked this pull request as ready for review February 13, 2024 18:49
@CalebCourier CalebCourier merged commit d408080 into hub-support Feb 13, 2024
@CalebCourier CalebCourier deleted the hub-cli branch February 19, 2024 14:34
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.

2 participants