Skip to content

Commit

Permalink
(7/x) Move package version from setup.py to pyproject.toml
Browse files Browse the repository at this point in the history
We now specify the package version in a single place: pyproject.toml so
it's not necessary to dynamically figure it out in setup.py.

Copped the new contents of __version__.py from the Poetry github issue
tracker here:

python-poetry/poetry#144 (comment)

Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
  • Loading branch information
susodapop committed Aug 24, 2023
1 parent 563619a commit 9e0c23a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
3 changes: 2 additions & 1 deletion dbt/adapters/databricks/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
version: str = "1.6.1"
import importlib.metadata
__version__= importlib.metadata.version('dbt-databricks')
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[tool.poetry]
name = "dbt-databricks"
version = "1.6.1"
description = "The Databricks adapter plugin for dbt"
authors = ["Databricks <feedback@databricks.com>"]
readme = "README.md"
Expand Down
14 changes: 0 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
import os
import sys


Expand All @@ -16,21 +15,8 @@
sys.exit(1)


# get this package's version from dbt/adapters/<name>/__version__.py
def _get_plugin_version():
_version_path = os.path.join(this_directory, "dbt", "adapters", "databricks", "__version__.py")
try:
exec(open(_version_path).read())
return locals()["version"]
except IOError:
print("Failed to load dbt-databricks version file for packaging.", file=sys.stderr)
sys.exit(-1)


package_version = _get_plugin_version()
setup(

version=package_version,
url="https://github.com/databricks/dbt-databricks",
packages=find_namespace_packages(include=["dbt", "dbt.*"]),
include_package_data=True,
Expand Down

0 comments on commit 9e0c23a

Please sign in to comment.