Skip to content

Commit

Permalink
Merge branch 'main' into show-objects
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare authored May 16, 2024
2 parents fd1ab4f + 87a6e80 commit 73e3bad
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 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]
36 changes: 17 additions & 19 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 All @@ -59,11 +57,11 @@ def _get_plugin_version_dict():
packages=find_namespace_packages(include=["dbt", "dbt.*"]),
include_package_data=True,
install_requires=[
"dbt-common>=0.1.0a1,<2.0",
"dbt-adapters>=1.1.0rc1,<2.0",
"dbt-common>=1.0.4,<2.0",
"dbt-adapters>=1.1.1,<2.0",
"snowflake-connector-python[secure-local-storage]~=3.0",
# add dbt-core to ensure backwards compatibility of installation, this is not a functional dependency
"dbt-core>=1.8.0a1",
"dbt-core>=1.8.0",
# installed via dbt-core but referenced directly; don't pin to avoid version conflicts with dbt-core
"agate",
],
Expand Down

0 comments on commit 73e3bad

Please sign in to comment.