suite-py 1.41.8__py3-none-any.whl → 1.41.10__py3-none-any.whl

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.
suite_py/__version__.py CHANGED
@@ -1,2 +1,2 @@
1
1
  # -*- encoding: utf-8 -*-
2
- __version__ = "1.41.8"
2
+ __version__ = "1.41.10"
suite_py/cli.py CHANGED
@@ -4,13 +4,39 @@
4
4
  # for performance reasons, so turn off the lint warning
5
5
  # pylint: disable=import-outside-toplevel
6
6
 
7
- import os
7
+ # We need to inject truststore code before we do any libraries
8
+ # that might end up creating an ssl.SSlContext object
9
+ # pylint: disable=wrong-import-position
10
+
8
11
  import sys
12
+
13
+
14
+ def maybe_inject_truststore() -> None:
15
+ """
16
+ Injects the truststore package into the system ssl store, to fix verficiation certificate issues when using warp.
17
+ """
18
+ if sys.version_info >= (3, 10):
19
+ import truststore
20
+
21
+ truststore.inject_into_ssl()
22
+ else:
23
+ # pylint: disable-next=reimported
24
+ from suite_py.lib import logger
25
+
26
+ logger.warning(
27
+ "Your python version is older than 3.10 and doesn't support the truststore package. You might experience issues with certificate verification when connected to the warp VPN.\nPlease update to python 3.10 or newer"
28
+ )
29
+
30
+
31
+ # Needs to be done before any other imports
32
+ maybe_inject_truststore()
33
+
34
+ import os
9
35
  from functools import wraps
36
+ from importlib.metadata import PackageNotFoundError, version
10
37
  from typing import Optional
11
38
 
12
39
  import click
13
- import pkg_resources
14
40
  import requests
15
41
  from autoupgrade import Package
16
42
  from click.exceptions import ClickException
@@ -25,33 +51,21 @@ from suite_py.lib.handler.captainhook_handler import CaptainHook
25
51
  from suite_py.lib.handler.okta_handler import Okta
26
52
  from suite_py.lib.tokens import Tokens
27
53
 
54
+ # pylint: enable=wrong-import-position
55
+
28
56
  ALLOW_NO_GIT_SUBCOMMAND = ["login", "aggregator"]
29
57
  ALLOW_NO_HOME_SUBCOMMAND = ["login", "aggregator"]
30
58
 
31
59
 
32
- def maybe_inject_truststore() -> None:
33
- """
34
- Injects the truststore package into the system ssl store, to fix verficiation certificate issues when using warp.
60
+ def fetch_latest_version() -> Optional[str]:
35
61
  """
36
- if sys.version_info >= (3, 10):
37
- import truststore
38
-
39
- truststore.inject_into_ssl()
40
- else:
41
- logger.warning(
42
- "Your python version is older than 3.10 and doesn't support the truststore package. You might experience issues with certificate verification when connected to the warp VPN.\nPlease update to python 3.10 or newer"
43
- )
44
-
45
-
46
- def fetch_latest_version() -> Optional[pkg_resources.packaging.version.Version]:
47
- """
48
- Fetches the latest version of suite-py as a pkg_resources parsed version
62
+ Fetches the latest version of suite-py as a str
49
63
  Returns None on error
50
64
  """
51
65
  try:
52
66
  # pylint: disable-next=missing-timeout
53
67
  pkg_info = requests.get("https://pypi.org/pypi/suite-py/json").json()
54
- return pkg_resources.parse_version(pkg_info["info"]["version"])
68
+ return pkg_info["info"]["version"]
55
69
  except Exception:
56
70
  logger.warning("Failed to fetch latest version of suite-py!")
57
71
  return None
@@ -65,8 +79,8 @@ def upgrade_suite_py_if_needed(break_on_missing_package: bool = False) -> None:
65
79
  """
66
80
 
67
81
  try:
68
- pkg_resources.get_distribution("suite_py")
69
- except pkg_resources.DistributionNotFound as error:
82
+ installed_version = version("suite_py")
83
+ except PackageNotFoundError as error:
70
84
  # We are in a virtual environment where suite-py is not installed, don't bother trying to upgrade
71
85
  if break_on_missing_package:
72
86
  raise error
@@ -76,12 +90,10 @@ def upgrade_suite_py_if_needed(break_on_missing_package: bool = False) -> None:
76
90
  )
77
91
  return
78
92
 
79
- current_version = pkg_resources.parse_version(__version__)
80
-
81
93
  try:
82
94
  # If available, upgrade (if needed)
83
95
  latest_version = fetch_latest_version()
84
- if latest_version is None or latest_version > current_version:
96
+ if latest_version is None or latest_version > installed_version:
85
97
  # If we fail to fetch the latest version, fallback to attempting the upgrade anyway
86
98
  Package("suite_py").upgrade()
87
99
  except Exception as error:
@@ -245,8 +257,8 @@ def cli_unlock_project(obj, environment):
245
257
  @click.pass_obj
246
258
  @catch_exceptions
247
259
  def cli_open_pr(obj):
248
- from suite_py.commands.open_pr import OpenPR
249
260
  from suite_py.commands.ask_review import AskReview
261
+ from suite_py.commands.open_pr import OpenPR
250
262
 
251
263
  ask_review = obj.call(AskReview)
252
264
  obj.call(OpenPR, ask_review=ask_review).run()
@@ -48,6 +48,8 @@ class BatchJob:
48
48
  self._start_job(country, command)
49
49
 
50
50
  def _start_job(self, country, command):
51
+ promotion = {}
52
+
51
53
  if self._environment == "staging":
52
54
  build = self._get_latest_master_build()
53
55
 
@@ -78,7 +78,6 @@ class Secret:
78
78
 
79
79
  if prompt_utils.ask_confirm(f"Do you want to grant permissions for {secret}?"):
80
80
  self._set_grant_on_secret(secret)
81
- return
82
81
 
83
82
  def _set_grant_on_secret(self, secret_name):
84
83
  environment = self._ask_environment()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: suite-py
3
- Version: 1.41.8
3
+ Version: 1.41.10
4
4
  Summary:
5
5
  Author: larrywax, EugenioLaghi, michelangelomo
6
6
  Author-email: devops@prima.it
@@ -21,7 +21,7 @@ Requires-Dist: black (>=22.6,<25.0)
21
21
  Requires-Dist: boto3 (>=1.17.84)
22
22
  Requires-Dist: cement (>=3.0)
23
23
  Requires-Dist: colorama (>=0.4.3)
24
- Requires-Dist: cryptography (==42.0.5)
24
+ Requires-Dist: cryptography (==42.0.7)
25
25
  Requires-Dist: halo (>=0.0.28)
26
26
  Requires-Dist: inquirer (==3.1.4)
27
27
  Requires-Dist: itsdangerous (==2.2.0)
@@ -1,10 +1,10 @@
1
1
  suite_py/__init__.py,sha256=REmi3D0X2G1ZWnYpKs8Ffm3NIj-Hw6dMuvz2b9NW344,142
2
- suite_py/__version__.py,sha256=C72BQjNOg72voqmXyLIqBdkVITPqxMJeS157soE2SM8,49
3
- suite_py/cli.py,sha256=EaXTn4YONpw0Q5yuUeo9ANsLClHa0A-S87wHYnLwGOs,14934
2
+ suite_py/__version__.py,sha256=i6HmzASsryZBCC4p1Cf_qbUBilep7P848kIqMZUnTNs,50
3
+ suite_py/cli.py,sha256=oGKcY9TUvGgXJl1tYBlkvSCcz6A6Aa7Fye5yEPqB4F8,15159
4
4
  suite_py/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  suite_py/commands/aggregator.py,sha256=_xyyX7MOMZzDEvzj2AI03OF3sut5PpSIyuRjUiCp5aI,5747
6
6
  suite_py/commands/ask_review.py,sha256=yN__Ac-fiZBPShjRDhyCCQZGfVlQE16KozoJk4UtiNw,3788
7
- suite_py/commands/batch_job.py,sha256=pcSpDov9uNY4z9MjQ8KDapEC9zhEJDe7XcJV7uidHyE,7450
7
+ suite_py/commands/batch_job.py,sha256=flTSxmNaUv1VcL91Lv-BwEjFpEyF8APTNysQE_2jPYE,7474
8
8
  suite_py/commands/bump.py,sha256=oFZU1hPfD11ujFC5G7wFyQOf2alY3xp2SO1h1ldjf3s,5406
9
9
  suite_py/commands/check.py,sha256=0e2NsPi3cqvCwtNYzhR1UroT59bCojLlGo69vv3FiOA,4074
10
10
  suite_py/commands/common.py,sha256=aWCEvO3hqdheuMUmZcHuc9EGZPQTk7VkzkHJk283MxQ,566
@@ -20,7 +20,7 @@ suite_py/commands/merge_pr.py,sha256=gUpoDx3q23X6gF9PLXCZnIL9DfRw_3D0LlqBlGVt7rA
20
20
  suite_py/commands/open_pr.py,sha256=U7MVl-JFKu1mdfxC_UvxUHtPLEln0g4kKl-SvP-6zd8,7159
21
21
  suite_py/commands/project_lock.py,sha256=b7OkGysue_Sl13VIT7B5CTBppCvrB_Q6iC0IJRBSHp8,1909
22
22
  suite_py/commands/release.py,sha256=clKgmsNgR9DdgBkYjXI3NqVaw8_mCe2TZHegby3ESn4,16634
23
- suite_py/commands/secret.py,sha256=IOPQBTXsi8qFd84yxGe38U9b1x53dHguoLolCTOtRoU,7995
23
+ suite_py/commands/secret.py,sha256=Us7wvsqAPJhe1nUSHOmzO1RSyZriKAGKwi2YEhPNIA4,7976
24
24
  suite_py/commands/set_token.py,sha256=fehIqKjKhE-BJGFhgkPTo3Ntr0MvpgLd6EC5yjKuRs8,1508
25
25
  suite_py/commands/status.py,sha256=0JUK53_d1-U3WNS742JD2QTiGmCGZONo3jJx8WR7q70,1122
26
26
  suite_py/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -48,7 +48,7 @@ suite_py/lib/requests/session.py,sha256=P32H3cWnCWunu91WIj2iDM5U3HzaBglg60VN_C9J
48
48
  suite_py/lib/symbol.py,sha256=z3QYBuNIwD3qQ3zF-cLOomIr_-C3bO_u5UIDAHMiyTo,60
49
49
  suite_py/lib/tokens.py,sha256=kK4vatd5iKEFaue0BZwK1f66YOh9zLdLzP41ZOhjMCU,5534
50
50
  suite_py/templates/login.html,sha256=fJLls2SB84oZTSrxTdA5q1PqfvIHcCD4fhVWfyco7Ig,861
51
- suite_py-1.41.8.dist-info/METADATA,sha256=YpG9ptQzXGsGoS0KjGyMKsoNlNV4eLRQRUu57UJZ0cQ,1532
52
- suite_py-1.41.8.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
53
- suite_py-1.41.8.dist-info/entry_points.txt,sha256=dVKLC-9Infy-dHJT_MkK6LcDjOgBCJ8lfPkURJhBjxE,46
54
- suite_py-1.41.8.dist-info/RECORD,,
51
+ suite_py-1.41.10.dist-info/METADATA,sha256=A_GGYDs7Uq5qzCIiUW-PKqxk0QdgS4su2FMwpKWc4A4,1533
52
+ suite_py-1.41.10.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
53
+ suite_py-1.41.10.dist-info/entry_points.txt,sha256=dVKLC-9Infy-dHJT_MkK6LcDjOgBCJ8lfPkURJhBjxE,46
54
+ suite_py-1.41.10.dist-info/RECORD,,