litestar-queues 0.1.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 (169) hide show
  1. litestar_queues-0.1.0/.gitignore +202 -0
  2. litestar_queues-0.1.0/.pre-commit-config.yaml +48 -0
  3. litestar_queues-0.1.0/.python-version +1 -0
  4. litestar_queues-0.1.0/LICENSE +21 -0
  5. litestar_queues-0.1.0/Makefile +215 -0
  6. litestar_queues-0.1.0/PKG-INFO +413 -0
  7. litestar_queues-0.1.0/README.md +371 -0
  8. litestar_queues-0.1.0/pyproject.toml +319 -0
  9. litestar_queues-0.1.0/src/litestar_queues/__init__.py +227 -0
  10. litestar_queues-0.1.0/src/litestar_queues/_cli.py +254 -0
  11. litestar_queues-0.1.0/src/litestar_queues/backends/__init__.py +26 -0
  12. litestar_queues-0.1.0/src/litestar_queues/backends/advanced_alchemy/__init__.py +8 -0
  13. litestar_queues-0.1.0/src/litestar_queues/backends/advanced_alchemy/backend.py +294 -0
  14. litestar_queues-0.1.0/src/litestar_queues/backends/advanced_alchemy/config.py +27 -0
  15. litestar_queues-0.1.0/src/litestar_queues/backends/advanced_alchemy/mixins.py +109 -0
  16. litestar_queues-0.1.0/src/litestar_queues/backends/advanced_alchemy/models.py +13 -0
  17. litestar_queues-0.1.0/src/litestar_queues/backends/advanced_alchemy/repository.py +19 -0
  18. litestar_queues-0.1.0/src/litestar_queues/backends/advanced_alchemy/service.py +552 -0
  19. litestar_queues-0.1.0/src/litestar_queues/backends/base.py +255 -0
  20. litestar_queues-0.1.0/src/litestar_queues/backends/factory.py +108 -0
  21. litestar_queues-0.1.0/src/litestar_queues/backends/memory/__init__.py +5 -0
  22. litestar_queues-0.1.0/src/litestar_queues/backends/memory/backend.py +301 -0
  23. litestar_queues-0.1.0/src/litestar_queues/backends/redis/__init__.py +6 -0
  24. litestar_queues-0.1.0/src/litestar_queues/backends/redis/backend.py +776 -0
  25. litestar_queues-0.1.0/src/litestar_queues/backends/redis/config.py +22 -0
  26. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/__init__.py +6 -0
  27. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/backend.py +1417 -0
  28. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/config.py +65 -0
  29. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/extension.py +54 -0
  30. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/migrations/0001_create_queue_tasks.py +32 -0
  31. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/migrations/__init__.py +1 -0
  32. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/schema.py +128 -0
  33. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/__init__.py +35 -0
  34. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/_families.py +146 -0
  35. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/aiomysql/__init__.py +5 -0
  36. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/aiomysql/store.py +11 -0
  37. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/aiosqlite/__init__.py +5 -0
  38. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/aiosqlite/store.py +19 -0
  39. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/asyncmy/__init__.py +5 -0
  40. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/asyncmy/store.py +11 -0
  41. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/asyncpg/__init__.py +5 -0
  42. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/asyncpg/store.py +15 -0
  43. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/base.py +661 -0
  44. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/duckdb/__init__.py +5 -0
  45. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/duckdb/store.py +15 -0
  46. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/factory.py +91 -0
  47. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/mysqlconnector/__init__.py +8 -0
  48. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/mysqlconnector/store.py +17 -0
  49. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/oracledb/__init__.py +5 -0
  50. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/oracledb/store.py +326 -0
  51. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/psqlpy/__init__.py +5 -0
  52. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/psqlpy/store.py +29 -0
  53. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/psycopg/__init__.py +5 -0
  54. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/psycopg/store.py +23 -0
  55. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/sqlite/__init__.py +5 -0
  56. litestar_queues-0.1.0/src/litestar_queues/backends/sqlspec/stores/sqlite/store.py +19 -0
  57. litestar_queues-0.1.0/src/litestar_queues/backends/valkey/__init__.py +6 -0
  58. litestar_queues-0.1.0/src/litestar_queues/backends/valkey/backend.py +36 -0
  59. litestar_queues-0.1.0/src/litestar_queues/backends/valkey/config.py +22 -0
  60. litestar_queues-0.1.0/src/litestar_queues/background.py +35 -0
  61. litestar_queues-0.1.0/src/litestar_queues/config.py +319 -0
  62. litestar_queues-0.1.0/src/litestar_queues/events/__init__.py +65 -0
  63. litestar_queues-0.1.0/src/litestar_queues/events/channels.py +50 -0
  64. litestar_queues-0.1.0/src/litestar_queues/events/context.py +197 -0
  65. litestar_queues-0.1.0/src/litestar_queues/events/litestar.py +130 -0
  66. litestar_queues-0.1.0/src/litestar_queues/events/models.py +138 -0
  67. litestar_queues-0.1.0/src/litestar_queues/events/publisher.py +111 -0
  68. litestar_queues-0.1.0/src/litestar_queues/events/sinks.py +61 -0
  69. litestar_queues-0.1.0/src/litestar_queues/exceptions.py +39 -0
  70. litestar_queues-0.1.0/src/litestar_queues/execution/__init__.py +29 -0
  71. litestar_queues-0.1.0/src/litestar_queues/execution/base.py +81 -0
  72. litestar_queues-0.1.0/src/litestar_queues/execution/cloudrun/__init__.py +6 -0
  73. litestar_queues-0.1.0/src/litestar_queues/execution/cloudrun/_typing.py +37 -0
  74. litestar_queues-0.1.0/src/litestar_queues/execution/cloudrun/backend.py +239 -0
  75. litestar_queues-0.1.0/src/litestar_queues/execution/cloudrun/config.py +64 -0
  76. litestar_queues-0.1.0/src/litestar_queues/execution/cloudrun/entrypoint.py +183 -0
  77. litestar_queues-0.1.0/src/litestar_queues/execution/factory.py +103 -0
  78. litestar_queues-0.1.0/src/litestar_queues/execution/immediate.py +25 -0
  79. litestar_queues-0.1.0/src/litestar_queues/execution/local.py +25 -0
  80. litestar_queues-0.1.0/src/litestar_queues/models.py +130 -0
  81. litestar_queues-0.1.0/src/litestar_queues/plugin.py +133 -0
  82. litestar_queues-0.1.0/src/litestar_queues/py.typed +0 -0
  83. litestar_queues-0.1.0/src/litestar_queues/service.py +521 -0
  84. litestar_queues-0.1.0/src/litestar_queues/task.py +882 -0
  85. litestar_queues-0.1.0/src/litestar_queues/worker.py +266 -0
  86. litestar_queues-0.1.0/src/tests/__init__.py +0 -0
  87. litestar_queues-0.1.0/src/tests/_factories/__init__.py +1 -0
  88. litestar_queues-0.1.0/src/tests/_factories/queue_tasks.py +6 -0
  89. litestar_queues-0.1.0/src/tests/conftest.py +59 -0
  90. litestar_queues-0.1.0/src/tests/integration/__init__.py +0 -0
  91. litestar_queues-0.1.0/src/tests/integration/_backends.py +326 -0
  92. litestar_queues-0.1.0/src/tests/integration/_names.py +17 -0
  93. litestar_queues-0.1.0/src/tests/integration/backends/__init__.py +0 -0
  94. litestar_queues-0.1.0/src/tests/integration/backends/advanced_alchemy/__init__.py +0 -0
  95. litestar_queues-0.1.0/src/tests/integration/backends/advanced_alchemy/_aa_engines.py +108 -0
  96. litestar_queues-0.1.0/src/tests/integration/backends/advanced_alchemy/conftest.py +117 -0
  97. litestar_queues-0.1.0/src/tests/integration/backends/advanced_alchemy/test_contract.py +364 -0
  98. litestar_queues-0.1.0/src/tests/integration/backends/advanced_alchemy/test_heartbeat_session_maker.py +162 -0
  99. litestar_queues-0.1.0/src/tests/integration/backends/advanced_alchemy/test_litestar_integration.py +72 -0
  100. litestar_queues-0.1.0/src/tests/integration/backends/advanced_alchemy/test_model_class.py +160 -0
  101. litestar_queues-0.1.0/src/tests/integration/backends/redis/__init__.py +0 -0
  102. litestar_queues-0.1.0/src/tests/integration/backends/redis/conftest.py +43 -0
  103. litestar_queues-0.1.0/src/tests/integration/backends/redis/test_contract.py +175 -0
  104. litestar_queues-0.1.0/src/tests/integration/backends/redis/test_notifications.py +34 -0
  105. litestar_queues-0.1.0/src/tests/integration/backends/sqlspec/__init__.py +0 -0
  106. litestar_queues-0.1.0/src/tests/integration/backends/sqlspec/conftest.py +96 -0
  107. litestar_queues-0.1.0/src/tests/integration/backends/sqlspec/test_bulk_enqueue.py +220 -0
  108. litestar_queues-0.1.0/src/tests/integration/backends/sqlspec/test_column_map.py +276 -0
  109. litestar_queues-0.1.0/src/tests/integration/backends/sqlspec/test_contract.py +840 -0
  110. litestar_queues-0.1.0/src/tests/integration/backends/sqlspec/test_extension_migrations.py +71 -0
  111. litestar_queues-0.1.0/src/tests/integration/backends/sqlspec/test_heartbeat_pool.py +192 -0
  112. litestar_queues-0.1.0/src/tests/integration/backends/sqlspec/test_notifications.py +327 -0
  113. litestar_queues-0.1.0/src/tests/integration/backends/sqlspec/test_observability.py +176 -0
  114. litestar_queues-0.1.0/src/tests/integration/backends/sqlspec/test_oracle_ddl.py +147 -0
  115. litestar_queues-0.1.0/src/tests/integration/backends/sqlspec/test_streaming.py +54 -0
  116. litestar_queues-0.1.0/src/tests/integration/backends/valkey/__init__.py +0 -0
  117. litestar_queues-0.1.0/src/tests/integration/backends/valkey/conftest.py +43 -0
  118. litestar_queues-0.1.0/src/tests/integration/backends/valkey/test_contract.py +133 -0
  119. litestar_queues-0.1.0/src/tests/integration/backends/valkey/test_notifications.py +33 -0
  120. litestar_queues-0.1.0/src/tests/integration/conftest.py +79 -0
  121. litestar_queues-0.1.0/src/tests/integration/execution/__init__.py +0 -0
  122. litestar_queues-0.1.0/src/tests/integration/execution/cloudrun/__init__.py +0 -0
  123. litestar_queues-0.1.0/src/tests/integration/execution/cloudrun/test_emulator.py +423 -0
  124. litestar_queues-0.1.0/src/tests/integration/test_background.py +155 -0
  125. litestar_queues-0.1.0/src/tests/integration/test_queue_contract.py +318 -0
  126. litestar_queues-0.1.0/src/tests/support/__init__.py +1 -0
  127. litestar_queues-0.1.0/src/tests/support/cli_app.py +24 -0
  128. litestar_queues-0.1.0/src/tests/support/cli_app_missing_canary.py +21 -0
  129. litestar_queues-0.1.0/src/tests/support/discover_tasks_pkg/__init__.py +1 -0
  130. litestar_queues-0.1.0/src/tests/support/discover_tasks_pkg/bar/__init__.py +0 -0
  131. litestar_queues-0.1.0/src/tests/support/discover_tasks_pkg/bar/jobs/__init__.py +0 -0
  132. litestar_queues-0.1.0/src/tests/support/discover_tasks_pkg/bar/jobs/notify.py +6 -0
  133. litestar_queues-0.1.0/src/tests/support/discover_tasks_pkg/baz/__init__.py +0 -0
  134. litestar_queues-0.1.0/src/tests/support/discover_tasks_pkg/baz/inner/__init__.py +0 -0
  135. litestar_queues-0.1.0/src/tests/support/discover_tasks_pkg/baz/inner/jobs/__init__.py +0 -0
  136. litestar_queues-0.1.0/src/tests/support/discover_tasks_pkg/baz/inner/jobs/run.py +6 -0
  137. litestar_queues-0.1.0/src/tests/support/discover_tasks_pkg/foo/__init__.py +0 -0
  138. litestar_queues-0.1.0/src/tests/support/discover_tasks_pkg/foo/jobs/__init__.py +0 -0
  139. litestar_queues-0.1.0/src/tests/support/discover_tasks_pkg/foo/jobs/send.py +6 -0
  140. litestar_queues-0.1.0/src/tests/unit/__init__.py +0 -0
  141. litestar_queues-0.1.0/src/tests/unit/backends/__init__.py +0 -0
  142. litestar_queues-0.1.0/src/tests/unit/backends/test_advanced_alchemy_config.py +16 -0
  143. litestar_queues-0.1.0/src/tests/unit/backends/test_bulk_enqueue.py +64 -0
  144. litestar_queues-0.1.0/src/tests/unit/backends/test_memory.py +220 -0
  145. litestar_queues-0.1.0/src/tests/unit/conftest.py +26 -0
  146. litestar_queues-0.1.0/src/tests/unit/events/__init__.py +0 -0
  147. litestar_queues-0.1.0/src/tests/unit/events/test_litestar_streams.py +104 -0
  148. litestar_queues-0.1.0/src/tests/unit/events/test_models.py +142 -0
  149. litestar_queues-0.1.0/src/tests/unit/events/test_publisher.py +97 -0
  150. litestar_queues-0.1.0/src/tests/unit/test_cli.py +150 -0
  151. litestar_queues-0.1.0/src/tests/unit/test_cli_run.py +77 -0
  152. litestar_queues-0.1.0/src/tests/unit/test_discover_tasks.py +108 -0
  153. litestar_queues-0.1.0/src/tests/unit/test_downstream_migration.py +140 -0
  154. litestar_queues-0.1.0/src/tests/unit/test_plugin.py +95 -0
  155. litestar_queues-0.1.0/src/tests/unit/test_plugin_lifecycle.py +79 -0
  156. litestar_queues-0.1.0/src/tests/unit/test_public_api.py +159 -0
  157. litestar_queues-0.1.0/src/tests/unit/test_service.py +202 -0
  158. litestar_queues-0.1.0/src/tests/unit/test_task_api.py +275 -0
  159. litestar_queues-0.1.0/src/tests/unit/test_task_context.py +80 -0
  160. litestar_queues-0.1.0/src/tests/unit/test_typed_backend_config.py +74 -0
  161. litestar_queues-0.1.0/src/tests/unit/test_worker.py +362 -0
  162. litestar_queues-0.1.0/src/tests/unit/test_worker_events.py +225 -0
  163. litestar_queues-0.1.0/tools/__init__.py +0 -0
  164. litestar_queues-0.1.0/tools/benchmark_bulk_enqueue.py +107 -0
  165. litestar_queues-0.1.0/tools/build_docs.py +33 -0
  166. litestar_queues-0.1.0/tools/no_future_annotations.py +44 -0
  167. litestar_queues-0.1.0/tools/sphinx_ext/__init__.py +1 -0
  168. litestar_queues-0.1.0/tools/sphinx_ext/pygments_styles.py +168 -0
  169. litestar_queues-0.1.0/uv.lock +3893 -0
@@ -0,0 +1,202 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+ tmp/
29
+ docs-build/
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # Generated demo GIFs (created by VHS during CI)
76
+ docs/_static/demos/*.gif
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ # .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ #Pipfile.lock
100
+
101
+ # poetry
102
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
106
+ #poetry.lock
107
+
108
+ # pdm
109
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
110
+ #pdm.lock
111
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
112
+ # in version control.
113
+ # https://pdm.fming.dev/#use-with-ide
114
+ .pdm.toml
115
+ .pdm-python
116
+ .pdm-build/
117
+
118
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
119
+ __pypackages__/
120
+
121
+ # Celery stuff
122
+ celerybeat-schedule
123
+ celerybeat.pid
124
+
125
+ # SageMath parsed files
126
+ *.sage.py
127
+
128
+ # Environments
129
+ .env
130
+ .venv
131
+ env/
132
+ venv/
133
+ ENV/
134
+ env.bak/
135
+ venv.bak/
136
+
137
+ # Spyder project settings
138
+ .spyderproject
139
+ .spyproject
140
+
141
+ # Rope project settings
142
+ .ropeproject
143
+
144
+ # mkdocs documentation
145
+ /site
146
+
147
+ # mypy
148
+ .mypy_cache/
149
+ .dmypy.json
150
+ dmypy.json
151
+
152
+ # Pyre type checker
153
+ .pyre/
154
+
155
+ # pytype static type analyzer
156
+ .pytype/
157
+
158
+ # Cython debug symbols
159
+ cython_debug/
160
+
161
+ # PyCharm
162
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
163
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
164
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
165
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
166
+ #.idea/
167
+
168
+ # vscode
169
+ .vscode
170
+
171
+ node_modules
172
+ .aider*
173
+
174
+ .DS_Store
175
+ *.swo
176
+ *.swp
177
+ .venv
178
+
179
+
180
+ # AI Agent Systems (Gemini & Claude)
181
+ # All AI infrastructure is local-only and not tracked in git
182
+ specs/
183
+ .gemini/
184
+ .claude/
185
+ .codex/
186
+ AGENTS.md
187
+ CLAUDE.md
188
+ GEMINI.md
189
+ coverage/
190
+ coverage.json
191
+ .agent/
192
+ .beads/
193
+ .agents
194
+
195
+ # Beads / Dolt files (added by bd init)
196
+ .dolt/
197
+ *.db
198
+ .beads-credential-key
199
+ GEMINI.md
200
+ test-build
201
+ .antigravitycli/
202
+ opencode.json
@@ -0,0 +1,48 @@
1
+ default_language_version:
2
+ python: "3"
3
+ repos:
4
+ - repo: local
5
+ hooks:
6
+ - id: no-future-annotations
7
+ name: Disallow future annotations import
8
+ entry: python tools/no_future_annotations.py
9
+ language: python
10
+ types_or: [python]
11
+ - repo: https://github.com/compilerla/conventional-pre-commit
12
+ rev: v4.4.0
13
+ hooks:
14
+ - id: conventional-pre-commit
15
+ stages: [commit-msg]
16
+ - repo: https://github.com/pre-commit/pre-commit-hooks
17
+ rev: v6.0.0
18
+ hooks:
19
+ - id: check-ast
20
+ - id: check-case-conflict
21
+ - id: check-toml
22
+ - id: debug-statements
23
+ - id: end-of-file-fixer
24
+ - id: mixed-line-ending
25
+ - id: trailing-whitespace
26
+ - repo: https://github.com/astral-sh/ruff-pre-commit
27
+ rev: "v0.15.20"
28
+ hooks:
29
+ - id: ruff-check
30
+ args: ["--fix"]
31
+ - id: ruff-format
32
+ - repo: https://github.com/codespell-project/codespell
33
+ rev: v2.4.2
34
+ hooks:
35
+ - id: codespell
36
+ additional_dependencies:
37
+ - tomli
38
+ - repo: https://github.com/python-formate/flake8-dunder-all
39
+ rev: v0.5.0
40
+ hooks:
41
+ - id: ensure-dunder-all
42
+ exclude: "test*|tools"
43
+ args: ["--use-tuple"]
44
+ - repo: https://github.com/ariebovenberg/slotscheck
45
+ rev: v0.20.0
46
+ hooks:
47
+ - id: slotscheck
48
+ exclude: "docs|.github"
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Litestar Organization
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,215 @@
1
+ SHELL := /bin/bash
2
+ .SHELLFLAGS := -euo pipefail -c
3
+
4
+ # =============================================================================
5
+ # Configuration and Environment Variables
6
+ # =============================================================================
7
+
8
+ .DEFAULT_GOAL:=help
9
+ .ONESHELL:
10
+ .EXPORT_ALL_VARIABLES:
11
+ MAKEFLAGS += --no-print-directory
12
+ UV_SYNC_ARGS ?= --all-extras --dev
13
+
14
+ # -----------------------------------------------------------------------------
15
+ # Display Formatting and Colors
16
+ # -----------------------------------------------------------------------------
17
+ BLUE := $(shell printf "\033[1;34m")
18
+ GREEN := $(shell printf "\033[1;32m")
19
+ RED := $(shell printf "\033[1;31m")
20
+ YELLOW := $(shell printf "\033[1;33m")
21
+ NC := $(shell printf "\033[0m")
22
+ INFO := $(shell printf "$(BLUE)i$(NC)")
23
+ OK := $(shell printf "$(GREEN)ok$(NC)")
24
+ WARN := $(shell printf "$(YELLOW)!$(NC)")
25
+ ERROR := $(shell printf "$(RED)x$(NC)")
26
+
27
+ # =============================================================================
28
+ # Help and Documentation
29
+ # =============================================================================
30
+
31
+ .PHONY: help
32
+ help: ## Display this help text for Makefile
33
+ @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
34
+
35
+ # =============================================================================
36
+ # Installation and Environment Setup
37
+ # =============================================================================
38
+
39
+ .PHONY: install-uv
40
+ install-uv: ## Install latest version of uv
41
+ @echo "${INFO} Installing uv..."
42
+ @curl -LsSf https://astral.sh/uv/install.sh | sh >/dev/null 2>&1
43
+ @echo "${OK} UV installed successfully"
44
+
45
+ .PHONY: install
46
+ install: clean ## Install the project and dependencies for local development
47
+ @echo "${INFO} Starting fresh installation..."
48
+ @uv sync $(UV_SYNC_ARGS)
49
+ @echo "${OK} Installation complete"
50
+
51
+ .PHONY: install-test-adapters
52
+ install-test-adapters: ## Install test dependencies for the full integration matrix
53
+ @echo "${INFO} Installing test dependencies..."
54
+ @uv sync --group tests $(UV_SYNC_ARGS)
55
+ @echo "${OK} Test dependencies installed"
56
+
57
+ .PHONY: destroy
58
+ destroy: ## Destroy the virtual environment
59
+ @echo "${INFO} Destroying virtual environment..."
60
+ @rm -rf .venv
61
+ @echo "${OK} Virtual environment destroyed"
62
+
63
+ # =============================================================================
64
+ # Dependency Management
65
+ # =============================================================================
66
+
67
+ .PHONY: upgrade
68
+ upgrade: ## Upgrade all dependencies to latest stable versions
69
+ @echo "${INFO} Updating all dependencies..."
70
+ @uv lock --upgrade
71
+ @echo "${OK} Dependencies updated"
72
+ @uvx prek autoupdate
73
+ @echo "${OK} Updated prek hooks"
74
+
75
+ .PHONY: lock
76
+ lock: ## Rebuild lockfiles from scratch
77
+ @echo "${INFO} Rebuilding lockfiles..."
78
+ @uv lock --upgrade
79
+ @echo "${OK} Lockfiles updated"
80
+
81
+ # =============================================================================
82
+ # Build and Release
83
+ # =============================================================================
84
+
85
+ .PHONY: build
86
+ build: ## Build the project
87
+ @echo "${INFO} Building package..."
88
+ @uv build
89
+ @echo "${OK} Package build complete"
90
+
91
+ # =============================================================================
92
+ # Documentation
93
+ # =============================================================================
94
+
95
+ .PHONY: docs
96
+ docs: ## Build documentation
97
+ @echo "${INFO} Building docs..."
98
+ @uv run sphinx-build -b html docs docs/_build/html
99
+ @echo "${OK} Docs build complete"
100
+
101
+ .PHONY: docs-linkcheck
102
+ docs-linkcheck: ## Check documentation links
103
+ @echo "${INFO} Checking docs links..."
104
+ @uv run sphinx-build -b linkcheck docs docs/_build/linkcheck
105
+ @echo "${OK} Docs linkcheck complete"
106
+
107
+ .PHONY: docs-clean
108
+ docs-clean: ## Clean documentation artifacts
109
+ @echo "${INFO} Cleaning docs artifacts..."
110
+ @rm -rf docs/_build docs-build >/dev/null 2>&1
111
+ @echo "${OK} Docs artifacts cleaned"
112
+
113
+ # =============================================================================
114
+ # Cleaning and Maintenance
115
+ # =============================================================================
116
+
117
+ .PHONY: clean
118
+ clean: ## Cleanup temporary build artifacts
119
+ @echo "${INFO} Cleaning working directory..."
120
+ @rm -rf .pytest_cache .ruff_cache .hypothesis build/ dist/ .eggs/ .coverage coverage.xml coverage.json htmlcov/ src/tests/.pytest_cache src/tests/**/.pytest_cache .mypy_cache >/dev/null 2>&1
121
+ @find . -name '*.egg-info' -exec rm -rf {} + >/dev/null 2>&1
122
+ @find . -type f -name '*.egg' -exec rm -f {} + >/dev/null 2>&1
123
+ @find . -name '*.pyc' -exec rm -f {} + >/dev/null 2>&1
124
+ @find . -name '*.pyo' -exec rm -f {} + >/dev/null 2>&1
125
+ @find . -name '*~' -exec rm -f {} + >/dev/null 2>&1
126
+ @find . -name '__pycache__' -exec rm -rf {} + >/dev/null 2>&1
127
+ @find . -name '.ipynb_checkpoints' -exec rm -rf {} + >/dev/null 2>&1
128
+ @echo "${OK} Working directory cleaned"
129
+
130
+ # =============================================================================
131
+ # Testing and Quality Checks
132
+ # =============================================================================
133
+
134
+ .PHONY: test
135
+ test: ## Run the tests
136
+ @echo "${INFO} Running test cases..."
137
+ @uv run pytest src/tests
138
+ @echo "${OK} Tests complete"
139
+
140
+ .PHONY: test-all
141
+ test-all: test ## Run all tests
142
+
143
+ .PHONY: test-unit
144
+ test-unit: ## Run unit tests only (no Docker required)
145
+ @echo "${INFO} Running unit tests..."
146
+ @uv run pytest src/tests/unit -n auto
147
+ @echo "${OK} Unit tests complete"
148
+
149
+ .PHONY: test-integration
150
+ test-integration: ## Run integration tests only (autoskips without Docker)
151
+ @echo "${INFO} Running integration tests..."
152
+ @uv run pytest src/tests/integration -n auto
153
+ @echo "${OK} Integration tests complete"
154
+
155
+ .PHONY: coverage
156
+ coverage: ## Run tests with coverage report
157
+ @echo "${INFO} Running tests with coverage..."
158
+ @uv run pytest src/tests --cov -n auto
159
+ @uv run coverage html >/dev/null 2>&1
160
+ @uv run coverage xml >/dev/null 2>&1
161
+ @echo "${OK} Coverage report generated"
162
+
163
+ # -----------------------------------------------------------------------------
164
+ # Type Checking
165
+ # -----------------------------------------------------------------------------
166
+
167
+ .PHONY: mypy
168
+ mypy: ## Run mypy
169
+ @echo "${INFO} Running mypy..."
170
+ @uv run dmypy run
171
+ @echo "${OK} Mypy checks passed"
172
+
173
+ .PHONY: mypy-nocache
174
+ mypy-nocache: ## Run Mypy without cache
175
+ @echo "${INFO} Running mypy without cache..."
176
+ @uv run mypy
177
+ @echo "${OK} Mypy checks passed"
178
+
179
+ .PHONY: pyright
180
+ pyright: ## Run pyright
181
+ @echo "${INFO} Running pyright..."
182
+ @uv run pyright
183
+ @echo "${OK} Pyright checks passed"
184
+
185
+ .PHONY: type-check
186
+ type-check: mypy pyright ## Run all type checking
187
+
188
+ # -----------------------------------------------------------------------------
189
+ # Linting and Formatting
190
+ # -----------------------------------------------------------------------------
191
+
192
+ .PHONY: prek
193
+ prek: ## Run prek hooks
194
+ @echo "${INFO} Running prek checks..."
195
+ @uvx prek run --show-diff-on-failure --color=always --all-files
196
+ @echo "${OK} prek checks passed"
197
+
198
+ .PHONY: slotscheck
199
+ slotscheck: ## Run slotscheck
200
+ @echo "${INFO} Running slots check..."
201
+ @uv run slotscheck src/litestar_queues/
202
+ @echo "${OK} Slots check passed"
203
+
204
+ .PHONY: fix
205
+ fix: ## Fix linting issues
206
+ @echo "${INFO} Fixing linting issues..."
207
+ @uv run ruff check --fix --unsafe-fixes src/
208
+ @uv run ruff format src/
209
+ @echo "${OK} Linting issues fixed"
210
+
211
+ .PHONY: lint
212
+ lint: prek type-check slotscheck ## Run all linting checks
213
+
214
+ .PHONY: check-all
215
+ check-all: lint test-all coverage ## Run all checks (lint, test, coverage)