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

[CT-690] Ability to add package dependencies via the CLI #5302

Closed
1 task done
aaronsteers opened this issue May 26, 2022 · 7 comments
Closed
1 task done

[CT-690] Ability to add package dependencies via the CLI #5302

aaronsteers opened this issue May 26, 2022 · 7 comments
Labels
cli deps dbt's package manager enhancement New feature or request help_wanted Trickier changes, with a clear starting point, good for previous/experienced contributors stale Issues that have gone stale

Comments

@aaronsteers
Copy link
Contributor

Is this your first time opening an issue?

Describe the Feature

dbt deps add ...

Would accept args matching the specifications that land in yaml:

https://docs.getdbt.com/docs/building-a-dbt-project/package-management/#how-do-i-specify-a-package

For instance:

  • --package=PACKAGE to set package: 'PACKAGE'
  • --version=VERS to set version: 'VERS

Afterwards run the installation as would be performed by dbt deps.

Describe alternatives you've considered

Today the alternative seems to be to manually edit the yaml or create some custom scripts which perform that yaml edit.

Who will this benefit?

Users of packages on the hub will have a more streamlined installation method.

Community members can share a one-line snippet on how to add any community package to a project repo.

Are you interested in contributing this feature?

Yes, definitely

Anything else?

No response

@aaronsteers aaronsteers added enhancement New feature or request triage labels May 26, 2022
@github-actions github-actions bot changed the title Ability to add package dependencies via the CLI [CT-690] Ability to add package dependencies via the CLI May 26, 2022
@gshank
Copy link
Contributor

gshank commented May 27, 2022

Are you suggesting that this cli command would actually add this package specification to packages.yml?

@gshank gshank removed the triage label May 27, 2022
@aaronsteers
Copy link
Contributor Author

aaronsteers commented May 27, 2022

@gshank - Yes. If you are familiar with poetry, this is roughly equivalent to poetry add ... which adds the dependency to the pyproject.toml (analogous to packages.yml in dbt) and then immediately installs/updates the package in environment (equivalent of running dbt deps with no args today).

Surgically editing the yaml file by hand just makes it harder to automate - especially in a cross-platform, cross-OS manner. A CLI version of 'deps add' would give a single cross-platform way of adding packages to a dbt project.

@jtcohen6
Copy link
Contributor

jtcohen6 commented Jun 2, 2022

@aaronsteers This is a neat idea! It sounds like something you'd be interested in working on / contributing?

@gshank Do you have qualms or hesitations about adding support for this? It would be tricky for us to support this outside the CLI / local file system context, but I think that's probably okay, given that it's really intended as a handy workflow for CLI users (= human beings).

I'm a bit more skeptical of the "packages.yml automation" workflow. I'd feel better about an approach that looks like constructing a Python dictionary of packages, and then either serializing it to yaml (as we do in our testing framework), or passing it into a (future) programmatic entrypoint of dbt-core.

@jtcohen6
Copy link
Contributor

jtcohen6 commented Jun 7, 2022

  • Not something we're going to prioritize ourselves, but we might accept a PR from a motivated community member
  • We would want to put this in a reasonable spot in the CLI tree (hard to do today, given current state of argparse)
  • This feels more maintainable in a world where deps is split out into its own module / package
  • We Like Rust, and Rust does support a cargo add CLI command

going to tag this help_wanted accordingly

@jtcohen6 jtcohen6 added the help_wanted Trickier changes, with a clear starting point, good for previous/experienced contributors label Jun 7, 2022
@jtcohen6
Copy link
Contributor

jtcohen6 commented Jun 7, 2022

Update: It's NOT in cargo, it's a third-party extension: https://github.com/killercup/cargo-edit

Maybe that should change our point of view for native support...?

I do appreciate that editing packages.yml programmatically requires interacting with file systems (Windows!), which is a thing that dbt already knows how to abstract over reasonably well.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2023

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the stale Issues that have gone stale label Jun 3, 2023
@github-actions
Copy link
Contributor

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli deps dbt's package manager enhancement New feature or request help_wanted Trickier changes, with a clear starting point, good for previous/experienced contributors stale Issues that have gone stale
Projects
None yet
Development

No branches or pull requests

3 participants