Skip to content

Commit

Permalink
update dev-requirements.txt to use dbt-adapters for dbt-tests-adapter (
Browse files Browse the repository at this point in the history
…#1077)

* use dynamic schema in test_grant_access_to.py

* use dynamic schema in test_grant_access_to.py

* revert setup

* replace dbt.common with dbt_common

* add dbt-adapters

* delete dbt/adapters

* fix Credentials import and test fixtures

* remove global exceptions import

* use dynamic schema in test_grant_access_to.py

* use dynamic schema in test_grant_access_to.py

* revert setup

* update dev-requirements.txt to use dbt-adapters for dbt-tests-adapter

* remove unneeded install of dbt-core from dev-requirements.txt

* add changie

* remove dbt-core version checking
  • Loading branch information
colin-rogers-dbt authored Jan 26, 2024
1 parent 70b7445 commit 8fc40e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Dependencies-20240124-120321.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Dependencies
body: get dbt-tests-adapters from dbt-adapters repo
time: 2024-01-24T12:03:21.523295-08:00
custom:
Author: colin-rogers-dbt
PR: "1077"
3 changes: 1 addition & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# install latest changes in dbt-core
# TODO: how to automate switching from develop to version branches?
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter
git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter
# if version 1.x or greater -> pin to major version
# if version 0.x -> pin to minor
black~=23.12
Expand Down
23 changes: 0 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,8 @@ def _dbt_bigquery_version() -> str:
return attributes["version"]


# require a compatible minor version (~=) and prerelease if this is a prerelease
def _dbt_core_version(plugin_version: str) -> str:
"""
Determine the compatible version of dbt-core using this package's version
"""
try:
# *_ may indicate a dev release which won't affect the core version needed
major, minor, plugin_patch, *_ = plugin_version.split(".", maxsplit=3)
except ValueError:
raise ValueError(f"Invalid version: {plugin_version}")

pre_release_phase = "".join([i for i in plugin_patch if not i.isdigit()])
if pre_release_phase:
if pre_release_phase not in ["a", "b", "rc"]:
raise ValueError(f"Invalid version: {plugin_version}")
core_patch = f"0{pre_release_phase}1"
else:
core_patch = "0"

return f"{major}.{minor}.{core_patch}"


package_name = "dbt-bigquery"
package_version = "1.8.0a1"
dbt_core_version = _dbt_core_version(_dbt_bigquery_version())
description = """The BigQuery adapter plugin for dbt"""

setup(
Expand Down

0 comments on commit 8fc40e6

Please sign in to comment.