queuerPy 0.7.0__tar.gz → 0.9.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 (52) hide show
  1. {queuerpy-0.7.0/queuerPy.egg-info → queuerpy-0.9.0}/PKG-INFO +1 -1
  2. {queuerpy-0.7.0 → queuerpy-0.9.0}/_version.py +1 -1
  3. queuerpy-0.9.0/py.typed +1 -0
  4. {queuerpy-0.7.0 → queuerpy-0.9.0}/pyproject.toml +20 -3
  5. {queuerpy-0.7.0 → queuerpy-0.9.0/queuerPy.egg-info}/PKG-INFO +1 -1
  6. {queuerpy-0.7.0 → queuerpy-0.9.0}/queuerPy.egg-info/SOURCES.txt +2 -0
  7. {queuerpy-0.7.0 → queuerpy-0.9.0}/queuer_task.py +13 -4
  8. {queuerpy-0.7.0 → queuerpy-0.9.0}/LICENSE +0 -0
  9. {queuerpy-0.7.0 → queuerpy-0.9.0}/MANIFEST.in +0 -0
  10. {queuerpy-0.7.0 → queuerpy-0.9.0}/README.md +0 -0
  11. {queuerpy-0.7.0 → queuerpy-0.9.0}/__init__.py +0 -0
  12. {queuerpy-0.7.0 → queuerpy-0.9.0}/core/__init__.py +0 -0
  13. {queuerpy-0.7.0 → queuerpy-0.9.0}/core/broadcaster.py +0 -0
  14. {queuerpy-0.7.0 → queuerpy-0.9.0}/core/listener.py +0 -0
  15. {queuerpy-0.7.0 → queuerpy-0.9.0}/core/retryer.py +0 -0
  16. {queuerpy-0.7.0 → queuerpy-0.9.0}/core/runner.py +0 -0
  17. {queuerpy-0.7.0 → queuerpy-0.9.0}/core/scheduler.py +0 -0
  18. {queuerpy-0.7.0 → queuerpy-0.9.0}/core/ticker.py +0 -0
  19. {queuerpy-0.7.0 → queuerpy-0.9.0}/database/__init__.py +0 -0
  20. {queuerpy-0.7.0 → queuerpy-0.9.0}/database/db_job.py +0 -0
  21. {queuerpy-0.7.0 → queuerpy-0.9.0}/database/db_listener.py +0 -0
  22. {queuerpy-0.7.0 → queuerpy-0.9.0}/database/db_master.py +0 -0
  23. {queuerpy-0.7.0 → queuerpy-0.9.0}/database/db_worker.py +0 -0
  24. {queuerpy-0.7.0 → queuerpy-0.9.0}/helper/__init__.py +0 -0
  25. {queuerpy-0.7.0 → queuerpy-0.9.0}/helper/database.py +0 -0
  26. {queuerpy-0.7.0 → queuerpy-0.9.0}/helper/error.py +0 -0
  27. {queuerpy-0.7.0 → queuerpy-0.9.0}/helper/logging.py +0 -0
  28. {queuerpy-0.7.0 → queuerpy-0.9.0}/helper/sql.py +0 -0
  29. {queuerpy-0.7.0 → queuerpy-0.9.0}/helper/task.py +0 -0
  30. {queuerpy-0.7.0 → queuerpy-0.9.0}/model/__init__.py +0 -0
  31. {queuerpy-0.7.0 → queuerpy-0.9.0}/model/batch_job.py +0 -0
  32. {queuerpy-0.7.0 → queuerpy-0.9.0}/model/connection.py +0 -0
  33. {queuerpy-0.7.0 → queuerpy-0.9.0}/model/job.py +0 -0
  34. {queuerpy-0.7.0 → queuerpy-0.9.0}/model/master.py +0 -0
  35. {queuerpy-0.7.0 → queuerpy-0.9.0}/model/options.py +0 -0
  36. {queuerpy-0.7.0 → queuerpy-0.9.0}/model/options_on_error.py +0 -0
  37. {queuerpy-0.7.0 → queuerpy-0.9.0}/model/task.py +0 -0
  38. {queuerpy-0.7.0 → queuerpy-0.9.0}/model/worker.py +0 -0
  39. {queuerpy-0.7.0 → queuerpy-0.9.0}/queuer.py +0 -0
  40. {queuerpy-0.7.0 → queuerpy-0.9.0}/queuerPy.egg-info/dependency_links.txt +0 -0
  41. {queuerpy-0.7.0 → queuerpy-0.9.0}/queuerPy.egg-info/requires.txt +0 -0
  42. {queuerpy-0.7.0 → queuerpy-0.9.0}/queuerPy.egg-info/top_level.txt +0 -0
  43. {queuerpy-0.7.0 → queuerpy-0.9.0}/queuer_global.py +0 -0
  44. {queuerpy-0.7.0 → queuerpy-0.9.0}/queuer_job.py +0 -0
  45. {queuerpy-0.7.0 → queuerpy-0.9.0}/queuer_listener.py +0 -0
  46. {queuerpy-0.7.0 → queuerpy-0.9.0}/queuer_master.py +0 -0
  47. {queuerpy-0.7.0 → queuerpy-0.9.0}/queuer_next_interval.py +0 -0
  48. {queuerpy-0.7.0 → queuerpy-0.9.0}/setup.cfg +0 -0
  49. {queuerpy-0.7.0 → queuerpy-0.9.0}/sql/job.sql +0 -0
  50. {queuerpy-0.7.0 → queuerpy-0.9.0}/sql/master.sql +0 -0
  51. {queuerpy-0.7.0 → queuerpy-0.9.0}/sql/notify.sql +0 -0
  52. {queuerpy-0.7.0 → queuerpy-0.9.0}/sql/worker.sql +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: queuerPy
3
- Version: 0.7.0
3
+ Version: 0.9.0
4
4
  Summary: A Python implementation of the queuer system - a job queuing and processing system with PostgreSQL backend
5
5
  Author-email: Simon Herrmann <siherrmann@users.noreply.github.com>
6
6
  Maintainer-email: Simon Herrmann <siherrmann@users.noreply.github.com>
@@ -1,6 +1,6 @@
1
1
  """Version information for queuerPy package."""
2
2
 
3
- __version__ = "0.7.0"
3
+ __version__ = "0.9.0"
4
4
  __version_info__ = tuple(int(part) for part in __version__.split("."))
5
5
 
6
6
  # For compatibility
@@ -0,0 +1 @@
1
+ # Marker file for PEP 561 - this package supports typing
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "queuerPy"
7
- version = "0.7.0"
7
+ version = "0.9.0"
8
8
  description = "A Python implementation of the queuer system - a job queuing and processing system with PostgreSQL backend"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -69,7 +69,7 @@ packages = ["queuerPy", "queuerPy.core", "queuerPy.database", "queuerPy.helper",
69
69
  "queuerPy.sql" = "sql"
70
70
 
71
71
  [tool.setuptools.package-data]
72
- "queuerPy" = ["sql/*.sql"]
72
+ "queuerPy" = ["sql/*.sql", "py.typed"]
73
73
  "*" = ["*.sql"]
74
74
 
75
75
  [tool.pytest.ini_options]
@@ -86,4 +86,21 @@ markers = [
86
86
  "slow: marks tests as slow (deselect with '-m \"not slow\"')",
87
87
  "integration: marks tests as integration tests"
88
88
  ]
89
- asyncio_mode = "strict"
89
+ asyncio_mode = "strict"
90
+
91
+ [tool.pyright]
92
+ include = ["."]
93
+ exclude = ["**/__pycache__"]
94
+ reportMissingImports = true
95
+ reportMissingTypeStubs = false
96
+ pythonVersion = "3.8"
97
+ pythonPlatform = "All"
98
+
99
+ [tool.mypy]
100
+ python_version = "0.9.0"
101
+ warn_return_any = true
102
+ warn_unused_configs = true
103
+ disallow_untyped_defs = true
104
+ disallow_incomplete_defs = true
105
+ check_untyped_defs = true
106
+ disallow_untyped_decorators = true
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: queuerPy
3
- Version: 0.7.0
3
+ Version: 0.9.0
4
4
  Summary: A Python implementation of the queuer system - a job queuing and processing system with PostgreSQL backend
5
5
  Author-email: Simon Herrmann <siherrmann@users.noreply.github.com>
6
6
  Maintainer-email: Simon Herrmann <siherrmann@users.noreply.github.com>
@@ -3,6 +3,7 @@ MANIFEST.in
3
3
  README.md
4
4
  __init__.py
5
5
  _version.py
6
+ py.typed
6
7
  pyproject.toml
7
8
  queuer.py
8
9
  queuer_global.py
@@ -13,6 +14,7 @@ queuer_next_interval.py
13
14
  queuer_task.py
14
15
  ./__init__.py
15
16
  ./_version.py
17
+ ./py.typed
16
18
  ./queuer.py
17
19
  ./queuer_global.py
18
20
  ./queuer_job.py
@@ -4,7 +4,7 @@ Mirrors Go's queuerTask.go functionality.
4
4
  """
5
5
 
6
6
  import logging
7
- from typing import Any, Callable, Optional
7
+ from typing import Any, Callable, Optional, TypeVar, overload
8
8
 
9
9
  from model.task import new_task, new_task_with_name
10
10
  from model.task import Task
@@ -12,6 +12,9 @@ from queuer_global import QueuerGlobalMixin
12
12
 
13
13
  logger = logging.getLogger(__name__)
14
14
 
15
+ # TypeVar for maintaining function type through decorator
16
+ F = TypeVar("F", bound=Callable[..., Any])
17
+
15
18
 
16
19
  class QueuerTaskMixin(QueuerGlobalMixin):
17
20
  """
@@ -88,7 +91,13 @@ class QueuerTaskMixin(QueuerGlobalMixin):
88
91
  logger.info(f"Task added: {new_task_obj.name}")
89
92
  return new_task_obj
90
93
 
91
- def task(self, name: Optional[str] = None):
94
+ @overload
95
+ def task(self, name: None = None) -> Callable[[F], F]: ...
96
+
97
+ @overload
98
+ def task(self, name: str) -> Callable[[F], F]: ...
99
+
100
+ def task(self, name: Optional[str] = None) -> Callable[[F], F]:
92
101
  """
93
102
  Decorator to register a task function with the queuer.
94
103
  This is equivalent to calling add_task() or add_task_with_name().
@@ -103,10 +112,10 @@ class QueuerTaskMixin(QueuerGlobalMixin):
103
112
  return param * 2
104
113
 
105
114
  :param name: Optional custom name for the task. If not provided, uses function name.
106
- :return: The decorator function
115
+ :return: The decorator function that preserves the original function's type
107
116
  """
108
117
 
109
- def decorator(func: Callable[..., Any]) -> Callable[..., Any]:
118
+ def decorator(func: F) -> F:
110
119
  if name is not None:
111
120
  self.add_task_with_name(func, name)
112
121
  else:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes