Skip to content

Commit f43b54d

Browse files
committed
Publish both the dist package version and the duckdb version
1 parent e42c5a2 commit f43b54d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

duckdb/__init__.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
_exported_symbols = []
2-
31
# Modules
42
import duckdb.functional as functional
53
import duckdb.typing as typing
4+
from _duckdb import __version__ as duckdb_version
5+
from importlib.metadata import version
6+
7+
# duckdb.__version__ returns the version of the distribution package, i.e. the pypi version
8+
__version__ = version("duckdb")
9+
10+
# version() is a more human friendly formatted version string of both the distribution package and the bundled duckdb
11+
def version():
12+
return f"{__version__} (with duckdb {duckdb_version})"
13+
14+
_exported_symbols = ['__version__', 'version']
615

716
_exported_symbols.extend([
817
"typing",
@@ -248,7 +257,6 @@
248257
__interactive__,
249258
__jupyter__,
250259
__formatted_python_version__,
251-
__version__,
252260
apilevel,
253261
comment,
254262
identifier,
@@ -266,7 +274,6 @@
266274
"__interactive__",
267275
"__jupyter__",
268276
"__formatted_python_version__",
269-
"__version__",
270277
"apilevel",
271278
"comment",
272279
"identifier",

0 commit comments

Comments
 (0)