jararaca 0.3.11a0__py3-none-any.whl → 0.3.11a1__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.

Potentially problematic release.


This version of jararaca might be problematic. Click here for more details.

jararaca/cli.py CHANGED
@@ -11,7 +11,7 @@ from urllib.parse import urlparse, urlunsplit
11
11
 
12
12
  import click
13
13
  import uvicorn
14
- from mako.template import Template # type: ignore
14
+ from mako.template import Template
15
15
 
16
16
  from jararaca.messagebus import worker as worker_v1
17
17
  from jararaca.messagebus import worker_v2 as worker_v2_mod
@@ -303,7 +303,7 @@ def generate_interfaces(
303
303
  file.write(content)
304
304
  file.flush()
305
305
 
306
- print(
306
+ click.echo(
307
307
  f"Generated TypeScript interfaces at {time.strftime('%H:%M:%S')} at {str(Path(file_path).absolute())}"
308
308
  )
309
309
 
@@ -311,19 +311,19 @@ def generate_interfaces(
311
311
  import subprocess
312
312
 
313
313
  try:
314
- print(f"Running post-process command: {post_process_cmd}")
314
+ click.echo(f"Running post-process command: {post_process_cmd}")
315
315
  subprocess.run(
316
316
  post_process_cmd.replace("{file}", file_path),
317
317
  shell=True,
318
318
  check=True,
319
319
  )
320
- print(f"Post-processing completed successfully")
320
+ click.echo(f"Post-processing completed successfully")
321
321
  except subprocess.CalledProcessError as e:
322
- print(f"Post-processing command failed: {e}", file=sys.stderr)
322
+ click.echo(f"Post-processing command failed: {e}", file=sys.stderr)
323
323
 
324
324
  return content
325
325
  except Exception as e:
326
- print(f"Error generating TypeScript interfaces: {e}", file=sys.stderr)
326
+ click.echo(f"Error generating TypeScript interfaces: {e}", file=sys.stderr)
327
327
  return ""
328
328
 
329
329
 
@@ -367,18 +367,20 @@ def gen_tsi(
367
367
  """Generate TypeScript interfaces from a Python microservice."""
368
368
 
369
369
  if stdout and watch:
370
- print(
370
+ click.echo(
371
371
  "Error: --watch and --stdout options cannot be used together",
372
372
  file=sys.stderr,
373
373
  )
374
374
  return
375
375
 
376
376
  if not file_path and not stdout:
377
- print("Error: either file_path or --stdout must be provided", file=sys.stderr)
377
+ click.echo(
378
+ "Error: either file_path or --stdout must be provided", file=sys.stderr
379
+ )
378
380
  return
379
381
 
380
382
  if post_process and stdout:
381
- print(
383
+ click.echo(
382
384
  "Error: --post-process and --stdout options cannot be used together",
383
385
  file=sys.stderr,
384
386
  )
@@ -388,7 +390,7 @@ def gen_tsi(
388
390
  content = generate_interfaces(app_path, file_path, stdout, post_process)
389
391
 
390
392
  if stdout:
391
- print(content)
393
+ click.echo(content)
392
394
  return
393
395
 
394
396
  # If watch mode is not enabled, exit
@@ -399,7 +401,7 @@ def gen_tsi(
399
401
  from watchdog.events import FileSystemEvent, FileSystemEventHandler
400
402
  from watchdog.observers import Observer
401
403
  except ImportError:
402
- print(
404
+ click.echo(
403
405
  "Watchdog is required for watch mode. Install it with: pip install watchdog",
404
406
  file=sys.stderr,
405
407
  )
@@ -414,7 +416,7 @@ def gen_tsi(
414
416
  else str(event.src_path)
415
417
  )
416
418
  if not event.is_directory and src_path.endswith(".py"):
417
- print(f"File changed: {src_path}")
419
+ click.echo(f"File changed: {src_path}")
418
420
  # Create a completely detached process to ensure classes are reloaded
419
421
  process = multiprocessing.get_context("spawn").Process(
420
422
  target=generate_interfaces,
@@ -445,16 +447,16 @@ def gen_tsi(
445
447
 
446
448
  # Set up observer
447
449
  observer = Observer()
448
- observer.schedule(PyFileChangeHandler(), src_dir, recursive=True)
449
- observer.start()
450
+ observer.schedule(PyFileChangeHandler(), src_dir, recursive=True) # type: ignore
451
+ observer.start() # type: ignore
450
452
 
451
- print(f"Watching for changes in {os.path.abspath(src_dir)}...")
453
+ click.echo(f"Watching for changes in {os.path.abspath(src_dir)}...")
452
454
  try:
453
455
  while True:
454
456
  time.sleep(1)
455
457
  except KeyboardInterrupt:
456
- observer.stop()
457
- print("Watch mode stopped")
458
+ observer.stop() # type: ignore
459
+ click.echo("Watch mode stopped")
458
460
  observer.join()
459
461
 
460
462
 
@@ -76,7 +76,6 @@ class AIOPikaMessagePublisher(MessagePublisher):
76
76
  )
77
77
 
78
78
  async def flush(self) -> None:
79
- print("Flushing messages to AIOPika channel")
80
79
  for message in self.staged_messages:
81
80
  logger.debug(
82
81
  f"Publishing message {message.MESSAGE_TOPIC} with payload: {message.model_dump_json()}"
@@ -135,7 +135,7 @@ class AioPikaMicroserviceConsumer:
135
135
  no_ack=handler.spec.auto_ack,
136
136
  )
137
137
 
138
- print(f"Consuming {queue_name}")
138
+ logger.info(f"Consuming {queue_name}")
139
139
 
140
140
  await self.shutdown_event.wait()
141
141
  logger.info("Worker shutting down")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: jararaca
3
- Version: 0.3.11a0
3
+ Version: 0.3.11a1
4
4
  Summary: A simple and fast API framework for Python
5
5
  Author: Lucas S
6
6
  Author-email: me@luscasleo.dev
@@ -3,7 +3,7 @@ jararaca/__main__.py,sha256=-O3vsB5lHdqNFjUtoELDF81IYFtR-DSiiFMzRaiSsv4,67
3
3
  jararaca/broker_backend/__init__.py,sha256=GzEIuHR1xzgCJD4FE3harNjoaYzxHMHoEL0_clUaC-k,3528
4
4
  jararaca/broker_backend/mapper.py,sha256=vTsi7sWpNvlga1PWPFg0rCJ5joJ0cdzykkIc2Tuvenc,696
5
5
  jararaca/broker_backend/redis_broker_backend.py,sha256=a7DHchy3NAiD71Ix8SwmQOUnniu7uup-Woa4ON_4J7I,5786
6
- jararaca/cli.py,sha256=sbWqviMH0JF65763fBzwUTQWHsuPmTWkup87kqTtZWo,12164
6
+ jararaca/cli.py,sha256=gYdokdAWAPI9e5fQwkQofrcbE_ofJXr1kHc7wFRufnc,12283
7
7
  jararaca/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  jararaca/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  jararaca/core/providers.py,sha256=wktH84FK7c1s2wNq-fudf1uMfi3CQBR0neU2czJ_L0U,434
@@ -16,11 +16,11 @@ jararaca/messagebus/bus_message_controller.py,sha256=Xd_qwnX5jUvgBTCarHR36fvtol9
16
16
  jararaca/messagebus/consumers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  jararaca/messagebus/decorators.py,sha256=y-w4dWbP9ZW3ZJ4mE9iIaxw01ZC5snEbOuBY5NC-Bn0,5626
18
18
  jararaca/messagebus/interceptors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- jararaca/messagebus/interceptors/aiopika_publisher_interceptor.py,sha256=WBHf8DKcuCeH4kBZq9fx_qsryhU7yWplJNLF16LpqMk,6574
19
+ jararaca/messagebus/interceptors/aiopika_publisher_interceptor.py,sha256=_DEHwIH9LYsA26Hu1mo9oHzLZuATgjilU9E3o-ecDjs,6520
20
20
  jararaca/messagebus/interceptors/publisher_interceptor.py,sha256=wkIDoa__Q7o74cv89PXdBJFbe-ijxH8Xc_-hBEgxYjM,1272
21
21
  jararaca/messagebus/message.py,sha256=U6cyd2XknX8mtm0333slz5fanky2PFLWCmokAO56vvU,819
22
22
  jararaca/messagebus/publisher.py,sha256=JTkxdKbvxvDWT8nK8PVEyyX061vYYbKQMxRHXrZtcEY,2173
23
- jararaca/messagebus/worker.py,sha256=2jReCepgMQktdLh4A3OqmOmx6KNgqUGpXIOXoBUtXSg,13778
23
+ jararaca/messagebus/worker.py,sha256=0qkgpbH3FhprRYEEtQttKc353wQ1PpAwu-rn6n9gBm0,13784
24
24
  jararaca/messagebus/worker_v2.py,sha256=Ey9HPgVSuIYJUggJGPKmgymZHz7-2TUSYgDB52u9T10,20683
25
25
  jararaca/microservice.py,sha256=C_Txqm3xSmdHIghJigKk6TOycL5eTJv9PF6XP7TA8j4,6638
26
26
  jararaca/observability/decorators.py,sha256=XffBinFXdiNkY6eo8_1nkr_GapM0RUGBg0aicBIelag,2220
@@ -66,8 +66,8 @@ jararaca/tools/metadata.py,sha256=7nlCDYgItNybentPSSCc2MLqN7IpBd0VyQzfjfQycVI,14
66
66
  jararaca/tools/typescript/interface_parser.py,sha256=35xbOrZDQDyTXdMrVZQ8nnFw79f28lJuLYNHAspIqi8,30492
67
67
  jararaca/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
68
  jararaca/utils/rabbitmq_utils.py,sha256=FPDP8ZVgvitZXV-oK73D7EIANsqUzXTW7HdpEKsIsyI,2811
69
- jararaca-0.3.11a0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
70
- jararaca-0.3.11a0.dist-info/METADATA,sha256=XbMVjGqVYheva2VT-YGJoMx_DalQbkjx7t3PfkFACrI,4954
71
- jararaca-0.3.11a0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
72
- jararaca-0.3.11a0.dist-info/entry_points.txt,sha256=WIh3aIvz8LwUJZIDfs4EeH3VoFyCGEk7cWJurW38q0I,45
73
- jararaca-0.3.11a0.dist-info/RECORD,,
69
+ jararaca-0.3.11a1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
70
+ jararaca-0.3.11a1.dist-info/METADATA,sha256=38ZWg5TI8tUYXHtFdyn5RlmeQ5p6skk4vd8oCj5JCsA,4954
71
+ jararaca-0.3.11a1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
72
+ jararaca-0.3.11a1.dist-info/entry_points.txt,sha256=WIh3aIvz8LwUJZIDfs4EeH3VoFyCGEk7cWJurW38q0I,45
73
+ jararaca-0.3.11a1.dist-info/RECORD,,