suite-py 1.43.3__tar.gz → 1.44.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 (45) hide show
  1. {suite_py-1.43.3 → suite_py-1.44.0}/PKG-INFO +2 -2
  2. {suite_py-1.43.3 → suite_py-1.44.0}/pyproject.toml +2 -2
  3. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/__version__.py +1 -1
  4. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/cli.py +7 -2
  5. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/create_branch.py +7 -6
  6. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/git_handler.py +13 -5
  7. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/logger.py +1 -1
  8. {suite_py-1.43.3 → suite_py-1.44.0}/LICENSE-APACHE +0 -0
  9. {suite_py-1.43.3 → suite_py-1.44.0}/LICENSE-MIT +0 -0
  10. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/__init__.py +0 -0
  11. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/__init__.py +0 -0
  12. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/ask_review.py +0 -0
  13. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/bump.py +0 -0
  14. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/check.py +0 -0
  15. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/common.py +0 -0
  16. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/context.py +0 -0
  17. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/login.py +0 -0
  18. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/merge_pr.py +0 -0
  19. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/open_pr.py +0 -0
  20. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/project_lock.py +0 -0
  21. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/release.py +0 -0
  22. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/set_token.py +0 -0
  23. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/commands/status.py +0 -0
  24. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/__init__.py +0 -0
  25. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/config.py +0 -0
  26. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/__init__.py +0 -0
  27. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/aws_handler.py +0 -0
  28. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/captainhook_handler.py +0 -0
  29. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/changelog_handler.py +0 -0
  30. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/frequent_reviewers_handler.py +0 -0
  31. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/github_handler.py +0 -0
  32. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/metrics_handler.py +0 -0
  33. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/okta_handler.py +0 -0
  34. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/pre_commit_handler.py +0 -0
  35. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/prompt_utils.py +0 -0
  36. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/version_handler.py +0 -0
  37. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/handler/youtrack_handler.py +0 -0
  38. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/metrics.py +0 -0
  39. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/oauth.py +0 -0
  40. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/requests/__init__.py +0 -0
  41. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/requests/auth.py +0 -0
  42. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/requests/session.py +0 -0
  43. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/symbol.py +0 -0
  44. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/lib/tokens.py +0 -0
  45. {suite_py-1.43.3 → suite_py-1.44.0}/suite_py/templates/login.html +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: suite-py
3
- Version: 1.43.3
3
+ Version: 1.44.0
4
4
  Summary:
5
5
  Author: larrywax, EugenioLaghi, michelangelomo
6
6
  Author-email: devops@prima.it
@@ -28,7 +28,7 @@ Requires-Dist: pytest (>=7.0.0)
28
28
  Requires-Dist: python-dateutil (>=2.8.2)
29
29
  Requires-Dist: requests (>=2.26.0)
30
30
  Requires-Dist: requests-toolbelt (>=0.9.1)
31
- Requires-Dist: rich (==13.9.4)
31
+ Requires-Dist: rich (==14.0.0)
32
32
  Requires-Dist: semver (>=3.0.4,<4.0.0)
33
33
  Requires-Dist: termcolor (>=1.1.0)
34
34
  Requires-Dist: truststore (>=0.7,<0.11) ; python_version >= "3.10"
@@ -2,7 +2,7 @@
2
2
  authors = ["larrywax, EugenioLaghi, michelangelomo <devops@prima.it>"]
3
3
  description = ""
4
4
  name = "suite-py"
5
- version = "1.43.3"
5
+ version = "1.44.0"
6
6
 
7
7
  [tool.poetry.dependencies]
8
8
  Click = ">=7.0"
@@ -23,7 +23,7 @@ python = ">=3.8,<4.0"
23
23
  python-dateutil = ">=2.8.2"
24
24
  requests = ">=2.26.0"
25
25
  requests-toolbelt = ">=0.9.1"
26
- rich = "==13.9.4"
26
+ rich = "==14.0.0"
27
27
  semver = "^3.0.4"
28
28
  termcolor = ">=1.1.0"
29
29
  truststore = {version = ">=0.7,<0.11", python = ">=3.10"}
@@ -1,2 +1,2 @@
1
1
  # -*- encoding: utf-8 -*-
2
- __version__ = "1.43.3"
2
+ __version__ = "1.44.0"
@@ -228,12 +228,17 @@ def bump(obj: Context, project: Optional[str] = None, version: Optional[str] = N
228
228
  "create-branch", help="Create local branch and set the YouTrack card in progress"
229
229
  )
230
230
  @click.option("--card", type=click.STRING, help="YouTrack card number (ex. PRIMA-123)")
231
+ @click.option(
232
+ "--autostash",
233
+ is_flag=True,
234
+ help="Stash uncommitted changes before creating the branch and reapply them afterward",
235
+ )
231
236
  @click.pass_obj
232
237
  @catch_exceptions
233
- def cli_create_branch(obj, card):
238
+ def cli_create_branch(obj, card, autostash):
234
239
  from suite_py.commands.create_branch import CreateBranch
235
240
 
236
- obj.call(CreateBranch, card=card).run()
241
+ obj.call(CreateBranch, card=card, autostash=autostash).run()
237
242
 
238
243
 
239
244
  @main.command("lock", help="Lock project on staging or prod")
@@ -11,16 +11,17 @@ from suite_py.lib.handler.youtrack_handler import YoutrackHandler
11
11
 
12
12
 
13
13
  class CreateBranch:
14
- def __init__(self, project, card, config, tokens):
14
+ def __init__(self, project, card, config, tokens, autostash=False):
15
15
  self._project = project
16
16
  self._card = card
17
17
  self._config = config
18
18
  self._youtrack = YoutrackHandler(config, tokens)
19
19
  self._git = GitHandler(project, config)
20
+ self._autostash = autostash
20
21
 
21
22
  @metrics.command("create-branch")
22
23
  def run(self):
23
- if not self._git.is_detached() and self._git.is_dirty():
24
+ if not self._git.is_detached() and self._git.is_dirty() and not self._autostash:
24
25
  # Default behaviour is to pull when not detached.
25
26
  # Can't do that with uncommitted changes.
26
27
  logger.error("You have some uncommitted changes, I can't continue")
@@ -37,7 +38,7 @@ class CreateBranch:
37
38
  )
38
39
  sys.exit(-1)
39
40
 
40
- self._checkout_branch(issue)
41
+ self._checkout_branch(issue, self._autostash)
41
42
 
42
43
  user = self._youtrack.get_current_user()
43
44
  self._youtrack.assign_to(issue["id"], user["login"])
@@ -94,7 +95,7 @@ class CreateBranch:
94
95
  )
95
96
  return []
96
97
 
97
- def _checkout_branch(self, issue):
98
+ def _checkout_branch(self, issue, autostash=False):
98
99
  default_parent_branch_name = self._config.user.get(
99
100
  "default_parent_branch", self._git.current_branch_name()
100
101
  )
@@ -118,9 +119,9 @@ class CreateBranch:
118
119
 
119
120
  logger.error(f"Invalid branch name: {full_branch_name}. Try again?")
120
121
 
121
- self._git.checkout(parent_branch_name)
122
+ self._git.checkout(parent_branch_name, autostash=autostash)
122
123
 
123
- self._git.checkout(full_branch_name, new=True)
124
+ self._git.checkout(full_branch_name, new=True, autostash=autostash)
124
125
 
125
126
 
126
127
  # Normalize a string into a valid segment(ie. the part of the branch name between the /)
@@ -32,7 +32,7 @@ class GitHandler:
32
32
  check=True,
33
33
  )
34
34
 
35
- def checkout(self, branch, new=False):
35
+ def checkout(self, branch, new=False, autostash=False):
36
36
  try:
37
37
  if new:
38
38
  subprocess.run(
@@ -51,7 +51,7 @@ class GitHandler:
51
51
  stderr=subprocess.DEVNULL,
52
52
  )
53
53
  if not self.is_detached(): # Skip pulling if detached
54
- self.pull(rebase=True)
54
+ self.pull(rebase=True, autostash=autostash)
55
55
  except CalledProcessError as e:
56
56
  logger.error(f"Error during command execution: {e}")
57
57
  sys.exit(-1)
@@ -99,12 +99,16 @@ class GitHandler:
99
99
  logger.error(f"Error during command execution: {e}")
100
100
  sys.exit(-1)
101
101
 
102
- def pull(self, rebase=False):
102
+ def pull(self, rebase=False, autostash=False):
103
103
  with Halo(text=f"Pulling {self._repo}...", spinner="dots", color="magenta"):
104
104
  try:
105
105
  if rebase:
106
106
  subprocess.run(
107
- ["git", "pull", "--rebase"],
107
+ (
108
+ ["git", "pull", "--rebase", "--autostash"]
109
+ if autostash
110
+ else ["git", "pull", "--rebase"]
111
+ ),
108
112
  cwd=self._path,
109
113
  check=True,
110
114
  stdout=subprocess.DEVNULL,
@@ -112,7 +116,11 @@ class GitHandler:
112
116
  )
113
117
  else:
114
118
  subprocess.run(
115
- ["git", "pull"],
119
+ (
120
+ ["git", "pull", "--autostash"]
121
+ if autostash
122
+ else ["git", "pull"]
123
+ ),
116
124
  cwd=self._path,
117
125
  check=True,
118
126
  stdout=subprocess.DEVNULL,
@@ -17,7 +17,7 @@ def setup(verbose):
17
17
  level=level,
18
18
  format=LOG_FORMAT,
19
19
  datefmt="[%X]",
20
- handlers=[RichHandler(rich_tracebacks=True, markup=False)],
20
+ handlers=[RichHandler(rich_tracebacks=True, markup=False, show_path=False)],
21
21
  )
22
22
 
23
23
  logger = logging.getLogger(LOGGER_NAME)
File without changes
File without changes