Skip to content
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
17 changes: 17 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tool.bumpversion]
current_version = "3.6.0"
commit = true
tag = false
tag_name = "v{new_version}"
allow_dirty = true

[[tool.bumpversion.files]]
filename = "pyproject.toml"

[[tool.bumpversion.files]]
filename = "chdb/__init__.py"

[[tool.bumpversion.files]]
filename = "docs/conf.py"
search = "version = release = '{current_version}'"
replace = "version = release = '{new_version}'"
9 changes: 2 additions & 7 deletions chdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ChdbError(Exception):
# UDF script path will be f"{g_udf_path}/{func_name}.py"
g_udf_path = ""

chdb_version = ('3', '6', '0')
__version__ = "3.6.0"
if sys.version_info[:2] >= (3, 7):
# get the path of the current file
current_path = os.path.dirname(os.path.abspath(__file__))
Expand All @@ -67,12 +67,7 @@ class ChdbError(Exception):
else:
raise NotImplementedError("Python 3.6 or lower version is not supported")

try:
# Change here if project is renamed and does not equal the package name
dist_name = __name__
__version__ = ".".join(map(str, chdb_version))
except: # noqa
__version__ = "unknown"
chdb_version = tuple(__version__.split('.'))


# return pyarrow table
Expand Down
20 changes: 0 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,6 @@ def get_latest_git_tag(minor_ver_auto=False):
print(e)
raise


# replace the version in chdb/__init__.py, which is `chdb_version = ('0', '1', '0')` by default
# regex replace the version string `chdb_version = ('0', '1', '0')` with version parts
def fix_version_init(version):
# split version string into parts
p1, p2, p3 = version.split(".")
init_file = os.path.join(script_dir, "chdb", "__init__.py")
with open(init_file, "r+") as f:
init_content = f.read()
# regex replace the version string `chdb_version = ('0', '1', '0')`
regPattern = r"chdb_version = \(\'\d+\', \'\d+\', \'\d+\'\)"
init_content = re.sub(
regPattern, f"chdb_version = ('{p1}', '{p2}', '{p3}')", init_content
)
f.seek(0)
f.write(init_content)
f.truncate()


# Update version in pyproject.toml
def update_pyproject_version(version):
pyproject_file = os.path.join(script_dir, "pyproject.toml")
Expand Down Expand Up @@ -165,7 +146,6 @@ def build_extensions(self):
]
# fix the version in chdb/__init__.py
versionStr = get_latest_git_tag()
fix_version_init(versionStr)
# Call the function to update pyproject.toml
# update_pyproject_version(versionStr)

Expand Down
Loading