Skip to content

Commit 044111a

Browse files
build: rename distribution to gitmate-cli, finalize PyPI metadata
- dist name gitmate-cli (import package and CLI command stay gitmate); hatch wheel packages pinned to src/gitmate - authors, keywords, classifiers, project URLs; --version/-V via importlib.metadata - sdist excludes internal docs (plan.md, AGENTS.md)
1 parent 69478e5 commit 044111a

4 files changed

Lines changed: 78 additions & 2 deletions

File tree

‎pyproject.toml‎

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,36 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "gitmate"
6+
name = "gitmate-cli"
77
version = "0.1.0"
88
description = "AI-assisted git commit messages, PR summaries, and changelogs"
99
readme = "README.md"
1010
requires-python = ">=3.11"
1111
license = { text = "Apache-2.0" }
12+
authors = [{ name = "Amar K P", email = "amarkerpala59@gmail.com" }]
13+
keywords = [
14+
"git",
15+
"commit",
16+
"commit-message",
17+
"changelog",
18+
"pull-request",
19+
"llm",
20+
"ai",
21+
"gemini",
22+
]
23+
classifiers = [
24+
"Development Status :: 4 - Beta",
25+
"Environment :: Console",
26+
"Intended Audience :: Developers",
27+
"License :: OSI Approved :: Apache Software License",
28+
"Operating System :: OS Independent",
29+
"Programming Language :: Python :: 3",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
"Programming Language :: Python :: 3.13",
33+
"Programming Language :: Python :: 3.14",
34+
"Topic :: Software Development :: Version Control :: Git",
35+
]
1236
dependencies = [
1337
"typer>=0.12",
1438
"rich>=13.0",
@@ -22,6 +46,12 @@ dependencies = [
2246
"pyperclip>=1.8.2",
2347
]
2448

49+
[project.urls]
50+
Homepage = "https://github.com/getdownandcode/gitmate"
51+
Repository = "https://github.com/getdownandcode/gitmate"
52+
Issues = "https://github.com/getdownandcode/gitmate/issues"
53+
Changelog = "https://github.com/getdownandcode/gitmate/blob/main/CHANGELOG.md"
54+
2555
[project.optional-dependencies]
2656
dev = [
2757
"pytest>=8.0",
@@ -34,6 +64,14 @@ dev = [
3464
gitmate = "gitmate.cli:app"
3565
gitmate-hook = "gitmate.hooks:main"
3666

67+
# Internal build documentation; not needed by anyone who pip-installs.
68+
[tool.hatch.build.targets.sdist]
69+
exclude = ["plan.md", "AGENTS.md"]
70+
71+
# Import package differs from the distribution name (gitmate vs gitmate-cli).
72+
[tool.hatch.build.targets.wheel]
73+
packages = ["src/gitmate"]
74+
3775
[tool.ruff]
3876
line-length = 100
3977
target-version = "py311"

‎src/gitmate/cli.py‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,35 @@
2424
err_console = Console(stderr=True)
2525
secret_store: config_mod.SecretStore = config_mod.KeyringSecretStore()
2626

27+
#: The installed distribution name; the CLI command stays `gitmate`.
28+
DIST_NAME = "gitmate-cli"
29+
30+
31+
def _version_callback(value: bool) -> None:
32+
"""Print the installed distribution version for --version."""
33+
if value:
34+
from importlib.metadata import PackageNotFoundError, version
35+
36+
try:
37+
console.print(version(DIST_NAME))
38+
except PackageNotFoundError:
39+
console.print("unknown (gitmate-cli is not installed as a distribution)")
40+
raise typer.Exit()
41+
42+
43+
@app.callback()
44+
def _main(
45+
version: bool = typer.Option(
46+
False,
47+
"--version",
48+
"-V",
49+
help="Show the installed gitmate version and exit.",
50+
callback=_version_callback,
51+
is_eager=True,
52+
),
53+
) -> None:
54+
"""AI-assisted git commit messages, PR summaries, and changelogs."""
55+
2756

2857
def _stub(name: str, milestone: str) -> None:
2958
"""Report a planned command that has no implementation yet."""

‎tests/test_cli.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ def test_help_lists_all_commands() -> None:
2828
assert name in result.output
2929

3030

31+
def test_version_flag_prints_distribution_version() -> None:
32+
from importlib.metadata import version
33+
34+
for flag in ("--version", "-V"):
35+
result = runner.invoke(cli.app, [flag])
36+
assert result.exit_code == 0
37+
assert version("gitmate-cli") in result.output
38+
39+
3140
def test_stubs_report_not_implemented() -> None:
3241
result = runner.invoke(cli.app, ["doc"])
3342
assert result.exit_code == 0

‎uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)