Skip to content

Commit f527524

Browse files
committed
Version bump; add boltzgen -v to get package version
1 parent 159717c commit f527524

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ build-backend = "setuptools.build_meta"
99
[project]
1010
name = "boltzgen"
1111
requires-python = ">=3.9"
12-
#dynamic = ["version"]
13-
version = "0.1.3"
12+
version = "0.1.4"
13+
readme = "README.md"
14+
description = "Protein design"
1415
dependencies = [
1516
# Add runtime dependencies here
1617
"numpy==2.0.2",

src/boltzgen/cli/boltzgen.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
from boltzgen.data.parse.schema import YamlDesignParser
5151
from boltzgen.data.write.mmcif import to_mmcif
5252
from boltzgen.task.task import Task
53+
from importlib.metadata import PackageNotFoundError, version as pkg_version
5354

5455
### Paths and constants ####
5556
# Get the path to the project root (where main.py and configs/ are located)
@@ -487,6 +488,19 @@ def build_parser() -> argparse.ArgumentParser:
487488
prog="boltzgen",
488489
description="Boltzgen command line interface",
489490
)
491+
# Support: boltzgen -v / --version
492+
def get_package_version() -> str:
493+
try:
494+
return pkg_version("boltzgen")
495+
except PackageNotFoundError:
496+
return "unknown"
497+
parser.add_argument(
498+
"-v",
499+
"--version",
500+
action="version",
501+
version=f"boltzgen {get_package_version()}",
502+
help="Print version and exit",
503+
)
490504
subparsers = parser.add_subparsers(dest="command", required=True)
491505
build_run_parser(subparsers)
492506
build_configure_parser(subparsers)

0 commit comments

Comments
 (0)