tgit 0.30.0__tar.gz → 0.32.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. {tgit-0.30.0 → tgit-0.32.0}/CHANGELOG.md +20 -0
  2. {tgit-0.30.0 → tgit-0.32.0}/PKG-INFO +2 -1
  3. {tgit-0.30.0 → tgit-0.32.0}/pyproject.toml +2 -1
  4. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_cli.py +43 -4
  5. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_commit.py +2 -0
  6. {tgit-0.30.0 → tgit-0.32.0}/tgit/cli.py +17 -0
  7. {tgit-0.30.0 → tgit-0.32.0}/tgit/commit.py +1 -1
  8. {tgit-0.30.0 → tgit-0.32.0}/uv.lock +249 -171
  9. {tgit-0.30.0 → tgit-0.32.0}/.claude/settings.local.json +0 -0
  10. {tgit-0.30.0 → tgit-0.32.0}/.github/workflows/build.yml +0 -0
  11. {tgit-0.30.0 → tgit-0.32.0}/.github/workflows/ci.yml +0 -0
  12. {tgit-0.30.0 → tgit-0.32.0}/.github/workflows/claude-code-review.yml +0 -0
  13. {tgit-0.30.0 → tgit-0.32.0}/.github/workflows/claude.yml +0 -0
  14. {tgit-0.30.0 → tgit-0.32.0}/.gitignore +0 -0
  15. {tgit-0.30.0 → tgit-0.32.0}/.python-version +0 -0
  16. {tgit-0.30.0 → tgit-0.32.0}/.tgit/settings.json +0 -0
  17. {tgit-0.30.0 → tgit-0.32.0}/.vscode/extensions.json +0 -0
  18. {tgit-0.30.0 → tgit-0.32.0}/.vscode/launch.json +0 -0
  19. {tgit-0.30.0 → tgit-0.32.0}/AGENTS.md +0 -0
  20. {tgit-0.30.0 → tgit-0.32.0}/CLAUDE.md +0 -0
  21. {tgit-0.30.0 → tgit-0.32.0}/LICENSE +0 -0
  22. {tgit-0.30.0 → tgit-0.32.0}/README.md +0 -0
  23. {tgit-0.30.0 → tgit-0.32.0}/pyrightconfig.json +0 -0
  24. {tgit-0.30.0 → tgit-0.32.0}/scripts/publish.sh +0 -0
  25. {tgit-0.30.0 → tgit-0.32.0}/scripts/test.sh +0 -0
  26. {tgit-0.30.0 → tgit-0.32.0}/tests/README.md +0 -0
  27. {tgit-0.30.0 → tgit-0.32.0}/tests/__init__.py +0 -0
  28. {tgit-0.30.0 → tgit-0.32.0}/tests/conftest.py +0 -0
  29. {tgit-0.30.0 → tgit-0.32.0}/tests/integration/__init__.py +0 -0
  30. {tgit-0.30.0 → tgit-0.32.0}/tests/integration/test_version_integration.py +0 -0
  31. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/__init__.py +0 -0
  32. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_add.py +0 -0
  33. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_changelog.py +0 -0
  34. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_changelog_coverage.py +0 -0
  35. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_commit_coverage.py +0 -0
  36. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_interactive_settings.py +0 -0
  37. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_settings.py +0 -0
  38. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_types.py +0 -0
  39. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_utils.py +0 -0
  40. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_utils_coverage.py +0 -0
  41. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_version.py +0 -0
  42. {tgit-0.30.0 → tgit-0.32.0}/tests/unit/test_version_coverage.py +0 -0
  43. {tgit-0.30.0 → tgit-0.32.0}/tgit/__init__.py +0 -0
  44. {tgit-0.30.0 → tgit-0.32.0}/tgit/add.py +0 -0
  45. {tgit-0.30.0 → tgit-0.32.0}/tgit/changelog.py +0 -0
  46. {tgit-0.30.0 → tgit-0.32.0}/tgit/constants.py +0 -0
  47. {tgit-0.30.0 → tgit-0.32.0}/tgit/interactive_settings.py +0 -0
  48. {tgit-0.30.0 → tgit-0.32.0}/tgit/prompts/commit.txt +0 -0
  49. {tgit-0.30.0 → tgit-0.32.0}/tgit/py.typed +0 -0
  50. {tgit-0.30.0 → tgit-0.32.0}/tgit/settings.py +0 -0
  51. {tgit-0.30.0 → tgit-0.32.0}/tgit/shared.py +0 -0
  52. {tgit-0.30.0 → tgit-0.32.0}/tgit/types.py +0 -0
  53. {tgit-0.30.0 → tgit-0.32.0}/tgit/utils/__init__.py +0 -0
  54. {tgit-0.30.0 → tgit-0.32.0}/tgit/version.py +0 -0
@@ -1,3 +1,23 @@
1
+ ## v0.32.0
2
+
3
+ [v0.31.0...v0.32.0](https://github.com/Jannchie/tgit/compare/v0.31.0...v0.32.0)
4
+
5
+ ### :sparkles: Features
6
+
7
+ - **cli**: set process title on startup - By [Jannchie](mailto:jannchie@gmail.com) in [8a4a008](https://github.com/Jannchie/tgit/commit/8a4a008)
8
+
9
+ ### :adhesive_bandage: Fixes
10
+
11
+ - **commit**: increase default max output tokens - By [Jannchie](mailto:jannchie@gmail.com) in [616d920](https://github.com/Jannchie/tgit/commit/616d920)
12
+
13
+ ## v0.31.0
14
+
15
+ [v0.30.0...v0.31.0](https://github.com/Jannchie/tgit/compare/v0.30.0...v0.31.0)
16
+
17
+ ### :sparkles: Features
18
+
19
+ - **cli**: add terminal title handling for cli - By [Jannchie](mailto:jannchie@gmail.com) in [65f1837](https://github.com/Jannchie/tgit/commit/65f1837)
20
+
1
21
  ## v0.30.0
2
22
 
3
23
  [v0.29.0...v0.30.0](https://github.com/Jannchie/tgit/compare/v0.29.0...v0.30.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tgit
3
- Version: 0.30.0
3
+ Version: 0.32.0
4
4
  Summary: AI-powered Git CLI for commits, changelogs, and semantic versioning.
5
5
  Project-URL: Homepage, https://github.com/Jannchie/tgit
6
6
  Project-URL: Repository, https://github.com/Jannchie/tgit
@@ -32,6 +32,7 @@ Requires-Dist: openai>=1.52.0
32
32
  Requires-Dist: pyyaml>=6.0.2
33
33
  Requires-Dist: questionary>=2.0.1
34
34
  Requires-Dist: rich>=13.9.4
35
+ Requires-Dist: setproctitle>=1.3.7
35
36
  Description-Content-Type: text/markdown
36
37
 
37
38
  # 🚀 TGIT - Tool for Git Interaction Temptation
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tgit"
3
- version = "0.30.0"
3
+ version = "0.32.0"
4
4
  description = "AI-powered Git CLI for commits, changelogs, and semantic versioning."
5
5
  authors = [{ name = "Jannchie", email = "jannchie@gmail.com" }]
6
6
  dependencies = [
@@ -12,6 +12,7 @@ dependencies = [
12
12
  "questionary>=2.0.1",
13
13
  "beautifulsoup4>=4.13.3",
14
14
  "click>=8.0.0",
15
+ "setproctitle>=1.3.7",
15
16
  ]
16
17
  readme = { content-type = "text/markdown", file = "README.md" }
17
18
  requires-python = ">= 3.11"
@@ -1,11 +1,10 @@
1
1
  import pytest
2
- from unittest.mock import patch, MagicMock
2
+ from unittest.mock import MagicMock, patch
3
3
  import click
4
4
  import threading
5
- import time
6
5
  from click.testing import CliRunner
7
6
 
8
- from tgit.cli import app, version_callback
7
+ from tgit.cli import app, set_process_title, set_terminal_title, version_callback
9
8
 
10
9
 
11
10
  class TestCLI:
@@ -54,7 +53,9 @@ class TestCLI:
54
53
  mock_ctx.exit.assert_not_called()
55
54
 
56
55
  @patch("tgit.cli.threading.Thread")
57
- def test_app_starts_openai_import_thread(self, mock_thread):
56
+ @patch("tgit.cli.set_process_title")
57
+ @patch("tgit.cli.set_terminal_title")
58
+ def test_app_starts_openai_import_thread(self, mock_set_terminal_title, mock_set_process_title, mock_thread):
58
59
  """Test that app starts a thread for OpenAI import"""
59
60
  mock_thread_instance = MagicMock()
60
61
  mock_thread.return_value = mock_thread_instance
@@ -62,6 +63,8 @@ class TestCLI:
62
63
  # Directly call the app function to test the callback
63
64
  app.callback()
64
65
 
66
+ mock_set_process_title.assert_called_once_with("tgit")
67
+ mock_set_terminal_title.assert_called_once_with("tgit")
65
68
  # The app should run the callback and start the thread
66
69
  mock_thread.assert_called_once()
67
70
  mock_thread_instance.start.assert_called_once()
@@ -87,6 +90,42 @@ class TestCLI:
87
90
  assert isinstance(app, click.Group)
88
91
  # Verify the app exists and is configured correctly
89
92
 
93
+ @patch("tgit.cli.setproctitle_module.setproctitle")
94
+ def test_set_process_title_updates_process_name(self, mock_setproctitle):
95
+ """Test process title is updated when support is available."""
96
+ set_process_title("tgit")
97
+
98
+ mock_setproctitle.assert_called_once_with("tgit")
99
+
100
+ @patch("tgit.cli.setproctitle_module.setproctitle", side_effect=RuntimeError("boom"))
101
+ def test_set_process_title_ignores_errors(self, mock_setproctitle):
102
+ """Test process title errors do not break CLI startup."""
103
+ set_process_title("tgit")
104
+
105
+ mock_setproctitle.assert_called_once_with("tgit")
106
+
107
+ @patch("tgit.cli.sys.stdout.flush")
108
+ @patch("tgit.cli.sys.stdout.write")
109
+ @patch("tgit.cli.sys.stdout.isatty", return_value=True)
110
+ def test_set_terminal_title_writes_escape_sequence(self, mock_isatty, mock_write, mock_flush):
111
+ """Test terminal title is written for TTY outputs."""
112
+ set_terminal_title("tgit")
113
+
114
+ mock_isatty.assert_called_once()
115
+ mock_write.assert_called_once_with("\033]0;tgit\a")
116
+ mock_flush.assert_called_once()
117
+
118
+ @patch("tgit.cli.sys.stdout.flush")
119
+ @patch("tgit.cli.sys.stdout.write")
120
+ @patch("tgit.cli.sys.stdout.isatty", return_value=False)
121
+ def test_set_terminal_title_skips_non_tty(self, mock_isatty, mock_write, mock_flush):
122
+ """Test terminal title is not written for non-TTY outputs."""
123
+ set_terminal_title("tgit")
124
+
125
+ mock_isatty.assert_called_once()
126
+ mock_write.assert_not_called()
127
+ mock_flush.assert_not_called()
128
+
90
129
 
91
130
  class TestOpenAIDependencyHandling:
92
131
  """Test OpenAI dependency handling in CLI."""
@@ -11,6 +11,7 @@ from click.testing import CliRunner
11
11
  from tgit.commit import (
12
12
  CommitArgs,
13
13
  CommitData,
14
+ DEFAULT_MAX_OUTPUT_TOKENS,
14
15
  MAX_DIFF_SECTION_CHARS,
15
16
  PotentialSecret,
16
17
  TRUNCATED_DIFF_HEAD_CHARS,
@@ -431,6 +432,7 @@ class TestGenerateCommitWithAI:
431
432
  mock_create_client.assert_called_once()
432
433
  mock_client.responses.parse.assert_called_once()
433
434
  _, kwargs = mock_client.responses.parse.call_args
435
+ assert kwargs["max_output_tokens"] == DEFAULT_MAX_OUTPUT_TOKENS
434
436
  assert "reasoning" not in kwargs
435
437
 
436
438
  @patch("tgit.commit._check_openai_availability")
@@ -1,8 +1,10 @@
1
1
  import contextlib
2
2
  import importlib.metadata
3
+ import sys
3
4
  import threading
4
5
 
5
6
  import click
7
+ import setproctitle as setproctitle_module
6
8
 
7
9
  from tgit.add import add
8
10
  from tgit.changelog import changelog
@@ -12,6 +14,18 @@ from tgit.utils import console
12
14
  from tgit.version import version
13
15
 
14
16
 
17
+ def set_process_title(title: str) -> None:
18
+ with contextlib.suppress(Exception):
19
+ setproctitle_module.setproctitle(title)
20
+
21
+
22
+ def set_terminal_title(title: str) -> None:
23
+ if not sys.stdout.isatty():
24
+ return
25
+ sys.stdout.write(f"\033]0;{title}\a")
26
+ sys.stdout.flush()
27
+
28
+
15
29
  def version_callback(ctx: click.Context, _param: click.Parameter, value: bool) -> None: # noqa: FBT001
16
30
  if not value or ctx.resilient_parsing:
17
31
  return
@@ -34,6 +48,9 @@ def version_callback(ctx: click.Context, _param: click.Parameter, value: bool) -
34
48
  help="Show version",
35
49
  )
36
50
  def app() -> None:
51
+ set_process_title("tgit")
52
+ set_terminal_title("tgit")
53
+
37
54
  def import_openai() -> None:
38
55
  with contextlib.suppress(Exception):
39
56
  import openai # noqa: F401, PLC0415
@@ -25,7 +25,7 @@ with importlib.resources.path("tgit", "prompts") as prompt_path:
25
25
  commit_types = ["feat", "fix", "chore", "docs", "style", "refactor", "perf", "test", "ci"]
26
26
  commit_file = "commit.txt"
27
27
  commit_prompt_template = env.get_template("commit.txt")
28
- DEFAULT_MAX_OUTPUT_TOKENS = 256
28
+ DEFAULT_MAX_OUTPUT_TOKENS = 1024
29
29
 
30
30
  # Define click arguments/options at module level to avoid B008
31
31
  MESSAGE_ARG = click.argument(