From 154266eddb8e2c7c8601e6d79c054441b1079a8b Mon Sep 17 00:00:00 2001 From: Tristan Willy Date: Fri, 14 Jan 2022 16:11:06 -0800 Subject: [PATCH 1/2] task init: support older click v7.0 `dbt init` uses click for interactively setting up a project. The version constraints currently ask for click >= 8 but v7.0 has nearly the same prompt/confirm/echo API. prompt added a feature that isn't used. confirm has a behavior change if the default is None, but confirm(..., default=None) is not used. Long story short, we can relax the version constraint to allow installing with an older click library. Ref: Issue #4566 --- CHANGELOG.md | 1 + core/dbt/task/init.py | 3 ++- core/setup.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6207f81cfd8..d884b6f24ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ Contributors: - Fix bug in retry logic for bad response from hub and when there is a bad git tarball download. ([#4577](https://github.com/dbt-labs/dbt-core/issues/4577), [#4579](https://github.com/dbt-labs/dbt-core/issues/4579), [#4609](https://github.com/dbt-labs/dbt-core/pull/4609)) - Restore previous log level (DEBUG) when a test depends on a disabled resource. Still WARN if the resource is missing ([#4594](https://github.com/dbt-labs/dbt-core/issues/4594), [#4647](https://github.com/dbt-labs/dbt-core/pull/4647)) - Add project name validation to `dbt init` ([#4490](https://github.com/dbt-labs/dbt-core/issues/4490),[#4536](https://github.com/dbt-labs/dbt-core/pull/4536)) +- Support click versions in the v7.x series ([#4681](https://github.com/dbt-labs/dbt-core/pull/4681)) Contributors: * [@amirkdv](https://github.com/amirkdv) ([#4536](https://github.com/dbt-labs/dbt-core/pull/4536)) diff --git a/core/dbt/task/init.py b/core/dbt/task/init.py index 1f1d0daa182..e164917c40f 100644 --- a/core/dbt/task/init.py +++ b/core/dbt/task/init.py @@ -50,7 +50,8 @@ Happy modeling! """ -# https://click.palletsprojects.com/en/8.0.x/api/?highlight=float#types +# https://click.palletsprojects.com/en/8.0.x/api/#types +# click v7.0 has UNPROCESSED, STRING, INT, FLOAT, BOOL, and UUID available. click_type_mapping = { "string": click.STRING, "int": click.INT, diff --git a/core/setup.py b/core/setup.py index 4d31e64ef7d..a98e3b83100 100644 --- a/core/setup.py +++ b/core/setup.py @@ -53,7 +53,7 @@ install_requires=[ 'Jinja2==2.11.3', 'agate>=1.6,<1.6.4', - 'click>=8,<9', + 'click>=7.0,<9', 'colorama>=0.3.9,<0.4.5', 'hologram==0.0.14', 'isodate>=0.6,<0.7', From c840dc47918c9fe2ab5677dc2025d7ba5b5e7279 Mon Sep 17 00:00:00 2001 From: Tristan Willy Date: Mon, 7 Feb 2022 10:54:01 -0800 Subject: [PATCH 2/2] Update CHANGELOG.md Co-authored-by: Chenyu Li --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d884b6f24ec..33f982a4f94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ Contributors: Contributors: * [@amirkdv](https://github.com/amirkdv) ([#4536](https://github.com/dbt-labs/dbt-core/pull/4536)) +* [@twilly](https://github.com/twilly) ([#4681](https://github.com/dbt-labs/dbt-core/pull/4681)) ## dbt-core 1.0.2 (TBD) ### Fixes