pyntcli 0.1.100__py3-none-any.whl → 0.1.102__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.
pyntcli/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.1.100"
1
+ __version__ = "0.1.102"
2
2
 
3
3
  try:
4
4
  from logzio import sender
@@ -98,7 +98,7 @@ class PostmanSubCommand(sub_command.PyntSubCommand):
98
98
  container_config = pynt_container.DockerContainerConfig(
99
99
  args,
100
100
  "postman",
101
- pynt_container.PyntDockerPort(PYNT_CONTAINER_INTERNAL_PORT, args.port, name="--port"))
101
+ pynt_container.PyntDockerPort(src=PYNT_CONTAINER_INTERNAL_PORT, port=args.port, name="--port"))
102
102
 
103
103
  postman_docker = pynt_container.PyntContainerNative(container_config)
104
104
  postman_docker.prepare_client()
@@ -1,6 +1,5 @@
1
1
  import platform
2
2
  import subprocess
3
- from docker.types import Mount
4
3
  import os
5
4
  import json
6
5
  import argparse
@@ -21,7 +20,13 @@ PYNT_CONTAINER_INTERNAL_PORT = "5001"
21
20
 
22
21
 
23
22
  def create_mount(src, destination, mount_type="bind"):
24
- return Mount(target=destination, source=src, type=mount_type)
23
+ return {
24
+ 'Target': destination,
25
+ 'Source': src,
26
+ 'Type': mount_type,
27
+ 'ReadOnly': False,
28
+ 'NoCopy': False,
29
+ }
25
30
 
26
31
 
27
32
  class DockerNotAvailableException(Exception):
@@ -92,7 +97,8 @@ class DockerContainerConfig:
92
97
  self.docker_arguments.append(p.name)
93
98
  self.docker_arguments.append(str(p.dest))
94
99
  else:
95
- ports[str(p.src)] = int(p.dest)
100
+ # `dest` is the host port, `src` is in the container
101
+ ports[str(p.dest)] = int(p.src)
96
102
 
97
103
  if create_network_host:
98
104
  self.docker_type = PyntNativeHost(network="host")
@@ -188,7 +194,7 @@ def get_docker_mounts(args: argparse.Namespace) -> list:
188
194
  class PyntContainerNative:
189
195
  def __init__(self, container_config: DockerContainerConfig):
190
196
  self.config = container_config
191
- self.container_name = ""
197
+ self.container_name = "pynt_engine"
192
198
  self.system = platform.system().lower()
193
199
  self.stdout = None
194
200
  self.running = False
@@ -216,7 +222,7 @@ class PyntContainerNative:
216
222
 
217
223
  self.fetch_and_validate_image()
218
224
  args = self.config.docker_arguments if self.config.docker_arguments else None
219
- docker_command = ["docker", "run", "-d"]
225
+ docker_command = ["docker", "run", "--rm", "-d", "--name", self.container_name]
220
226
 
221
227
  mounts = []
222
228
  for mount in self.config.mounts:
@@ -228,11 +234,10 @@ class PyntContainerNative:
228
234
 
229
235
  docker_type_options = []
230
236
  for key, value in self.config.docker_type.get_arguments().items():
231
- if key == "ports":
232
- if isinstance(value, dict):
233
- for s, d in value.items():
234
- # --publish source:destination for each port
235
- docker_type_options.extend([f"-p", f"{s}:{d}"])
237
+ if key == "ports" and isinstance(value, dict):
238
+ for host_port, container_port in value.items():
239
+ # --publish HOST_PORT:CONTAINER_PORT for each port
240
+ docker_type_options.extend(["-p", f"{host_port}:{container_port}"])
236
241
  else:
237
242
  docker_type_options.extend([f"--{key}={value}"])
238
243
 
@@ -270,7 +275,7 @@ class PyntContainerNative:
270
275
  ui_thread.print_verbose("Killing other pynt containers if such exist")
271
276
  try:
272
277
  for _ in IMAGE_TAGS:
273
- command = ["docker", "ps", "-q", "-f", f"ancestor={self.config.image.name}"]
278
+ command = ["docker", "ps", "-q", "-f", f"name={self.container_name}"]
274
279
  containers_output = subprocess.check_output(command, text=True)
275
280
  if not containers_output:
276
281
  continue
@@ -293,7 +298,7 @@ class PyntContainerNative:
293
298
  pull_command = ['docker', 'pull', self.config.image.name]
294
299
  get_image_command = ['docker', 'images', '-q', f'{self.config.image.name}']
295
300
  pull_process = subprocess.Popen(pull_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
296
- pull_stdout, pull_stderr = pull_process.communicate()
301
+ _, pull_stderr = pull_process.communicate()
297
302
  get_process = subprocess.Popen(get_image_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
298
303
  get_stdout, _ = get_process.communicate()
299
304
  local_image_id = get_stdout.decode('utf-8')
@@ -1,11 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyntcli
3
- Version: 0.1.100
3
+ Version: 0.1.102
4
4
  Summary: Command line utility to handle all of Pynt's different integrations
5
5
  Author-email: Pynt-io <support@pynt.io>
6
6
  Project-URL: Homepage, https://pynt.io
7
7
  Requires-Python: >=3.7
8
- Requires-Dist: docker
9
8
  Requires-Dist: rich
10
9
  Requires-Dist: requests==2.31.0
11
10
  Requires-Dist: pem
@@ -1,7 +1,7 @@
1
1
  ignoreTests/conftest.py,sha256=gToq5K74GtgeGQXjFvXSzMaE6axBYxAzcFG5XJPOXjI,427
2
2
  ignoreTests/auth/login.py,sha256=KFlzWhXBAuwdi7GXf16gCB3ya94LQG2wjcSChE149rQ,3798
3
3
  ignoreTests/store/cred_store.py,sha256=_7-917EtNC9eKEumO2_lt-7KuDmCwOZFaowCm7DbA_A,254
4
- pyntcli/__init__.py,sha256=-ZeumLDPTHS2r0t8ZT98JHgmzaxmfZaDpjbaLrfkeuw,403
4
+ pyntcli/__init__.py,sha256=FOqUO2NVzyu71qVPUvSdcSq0R9nb3HWrEn0eMrsEMO8,403
5
5
  pyntcli/main.py,sha256=WEbWyqzDjtnZGSWgqru1FCT7wmHdi11uzd1LmwTTCI4,6095
6
6
  pyntcli/analytics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  pyntcli/analytics/send.py,sha256=9TRAEoPbv4rWOZfcNaGanrRJAFvNs39P-uKSl49GcQE,3679
@@ -14,7 +14,7 @@ pyntcli/commands/har.py,sha256=NzxyXlgS5YtQJqi9528V0FkbonMaZ0wHuvRl0LmR5JA,4329
14
14
  pyntcli/commands/id_command.py,sha256=UBEgMIpm4vauTCsKyixltiGUolNg_OfHEJvJ_i5BpJY,943
15
15
  pyntcli/commands/listen.py,sha256=oxgMvJYpPEu6h8qRFoueGF3a_nmwzaWMPL8ucfy7yxE,8983
16
16
  pyntcli/commands/newman.py,sha256=PRbsbDTxL54FRVYOYEpKJ5icVdGXtG2bfiGsnJgmKT4,5173
17
- pyntcli/commands/postman.py,sha256=HPFNcmAtVziLCAimUg8GUXBMUGBGAXBrSPvP6Tuiubk,4971
17
+ pyntcli/commands/postman.py,sha256=aStkkyx3FTXvnIcQxNf1_OPKDE1RL25OALc2eyAZJCY,4980
18
18
  pyntcli/commands/pynt_cmd.py,sha256=T7jee0yw67Zth3lTkSDInCLnbu_IhpNqb7GqnTiTceQ,7012
19
19
  pyntcli/commands/root.py,sha256=6dSzKSjUX-ZetE2KYJNkBmfDDrcYJligmHBqIAIc2aQ,4140
20
20
  pyntcli/commands/static_file_extensions.py,sha256=PZJb02BI-64tbU-j3rdCNsXzTh7gkIDGxGKbKNw3h5k,1995
@@ -24,7 +24,7 @@ pyntcli/log/__init__.py,sha256=cOGwOYzMoshEbZiiasBGkj6wF0SBu3Jdpl-AuakDesw,19
24
24
  pyntcli/log/log.py,sha256=cWCdWmUaAwePwdhYDcgNMEG9d9RM34sGahxBCYEdv2Y,1069
25
25
  pyntcli/pynt_docker/__init__.py,sha256=PQIOVxc7XXtMLfEX7ojgwf_Z3mmTllO3ZvzUZTPOxQY,30
26
26
  pyntcli/pynt_docker/container_utils.py,sha256=_Onn7loInzyJAG2-Uk6CGpsuRyelmUFHOvtJj4Uzi9A,175
27
- pyntcli/pynt_docker/pynt_container.py,sha256=NxizyjSgXSyPbKFs5ggyBSOcLVlb0xk9MS96L2XLrZ4,13126
27
+ pyntcli/pynt_docker/pynt_container.py,sha256=Yl_YESabRmWb38roDDUa_r3NKeAiwa0h9TPY7zTIsfY,13303
28
28
  pyntcli/store/__init__.py,sha256=1fP8cEAQCF_myja3gnhHH9FEqtBiOJ-2aBmUXSKBdFA,41
29
29
  pyntcli/store/json_connector.py,sha256=UGs3uORw3iyn0YJ8kzab-veEZToA6d-ByXYuqEleWsA,560
30
30
  pyntcli/store/store.py,sha256=ZLSe0WAjHDp8cSt4BBFDkPGRux4cgOo5UfF7V4naM7U,2559
@@ -39,8 +39,8 @@ pyntcli/ui/report.py,sha256=W-icPSZrGLOubXgam0LpOvHLl_aZg9Zx9qIkL8Ym5PE,1930
39
39
  pyntcli/ui/ui_thread.py,sha256=XUBgLpYQjVhrilU-ofw7VSXgTiwneSdTxm61EvC3x4Q,5091
40
40
  tests/test_utils.py,sha256=t5fTQUk1U_Js6iMxcGYGqt4C-crzOJ0CqCKtLkRtUi0,2050
41
41
  tests/commands/test_pynt_cmd.py,sha256=BjGFCFACcSziLrNA6_27t6TjSmvdu54wx9njwLpRSJY,8379
42
- pyntcli-0.1.100.dist-info/METADATA,sha256=ofzCKRvESAbl7zbATZPp-PCqCJT-EP_3xPNRPj_3i0E,494
43
- pyntcli-0.1.100.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
44
- pyntcli-0.1.100.dist-info/entry_points.txt,sha256=kcGmqAxXDttNk2EPRcqunc_LTVp61gzakz0v-GEE2SY,43
45
- pyntcli-0.1.100.dist-info/top_level.txt,sha256=64XSgBzSpgwjYjEKHZE7q3JH2a816zEeyZBXfJi3AKI,42
46
- pyntcli-0.1.100.dist-info/RECORD,,
42
+ pyntcli-0.1.102.dist-info/METADATA,sha256=hC0ph5yb-J8gVgy9CKsVxj6s5UR80btfQdehYhTT_e0,472
43
+ pyntcli-0.1.102.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
44
+ pyntcli-0.1.102.dist-info/entry_points.txt,sha256=kcGmqAxXDttNk2EPRcqunc_LTVp61gzakz0v-GEE2SY,43
45
+ pyntcli-0.1.102.dist-info/top_level.txt,sha256=64XSgBzSpgwjYjEKHZE7q3JH2a816zEeyZBXfJi3AKI,42
46
+ pyntcli-0.1.102.dist-info/RECORD,,