Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add version info to cli and IR #227

Merged
merged 1 commit into from
Dec 11, 2024
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
3 changes: 3 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ search = {current_version}

[bumpversion:file:CHANGELOG.md]
search = Next Release

[bumpversion:file:hvcc/version.py]
search = {current_version}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Features:
* Use pydantic to validate and access HeavyLang and HeavyIR objects
* Allow loading external generator python module @eu-ch
* Meta: additional global setting to automatically set `HV_SIMD_NONE`
* Add version info to cli and IR result.

Bugfixes:

Expand Down
8 changes: 8 additions & 0 deletions hvcc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
)
from hvcc.types.IR import IRGraph
from hvcc.types.meta import Meta
from hvcc.version import VERSION


class Colours:
Expand Down Expand Up @@ -461,6 +462,13 @@ def main() -> bool:
parser.add_argument(
"--copyright",
help="A string indicating the owner of the copyright.")
parser.add_argument(
"-V",
"--version",
action='version',
help="Print version and exit.",
version=VERSION
)
args = parser.parse_args()

in_path = os.path.abspath(args.in_path)
Expand Down
2 changes: 2 additions & 0 deletions hvcc/types/IR.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import Dict, List, Optional, Union

from hvcc.types.Lang import LangLetType
from hvcc.version import VERSION


# IR Object Definitions
Expand Down Expand Up @@ -126,6 +127,7 @@ class IRSignal(BaseModel):


class IRGraph(BaseModel):
version: str = VERSION
name: IRName
objects: Dict[str, IRObjectdict] = {}
init: IRInit
Expand Down
1 change: 1 addition & 0 deletions hvcc/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION = "0.12.1"
Loading