Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more sophisticated versioning (take 2) #70

Merged
merged 3 commits into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dbt/adapters/sqlserver/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = '0.18.0b2'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikaelene @jtcohen6 any guidance on what this version should be? We'll prolly cut a release soon-ish that incorporates all of these recent PRs....

do we include the most recent patch release (.1) number? what does the b mean?

Suggested change
version = '0.18.0b2'
version = '0.18.1b0'

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not done any 0.18.1 release yet. If we fix the snapshot-check-strategy and make sure all connections variations work. Why not 0.18.1? 😀. That is a dbt version that it works well with

35 changes: 33 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,42 @@
#!/usr/bin/env python
from setuptools import find_packages
from distutils.core import setup
import os
import re

this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md')) as f:
long_description = f.read()


package_name = "dbt-sqlserver"
package_version = "0.18.1"


# get this from a separate file
def _dbt_sqlserver_version():
_version_path = os.path.join(
this_directory, 'dbt', 'adapters', 'sqlserver', '__version__.py'
)
_version_pattern = r'''version\s*=\s*["'](.+)["']'''
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.group(1)


package_version = _dbt_sqlserver_version()
description = """A sqlserver adapter plugin for dbt (data build tool)"""

dbt_version = '0.18.0'
# the package version should be the dbt version, with maybe some things on the
# ends of it. (0.18.1 vs 0.18.1a1, 0.18.1.1, ...)
if not package_version.startswith(dbt_version):
raise ValueError(
f'Invalid setup.py: package_version={package_version} must start with '
f'dbt_version={dbt_version}'
)

setup(
name=package_name,
version=package_version,
Expand All @@ -26,4 +57,4 @@
]
},
install_requires=["dbt-core~=0.18.0", "pyodbc>=4.0.27", "azure-identity>=1.4.0"],
)
)