Skip to content

Commit

Permalink
Merge pull request #1333 from mabel-dev/0.12.0b123
Browse files Browse the repository at this point in the history
0.12.0b123
  • Loading branch information
joocer authored Dec 13, 2023
2 parents c4da64d + 88ee50e commit a2c2ec6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_counter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
id: check_changes
run: |
changes=$(git diff --name-only)
if [[ "$changes" == *"__build.py__"* ]]; then
if [[ "$changes" == *"__version__.py"* ]]; then
echo "::set-output name=changes::0"
else
echo "::set-output name=changes::1"
Expand All @@ -32,6 +32,6 @@ jobs:
python $GITHUB_WORKSPACE/build_counter.py
git config --global user.name "XB500"
git config --global user.email "[email protected]"
git add $GITHUB_WORKSPACE/opteryx/__build__.py
git add $GITHUB_WORKSPACE/opteryx/__version__.py
git commit -m "Update Build Number to $GITHUB_RUN_NUMBER"
git push
6 changes: 5 additions & 1 deletion build_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
if build_number:
build_numnber = int(build_number)

with open("opteryx/__version__.py", "r") as f:
contents = f.read().splitlines()[1:]

# Save the build number to the build.py file
with open("opteryx/__build__.py", "w") as f:
with open("opteryx/__version__.py", "w") as f:
f.write(f"__build__ = {build_number}\n")
f.write("\n".join(contents))

print(f"Build Number: {build_number}")
1 change: 0 additions & 1 deletion opteryx/__build__.py

This file was deleted.

10 changes: 3 additions & 7 deletions opteryx/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__build__ = 127
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -15,12 +16,7 @@
1) we don't load dependencies by storing it in __init__.py
2) we can import it in setup.py for the same reason
"""
from enum import Enum

__build__ = "notset"
with open(f"__build__.py", mode="r") as v:
build = v.read()
exec(build) # nosec
from enum import Enum # isort: skip


class VersionStatus(Enum):
Expand All @@ -36,4 +32,4 @@ class VersionStatus(Enum):

__version__ = f"{_major}.{_minor}.{_revision}" + (
f"-{_status.value}.{__build__}" if _status != VersionStatus.RELEASE else ""
)
)
5 changes: 0 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ def rust_build(setup_kwargs: Dict[str, Any]) -> None:
vers = v.read()
exec(vers) # nosec

__build__ = "notset"
with open(f"{LIBRARY}/__build__.py", mode="r") as v:
build = v.read()
exec(build) # nosec

__author__ = "notset"
with open(f"{LIBRARY}/__author__.py", mode="r") as v:
author = v.read()
Expand Down

0 comments on commit a2c2ec6

Please sign in to comment.