From 323ee5cdfd93a77b03d65efa7ee7925f3f3e4b0c Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:55:45 -0400 Subject: [PATCH 1/2] Package-lock update to deps --- website/docs/reference/commands/deps.md | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/website/docs/reference/commands/deps.md b/website/docs/reference/commands/deps.md index 4c7a36606e2..91968f2e3d4 100644 --- a/website/docs/reference/commands/deps.md +++ b/website/docs/reference/commands/deps.md @@ -57,3 +57,31 @@ Installing calogica/dbt_date@0.4.0 Updates available for packages: ['tailsdotcom/dbt_artifacts', 'dbt-labs/snowplow'] Update your versions in packages.yml, then run dbt deps ``` + + + +The first time you run `dbt deps`, dbt will generate the `package-lock.yml` file in the _project_root_ where `packages.yml` is recorded, containing all of the resolved packages. Each Subsequent run will record the packages installed in this file. If the subsequent `dbt deps` runs contain no updated packages in `depenedencies.yml` or `packages.yml`, dbt-core will install from `package-lock.yml`. + +When you update the package spec and run `dbt deps` again, the package-lock and package files will be updated accordingly. You can run `dbt deps --lock` to update the `package-lock.yml` with the most recent dependencies from `packages. + +The `--add` flag allows you to add a package to the `packages.yml` with configurable `--version` and `--source` information. The `--dry-run` flag, when set to `False`(default) will re-compile the `package-lock.yml` file after a new package is added to the `packages.yml` file. Set it to `True` and the changes will not persist. + +Examples of the `--add` flag: +```shell +# add package from hub (--source arg defaults to "hub") +dbt deps add --package dbt-labs/dbt_utils --version 1.0.0 + +# add package from hub with semantic version +dbt deps add --package dbt-labs/snowplow --version ">=0.7.0,<0.8.0" + +# add package from git +dbt deps add --package https://github.com/fivetran/dbt_amplitude --version v0.3.0 --source git + +# add package from local (--version not required for local) +dbt deps add --package /opt/dbt/redshift --source local + +# add package to packages.yml WITHOUT updating package-lock.yml +dbt deps add --package dbt-labs/dbt_utils --version 1.0.0 --dry-run True + +``` + \ No newline at end of file From d3b6c9a384f9f6a318ded33031601b8a636f75bf Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:00:52 -0400 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> --- website/docs/reference/commands/deps.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/reference/commands/deps.md b/website/docs/reference/commands/deps.md index 91968f2e3d4..f4f8153c115 100644 --- a/website/docs/reference/commands/deps.md +++ b/website/docs/reference/commands/deps.md @@ -60,11 +60,11 @@ Update your versions in packages.yml, then run dbt deps -The first time you run `dbt deps`, dbt will generate the `package-lock.yml` file in the _project_root_ where `packages.yml` is recorded, containing all of the resolved packages. Each Subsequent run will record the packages installed in this file. If the subsequent `dbt deps` runs contain no updated packages in `depenedencies.yml` or `packages.yml`, dbt-core will install from `package-lock.yml`. +dbt generates the `package-lock.yml` file in the _project_root_ where `packages.yml` is recorded, which contains all the resolved packages, the first time you run `dbt deps`. Each subsequent run records the packages installed in this file. If the subsequent `dbt deps` runs contain no updated packages in `depenedencies.yml` or `packages.yml`, dbt-core installs from `package-lock.yml`. -When you update the package spec and run `dbt deps` again, the package-lock and package files will be updated accordingly. You can run `dbt deps --lock` to update the `package-lock.yml` with the most recent dependencies from `packages. +When you update the package spec and run `dbt deps` again, the package-lock and package files update accordingly. You can run `dbt deps --lock` to update the `package-lock.yml` with the most recent dependencies from `packages`. -The `--add` flag allows you to add a package to the `packages.yml` with configurable `--version` and `--source` information. The `--dry-run` flag, when set to `False`(default) will re-compile the `package-lock.yml` file after a new package is added to the `packages.yml` file. Set it to `True` and the changes will not persist. +The `--add` flag allows you to add a package to the `packages.yml` with configurable `--version` and `--source` information. The `--dry-run` flag, when set to `False`(default), recompiles the `package-lock.yml` file after a new package is added to the `packages.yml` file. Set the flag to `True` for the changes to not persist. Examples of the `--add` flag: ```shell