ticket2pr 0.3.2__tar.gz → 0.3.4__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 (43) hide show
  1. {ticket2pr-0.3.2/ticket2pr.egg-info → ticket2pr-0.3.4}/PKG-INFO +1 -1
  2. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/pyproject.toml +1 -1
  3. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/setup.py +1 -1
  4. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/cli.py +16 -3
  5. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/clients/github_client.py +4 -0
  6. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/enhanced_git.py +4 -8
  7. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/exceptions.py +6 -2
  8. {ticket2pr-0.3.2 → ticket2pr-0.3.4/ticket2pr.egg-info}/PKG-INFO +1 -1
  9. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/LICENSE +0 -0
  10. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/README.md +0 -0
  11. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/setup.cfg +0 -0
  12. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/__init__.py +0 -0
  13. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/agents/__init__.py +0 -0
  14. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/agents/base.py +0 -0
  15. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/agents/commit_message.py +0 -0
  16. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/agents/pr_generator.py +0 -0
  17. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/agents/pre_commit_fixer.py +0 -0
  18. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/agents/ticket_solver.py +0 -0
  19. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/branch_creator.py +0 -0
  20. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/clients/__init__.py +0 -0
  21. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/clients/jira_client.py +0 -0
  22. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/console_utils.py +0 -0
  23. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/logging_setup.py +0 -0
  24. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/main.py +0 -0
  25. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/pr_content.py +0 -0
  26. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/settings.py +0 -0
  27. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/settings_init.py +0 -0
  28. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/shell/__init__.py +0 -0
  29. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/shell/base.py +0 -0
  30. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/shell/pre_commit_runner.py +0 -0
  31. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/validators.py +0 -0
  32. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/src/workflow.py +0 -0
  33. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/tests/__init__.py +0 -0
  34. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/tests/integration/__init__.py +0 -0
  35. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/tests/integration/test_find_first_toml.py +0 -0
  36. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/tests/unit/__init__.py +0 -0
  37. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/tests/unit/test_nothing.py +0 -0
  38. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/ticket2pr.egg-info/SOURCES.txt +0 -0
  39. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/ticket2pr.egg-info/dependency_links.txt +0 -0
  40. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/ticket2pr.egg-info/entry_points.txt +0 -0
  41. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/ticket2pr.egg-info/not-zip-safe +0 -0
  42. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/ticket2pr.egg-info/requires.txt +0 -0
  43. {ticket2pr-0.3.2 → ticket2pr-0.3.4}/ticket2pr.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ticket2pr
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Automate Jira ticket to GitHub PR workflow
5
5
  Home-page: https://github.com/bengabay11/ticket2pr
6
6
  Author: Ben Gabay
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ticket2pr"
3
- version = "0.3.2"
3
+ version = "0.3.4"
4
4
  description = "Automate Jira ticket to GitHub PR workflow"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
@@ -5,7 +5,7 @@ with open("README.md", encoding="utf-8") as f:
5
5
 
6
6
  setup(
7
7
  name="ticket2pr",
8
- version="0.3.2",
8
+ version="0.3.4",
9
9
  author="Ben Gabay",
10
10
  author_email="ben.gabay38@gmail.com",
11
11
  description="Automate Jira ticket to GitHub PR workflow",
@@ -26,6 +26,7 @@ from src.console_utils import (
26
26
  print_warning,
27
27
  )
28
28
  from src.enhanced_git import EnhancedGit
29
+ from src.exceptions import GitCloneError
29
30
  from src.logging_setup import LoggerHandlerType, SetupLoggerParams, setup_logger
30
31
  from src.settings import AppSettings
31
32
 
@@ -98,11 +99,20 @@ def _setup_workspace(
98
99
  temp_dir: Path | None = None
99
100
  try:
100
101
  if workspace_path is None:
101
- temp_dir = Path(tempfile.mkdtemp(prefix="ticket2pr_"))
102
+ shared_temp_dir = Path(tempfile.gettempdir()) / "ticket2pr"
103
+ shared_temp_dir.mkdir(exist_ok=True)
104
+ temp_dir = Path(tempfile.mkdtemp(dir=shared_temp_dir))
102
105
  logger.info(
103
106
  "No workspace path provided, cloning repository to temp directory: %s", temp_dir
104
107
  )
105
- local_git = EnhancedGit.clone_repo(github_client.clone_url, temp_dir)
108
+ try:
109
+ logger.info("Attempting to clone via SSH: %s", github_client.ssh_url)
110
+ local_git = EnhancedGit.clone_repo(github_client.ssh_url, temp_dir)
111
+ except GitCloneError:
112
+ logger.warning(
113
+ "SSH clone failed, falling back to HTTPS: %s", github_client.clone_url
114
+ )
115
+ local_git = EnhancedGit.clone_repo(github_client.clone_url, temp_dir)
106
116
  logger.info("Repository cloned successfully")
107
117
  yield local_git, temp_dir
108
118
  else:
@@ -110,7 +120,10 @@ def _setup_workspace(
110
120
  finally:
111
121
  if temp_dir and temp_dir.exists():
112
122
  logger.info("Cleaning up temp directory: %s", temp_dir)
113
- shutil.rmtree(temp_dir)
123
+ try:
124
+ shutil.rmtree(temp_dir)
125
+ except Exception as e:
126
+ logger.warning("Failed to clean up temp directory '%s': %s", temp_dir, e)
114
127
 
115
128
 
116
129
  async def workflow_with_prints(
@@ -47,6 +47,10 @@ class GitHubClient:
47
47
  def clone_url(self) -> str:
48
48
  return self.repo.clone_url # type: ignore[no-any-return]
49
49
 
50
+ @property
51
+ def ssh_url(self) -> str:
52
+ return self.repo.ssh_url # type: ignore[no-any-return]
53
+
50
54
  def get_base_branch_ref(self, base_branch: str) -> GitRef:
51
55
  try:
52
56
  return self.repo.get_git_ref(f"heads/{base_branch}")
@@ -5,7 +5,7 @@ import git
5
5
 
6
6
  from src.exceptions import (
7
7
  GitCloneError,
8
- GitFetchCheckoutError,
8
+ GitFetchCheckoutUnknownError,
9
9
  GitPushError,
10
10
  GitWorkspacePathNotExistsError,
11
11
  LocalBranchAlreadyExistsError,
@@ -76,19 +76,15 @@ class EnhancedGit:
76
76
  LocalBranchAlreadyExistsError: If the branch already exists locally
77
77
  GitFetchCheckoutError: If a git error occurs
78
78
  """
79
- try:
80
- origin = self.repo.remotes.origin
81
- origin.fetch()
82
- except Exception as e:
83
- raise GitFetchCheckoutError from e
84
-
85
79
  if branch_name in self.repo.heads:
86
80
  raise LocalBranchAlreadyExistsError(branch_name)
87
81
 
88
82
  try:
83
+ origin = self.repo.remotes.origin
84
+ origin.fetch()
89
85
  self.repo.git.checkout(branch_name)
90
86
  except Exception as e:
91
- raise GitFetchCheckoutError from e
87
+ raise GitFetchCheckoutUnknownError(str(e)) from e
92
88
 
93
89
  def add_all_changes(self) -> None:
94
90
  """
@@ -15,8 +15,12 @@ class GitWorkspacePathNotExistsError(EnhancedGitError):
15
15
 
16
16
 
17
17
  class GitFetchCheckoutError(EnhancedGitError):
18
- def __init__(self) -> None:
19
- super().__init__("Failed to fetch and checkout branch")
18
+ pass
19
+
20
+
21
+ class GitFetchCheckoutUnknownError(GitFetchCheckoutError):
22
+ def __init__(self, error_msg: str) -> None:
23
+ super().__init__(f"Failed to fetch and checkout branch: {error_msg}")
20
24
 
21
25
 
22
26
  class LocalBranchAlreadyExistsError(GitFetchCheckoutError):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ticket2pr
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Automate Jira ticket to GitHub PR workflow
5
5
  Home-page: https://github.com/bengabay11/ticket2pr
6
6
  Author: Ben Gabay
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes