Skip to content

Commit

Permalink
Merge branch 'main' into catalog_enable_stats
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke authored May 16, 2024
2 parents b527762 + 87a6e80 commit 1be9672
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
2 changes: 0 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,4 @@ first_value = 1

[bumpversion:part:nightly]

[bumpversion:file:setup.py]

[bumpversion:file:dbt/adapters/snowflake/__version__.py]
30 changes: 14 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/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 @@ -28,28 +29,25 @@
long_description = f.read()


# 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()
# 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"]


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

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

0 comments on commit 1be9672

Please sign in to comment.