Add --version

This commit is contained in:
Leo Vasanko
2026-01-17 23:43:14 +00:00
parent 7fc549e2f3
commit ee4e682cfc
3 changed files with 14 additions and 0 deletions
+1
View File
@@ -3,3 +3,4 @@
*.lock
__pycache__/
dist/
/_version.py
+10
View File
@@ -21,6 +21,11 @@ from textwrap import indent
import tomli_w
try:
from _version import __version__
except ImportError:
__version__ = "0.0.0+unknown"
# Template directory
TEMPLATE_DIR = Path(__file__).parent / "template"
@@ -896,6 +901,11 @@ Examples:
parser.add_argument(
"--dry-run", action="store_true", help="Show what would be done"
)
parser.add_argument(
"--version",
action="version",
version=f"%(prog)s {__version__}",
)
args = parser.parse_args()
+3
View File
@@ -22,6 +22,9 @@ fastapi-vue-setup = "fastapi_vue_setup:main"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "_version.py"
[tool.hatch.build.targets.wheel]
include = ["fastapi_vue_setup.py", "template/**/*", "_version.py"]