Skip to content

Commit 0a41e11

Browse files
authored
fix: use version from src/substrait/__init__.py (#143)
I realized while looking at #142 that there is already a substrait version variable defined in `src/substrait/__init__.py` which gets updated when the Git submodule is updated and we don't need the one in `src/substrait/gen/version.py`. Signed-off-by: Niels Pardon <[email protected]>
1 parent 7a09cce commit 0a41e11

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

pyproject.toml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,10 @@ update-substrait = [ { task = "update-submodule" }, { task = "codegen" }]
5353

5454
update-submodule = "./update_submodule.sh"
5555

56-
codegen = [{ task = "antlr" }, { task = "codegen-proto" }, { task = "codegen-extensions" }, { task = "codegen-version" }]
56+
codegen = [{ task = "antlr" }, { task = "codegen-proto" }, { task = "codegen-extensions" }]
5757

5858
check-codegen = "./check_codegen.sh"
5959

60-
codegen-version = """bash -c '
61-
cd third_party/substrait
62-
export version=$(git describe --tags | tr -d 'v')
63-
echo "substrait_version = \\"$version\\"" > ../../src/substrait/gen/version.py
64-
'"""
65-
6660
codegen-proto = "./gen_proto.sh"
6761

6862
antlr = """

src/substrait/builders/plan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
import substrait.gen.proto.extended_expression_pb2 as stee
1313
import substrait.gen.proto.plan_pb2 as stp
1414
import substrait.gen.proto.type_pb2 as stt
15+
from substrait import __substrait_version__
1516
from substrait.builders.extended_expression import (
1617
ExtendedExpressionOrUnbound,
1718
resolve_expression,
1819
)
1920
from substrait.extension_registry import ExtensionRegistry
2021
from substrait.gen.proto.extensions.extensions_pb2 import AdvancedExtension
21-
from substrait.gen.version import substrait_version
2222
from substrait.type_inference import infer_plan_schema
2323
from substrait.utils import (
2424
merge_extension_declarations,
@@ -33,7 +33,7 @@
3333

3434
def _create_default_version():
3535
p = re.compile(r"(\d+)\.(\d+)\.(\d+)")
36-
m = p.match(substrait_version)
36+
m = p.match(__substrait_version__)
3737
global default_version
3838
default_version = stp.Version(
3939
major_number=int(m.group(1)),

src/substrait/gen/version.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)