Skip to content

Commit 9937bc5

Browse files
authored
Merge pull request #2890 from mabel-dev/0.26.0-release
0.26.0-release
2 parents b7614fb + a2af7c5 commit 9937bc5

File tree

6 files changed

+25
-14
lines changed

6 files changed

+25
-14
lines changed

dev/build_counter.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
1+
"""
2+
Build counter script to increment build number on each build.
3+
4+
We update the __version__ module and the version in pyproject.toml to keep them in sync.
5+
"""
6+
17
import re
28
import subprocess
39
from pathlib import Path
410

511
from enum import Enum # isort: skip
612

713
class VersionStatus(Enum):
14+
"""
15+
Enumeration for version status.
16+
"""
817
ALPHA = "alpha"
918
BETA = "beta"
1019
RELEASE = "release"
1120

1221
__major_version__ = 0
1322
__minor_version__ = 26
14-
__revision_version__ = 0
23+
__revision_version__ = 1
1524
__author__ = "@joocer"
1625
__status__ = VersionStatus.BETA
1726

1827
__build__ = None
19-
with open("opteryx/__version__.py", mode="r") as v:
28+
with open("opteryx/__version__.py", mode="r", encoding="utf-8") as v:
2029
vers = v.read()
2130
exec(vers) # nosec
2231

2332
if __build__:
2433
__build__ = int(__build__) + 1
25-
__version__ = f"{__major_version__}.{__minor_version__}.{__revision_version__}" + f"-{__status__.value}.{__build__}" if __status__ != VersionStatus.RELEASE else ""
34+
__version__ = f"{__major_version__}.{__minor_version__}.{__revision_version__}"
35+
if __status__ != VersionStatus.RELEASE:
36+
__version__ += f"-{__status__.value}.{__build__}"
2637

2738
VERSION_FILE_CONTENT = f"""# THIS FILE IS AUTOMATICALLY UPDATED DURING THE BUILD PROCESS
2839
# DO NOT EDIT THIS FILE DIRECTLY
@@ -48,14 +59,14 @@ class VersionStatus(Enum):
4859
print(__version__)
4960

5061
pyproject_path = Path("pyproject.toml")
51-
pyproject_contents = pyproject_path.read_text()
62+
pyproject_contents = pyproject_path.read_text(encoding="utf-8")
5263
pattern = re.compile(r'^(version\s*=\s*")[^"]*(")', re.MULTILINE)
5364
updated_contents, replacements = pattern.subn(f'version = "{__version__}"', pyproject_contents, count=1)
5465

5566
if replacements == 0:
5667
msg = "Unable to locate version field in pyproject.toml"
5768
raise ValueError(msg)
5869

59-
pyproject_path.write_text(updated_contents)
70+
pyproject_path.write_text(updated_contents, encoding="utf-8")
6071

6172
subprocess.run(["git", "add", "opteryx/__version__.py", "pyproject.toml"])

opteryx/__version__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# THIS FILE IS AUTOMATICALLY UPDATED DURING THE BUILD PROCESS
22
# DO NOT EDIT THIS FILE DIRECTLY
33

4-
__build__ = 1724
4+
__build__ = 1726
55
__author__ = "@joocer"
6-
__version__ = "0.26.0-beta.1724"
6+
__version__ = "0.26.1-beta.1726"
77

88
# Store the version here so:
99
# 1) we don't load dependencies by storing it in __init__.py

opteryx/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ def line_value(value: str) -> typing.Any:
126126
try: # pragma: no cover
127127
_config_path = Path(".") / "opteryx.yaml"
128128
if _config_path.exists():
129-
with open(_config_path, "r") as _config_file:
129+
with open(_config_path, "r", encoding="utf-8") as _config_file:
130130
_config_values = parse_yaml(_config_file.read())
131131
if _OPTERYX_DEBUG:
132132
print(f"{datetime.datetime.now()} [LOADER] Loading config from {_config_path}")
133-
except Exception as exception: # pragma: no cover # it doesn't matter why - just use the defaults
133+
except OSError as exception: # pragma: no cover # it doesn't matter why - just use the defaults
134134
if _OPTERYX_DEBUG:
135135
print(
136136
f"{datetime.datetime.now()} [LOADER] Config file {_config_path} not used - {exception}"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "opteryx"
3-
version = "0.26.0-beta.1724"
3+
version = "0.26.1-beta.1726"
44
description = "Query your data, where it lives"
55
requires-python = '>=3.11'
66
readme = {file = "README.md", content-type = "text/markdown"}

tests/performance/clickbench/clickbench.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ def test_sql_battery(statement:str, exception: Optional[Exception]):
167167
iter_strs.append("-")
168168

169169
status = ""
170-
if avg_time > 5000:
170+
if min_time > 5000:
171171
status = " ⚠️ VERY SLOW"
172-
elif avg_time > 2000:
172+
elif min_time > 2000:
173173
status = " ⚠️ SLOW"
174174

175175
print(f"{query_num:<8} {iter_strs[0]:<16} {iter_strs[1]:<16} {iter_strs[2]:<16} "

tests/unit/planner/test_predicate_compaction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,5 +216,5 @@ def test_predicate_compaction_contradiction_inside_subquery():
216216

217217
if __name__ == "__main__": # pragma: no cover
218218
from tests import run_tests
219-
test_predicate_compaction_keeps_equality_with_additional_filters()
220-
#run_tests()
219+
220+
run_tests()

0 commit comments

Comments
 (0)