python-pq 0.6.0__py3-none-any.whl → 0.6.1__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.
pq/__init__.py CHANGED
@@ -1,13 +1,11 @@
1
1
  """PQ - Postgres-backed task queue."""
2
2
 
3
- import pq.logging # noqa: F401 - configures loguru on import
4
-
5
3
  from pq.client import PQ
6
4
  from pq.models import Periodic, Task, TaskStatus
7
5
  from pq.priority import Priority
8
6
  from pq.worker import PostExecuteHook, PreExecuteHook, TaskTimeoutError
9
7
 
10
- __version__ = "0.6.0"
8
+ __version__ = "0.6.1"
11
9
 
12
10
  __all__ = [
13
11
  "PQ",
pq/logging.py CHANGED
@@ -8,7 +8,10 @@ from loguru import logger
8
8
  def configure_logging() -> None:
9
9
  """Configure loguru with a clean, aligned format.
10
10
 
11
- Called automatically when pq is imported.
11
+ This is an opt-in helper for applications that want pq's default log
12
+ format. Call it explicitly during application startup. pq itself never
13
+ calls this function so it will not interfere with an existing loguru
14
+ configuration.
12
15
  """
13
16
  # Remove default handler
14
17
  logger.remove()
@@ -21,7 +24,3 @@ def configure_logging() -> None:
21
24
  level="DEBUG",
22
25
  colorize=True,
23
26
  )
24
-
25
-
26
- # Auto-configure on import
27
- configure_logging()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-pq
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: Postgres-backed job queue for Python
5
5
  Keywords: postgres,job-queue,task-queue,background-jobs,worker
6
6
  Author: ricwo
@@ -248,6 +248,18 @@ pq.run_worker(pre_execute=setup_tracing, post_execute=flush_tracing)
248
248
 
249
249
  Hooks run in the forked child, making them safe for fork-unsafe resources like OpenTelemetry.
250
250
 
251
+ ## Logging
252
+
253
+ pq uses [loguru](https://github.com/Delgan/loguru) internally and does **not** configure the logger on import. This means it inherits whatever logging setup the host application has already established.
254
+
255
+ If you are running pq as a standalone script and want pq's default log format, call `configure_logging()` explicitly during startup:
256
+
257
+ ```python
258
+ from pq.logging import configure_logging
259
+
260
+ configure_logging()
261
+ ```
262
+
251
263
  ## Serialization
252
264
 
253
265
  Arguments are serialized automatically:
@@ -1,7 +1,7 @@
1
- pq/__init__.py,sha256=A2IkhxWaIDyNK9Xp-O_XRsHbp09HgqEOrRS4uOGfk10,461
1
+ pq/__init__.py,sha256=_GR0RrEMGuna9znKtdTqqM-o7RSQjH4LycHB7XRvhnE,398
2
2
  pq/client.py,sha256=f9x_ESSq_d0OTye29reo6Ve0fOMXMROhjzTGt5KIGf8,18787
3
3
  pq/config.py,sha256=U7dW-LVHy4feLUDQAmxKSF8bavtwxMY4thYCNMR7nDc,293
4
- pq/logging.py,sha256=nEEMHQkL5s84wxylhsb1-4DqmAUQGALUtKG5elSFcwA,644
4
+ pq/logging.py,sha256=41kft5saLMLzzhHSstx27MSAHdFcd02_jxNGm8c-aoI,789
5
5
  pq/migrations/README,sha256=heMzebYwlGhnE8_4CWJ4LS74WoEZjBy-S-mIJRxAEKI,39
6
6
  pq/migrations/__init__.py,sha256=5mlrJT0WUXnqksLOTt4wIZuOzKXshvME5n0Gu-RA7Vo,49
7
7
  pq/migrations/env.py,sha256=OTPTxGCN66FJXl27jdyo7BNhEK3CL28XHgWWgTG5DeQ,2364
@@ -17,8 +17,8 @@ pq/priority.py,sha256=edqpQeGiJrxcmpJ5MZCvwTD9F6sIZbRoI1mx_LmUxAs,264
17
17
  pq/registry.py,sha256=1RFfB-dXXM2qKwLF6XeYeUm9buca1_fQvKQDnpfsXKs,2306
18
18
  pq/serialization.py,sha256=ZspG9qO4YYi-xCrtPGCg8yrzqRI2CGYnO_Ewjh8lE1E,3291
19
19
  pq/worker.py,sha256=uBbsZAOhhjOCb2CG-32QlRIRJO51TNu8e9AF2BATAmI,20418
20
- python_pq-0.6.0.dist-info/licenses/LICENSE,sha256=Bx9dUtjCpaluWGalMqkI3SGkpPxx_AYdJdmV5ptCM4g,1062
21
- python_pq-0.6.0.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
22
- python_pq-0.6.0.dist-info/entry_points.txt,sha256=fpK4uA3gQaFpcDmdy5GFbP4VP7gaJcn4H4GJyMzRIM8,36
23
- python_pq-0.6.0.dist-info/METADATA,sha256=UYexSkZiw8BzB9mmSBWTaIBFwHwqlFUg_UWbsx4jpMI,9714
24
- python_pq-0.6.0.dist-info/RECORD,,
20
+ python_pq-0.6.1.dist-info/licenses/LICENSE,sha256=Bx9dUtjCpaluWGalMqkI3SGkpPxx_AYdJdmV5ptCM4g,1062
21
+ python_pq-0.6.1.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
22
+ python_pq-0.6.1.dist-info/entry_points.txt,sha256=fpK4uA3gQaFpcDmdy5GFbP4VP7gaJcn4H4GJyMzRIM8,36
23
+ python_pq-0.6.1.dist-info/METADATA,sha256=xfUjjYj-vKUrs6XMa2Jchurd67ZD4dtoeu0B9emQLqU,10141
24
+ python_pq-0.6.1.dist-info/RECORD,,