Skip to content

Commit

Permalink
Add changie
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke committed May 16, 2024
1 parent 1be9672 commit 34b3aad
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ first_value = 1

[bumpversion:part:nightly]

[bumpversion:file:setup.py]

[bumpversion:file:dbt/adapters/snowflake/__version__.py]
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240516-224134.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Allow enabling/disabling stats collection on catalog table using env var
time: 2024-05-16T22:41:34.256095+01:00
custom:
Author: aranke
Issue: "1048"
30 changes: 16 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env python
import os
from pathlib import Path

import sys
import re

# require python 3.8 or newer
if sys.version_info < (3, 8):
Expand All @@ -29,25 +28,28 @@
long_description = f.read()


# used for this adapter's version
VERSION = Path(__file__).parent / "dbt/adapters/snowflake/__version__.py"


def _plugin_version() -> str:
"""
Pull the package version from the main package version file
"""
attributes = {}
exec(VERSION.read_text(), attributes)
return attributes["version"]
# get this package's version from dbt/adapters/<adapter name>/__version__.py
def _get_plugin_version_dict():
_version_path = os.path.join(this_directory, "dbt", "adapters", "snowflake", "__version__.py")
_semver = r"""(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)"""
_pre = r"""((?P<prekind>a|b|rc)(?P<pre>\d+))?"""
_nightly = r"""(\.(?P<nightly>[a-z0-9]+)?)?"""
_build = r"""(\+build[0-9]+)?"""
_version_pattern = rf"""version\s*=\s*["']{_semver}{_pre}{_nightly}{_build}["']"""
with open(_version_path) as f:
match = re.search(_version_pattern, f.read().strip())
if match is None:
raise ValueError(f"invalid version at {_version_path}")
return match.groupdict()


package_name = "dbt-snowflake"
package_version = "1.9.0a1"
description = """The Snowflake adapter plugin for dbt"""

setup(
name=package_name,
version=_plugin_version(),
version=package_version,
description=description,
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 34b3aad

Please sign in to comment.