Skip to content

Commit

Permalink
Show kontrol version number with the kontrol version command (#77)
Browse files Browse the repository at this point in the history
* Show Kontrol version number with the  subcommand

* format code

* add new_version in github test-pr workflow and revert the version to 0.1.17


* Disable -v option for command \'kontrol version\'


* use single quote for field name "verbose"

---------

Co-authored-by: devops <devops@runtimeverification.com>
  • Loading branch information
spencerhaoxiao and devops authored Oct 5, 2023
1 parent 336c92e commit 2182efe
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
og_version=$(git show origin/${GITHUB_BASE_REF}:package/version)
./package/version.sh bump ${og_version}
./package/version.sh sub
new_version=$(cat package/version)
sed --in-place "s/^VERSION: Final = '.*'$/VERSION: Final = '${new_version}'/" src/kontrol/__init__.py
git add --update && git commit --message "Set Version: $(cat package/version)" || true
- name: 'Push updates'
run: git push origin HEAD:${GITHUB_HEAD_REF}
Expand Down
2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.17
0.1.18
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "kontrol"
version = "0.1.17"
version = "0.1.18"
description = "Foundry integration for KEVM"
authors = [
"Runtime Verification, Inc. <contact@runtimeverification.com>",
Expand Down
8 changes: 8 additions & 0 deletions src/kontrol/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from __future__ import annotations

from typing import TYPE_CHECKING

if TYPE_CHECKING:
from typing import Final

VERSION: Final = '0.1.18'
7 changes: 4 additions & 3 deletions src/kontrol/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from pyk.cli.utils import file_path
from pyk.proof.tui import APRProofViewer

from . import VERSION
from .cli import KontrolCLIArgs
from .foundry import (
Foundry,
Expand Down Expand Up @@ -72,7 +73,7 @@ def main() -> None:


def exec_version(**kwargs: Any) -> None:
raise NotImplementedError()
print(f'Kontrol version: {VERSION}')


def exec_compile(contract_file: Path, **kwargs: Any) -> None:
Expand Down Expand Up @@ -658,10 +659,10 @@ def _parse_test_version_tuple(value: str) -> tuple[str, int | None]:


def _loglevel(args: Namespace) -> int:
if args.debug:
if hasattr(args, 'debug') and args.debug:
return logging.DEBUG

if args.verbose:
if hasattr(args, 'verbose') and args.verbose:
return logging.INFO

return logging.WARNING
Expand Down

0 comments on commit 2182efe

Please sign in to comment.