pydocket 0.1.1__tar.gz → 0.1.2__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.
Potentially problematic release.
This version of pydocket might be problematic. Click here for more details.
- pydocket-0.1.1/.cursorrules → pydocket-0.1.2/.cursor/rules/general.mdc +7 -17
- pydocket-0.1.2/.cursor/rules/python-style.mdc +22 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/.github/workflows/ci.yml +1 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/PKG-INFO +1 -1
- {pydocket-0.1.1 → pydocket-0.1.2}/pyproject.toml +2 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/src/docket/worker.py +1 -1
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/conftest.py +14 -3
- {pydocket-0.1.1 → pydocket-0.1.2}/.github/codecov.yml +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/.github/workflows/chaos.yml +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/.github/workflows/publish.yml +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/.gitignore +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/.pre-commit-config.yaml +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/LICENSE +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/README.md +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/chaos/README.md +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/chaos/__init__.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/chaos/driver.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/chaos/producer.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/chaos/run +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/chaos/tasks.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/src/docket/__init__.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/src/docket/__main__.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/src/docket/annotations.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/src/docket/cli.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/src/docket/dependencies.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/src/docket/docket.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/src/docket/execution.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/src/docket/instrumentation.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/src/docket/py.typed +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/src/docket/tasks.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/telemetry/.gitignore +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/telemetry/start +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/telemetry/stop +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/__init__.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/cli/__init__.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/cli/conftest.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/cli/test_module.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/cli/test_parsing.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/cli/test_snapshot.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/cli/test_striking.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/cli/test_tasks.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/cli/test_version.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/cli/test_worker.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/cli/test_workers.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/test_dependencies.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/test_docket.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/test_fundamentals.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/test_instrumentation.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/test_striking.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/tests/test_worker.py +0 -0
- {pydocket-0.1.1 → pydocket-0.1.2}/uv.lock +0 -0
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description:
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# about docket
|
|
1
8
|
docket is a distributed background task system for Python functions with a focus
|
|
2
9
|
on the scheduling of future work as seamlessly and efficiency as immediate work.
|
|
3
10
|
|
|
@@ -22,20 +29,3 @@ idempotency of an execution.
|
|
|
22
29
|
|
|
23
30
|
A docket worker should be as easily usable in code as it is from the command line,
|
|
24
31
|
and should be a breeze to use with test suites.
|
|
25
|
-
|
|
26
|
-
# Code style
|
|
27
|
-
|
|
28
|
-
When generating production code, always use full parameter and return type hints
|
|
29
|
-
for every function. Never generate useless inline comments that just reiterate
|
|
30
|
-
what the code is doing. It's okay to include comments in the rare case there is
|
|
31
|
-
something tricky going on.
|
|
32
|
-
|
|
33
|
-
When generating tests, always use parameter type hints, but never include the
|
|
34
|
-
`-> None` return type hint for a test function. For `pytest` fixtures, always
|
|
35
|
-
generate both the parameter and return type hints.
|
|
36
|
-
|
|
37
|
-
When generating tests, favor smaller, focused tests that use fixtures for reuse.
|
|
38
|
-
Don't include extraneous comments in the test code unless something needs more
|
|
39
|
-
clarity. Always generate a docstring using "should" language to describe the
|
|
40
|
-
aspect of the system the test is checking. Use simple direct language and avoid
|
|
41
|
-
sounding stuffy, but make these complete sentences.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: how to write python
|
|
3
|
+
globs: *.py
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Code style
|
|
8
|
+
|
|
9
|
+
When generating production code, always use full parameter and return type hints
|
|
10
|
+
for every function. Never generate useless inline comments that just reiterate
|
|
11
|
+
what the code is doing. It's okay to include comments in the rare case there is
|
|
12
|
+
something tricky going on.
|
|
13
|
+
|
|
14
|
+
When generating tests, always use parameter type hints, but never include the
|
|
15
|
+
`-> None` return type hint for a test function. For `pytest` fixtures, always
|
|
16
|
+
generate both the parameter and return type hints.
|
|
17
|
+
|
|
18
|
+
When generating tests, favor smaller, focused tests that use fixtures for reuse.
|
|
19
|
+
Don't include extraneous comments in the test code unless something needs more
|
|
20
|
+
clarity. Always generate a docstring using "should" language to describe the
|
|
21
|
+
aspect of the system the test is checking. Use simple direct language and avoid
|
|
22
|
+
sounding stuffy, but make these complete sentences.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pydocket
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: A distributed background task system for Python functions
|
|
5
5
|
Project-URL: Homepage, https://github.com/chrisguidry/docket
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/chrisguidry/docket/issues
|
|
@@ -68,6 +68,8 @@ packages = ["src/docket"]
|
|
|
68
68
|
addopts = "--cov=src/docket --cov=tests --cov-report=term-missing --cov-branch"
|
|
69
69
|
asyncio_mode = "auto"
|
|
70
70
|
asyncio_default_fixture_loop_scope = "session"
|
|
71
|
+
filterwarnings = ["error"]
|
|
72
|
+
|
|
71
73
|
|
|
72
74
|
[tool.pyright]
|
|
73
75
|
include = ["src", "tests"]
|
|
@@ -262,7 +262,7 @@ class Worker:
|
|
|
262
262
|
)
|
|
263
263
|
|
|
264
264
|
redeliveries: RedisMessages
|
|
265
|
-
_, redeliveries, _ = await redis.xautoclaim(
|
|
265
|
+
_, redeliveries, *_ = await redis.xautoclaim(
|
|
266
266
|
name=self.docket.stream_key,
|
|
267
267
|
groupname=self.docket.worker_group_name,
|
|
268
268
|
consumername=self.name,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import time
|
|
2
2
|
from datetime import datetime, timezone
|
|
3
3
|
from functools import partial
|
|
4
|
-
from typing import AsyncGenerator, Callable, Generator, Iterable, cast
|
|
4
|
+
from typing import Any, AsyncGenerator, Callable, Generator, Iterable, cast
|
|
5
5
|
from unittest.mock import AsyncMock
|
|
6
6
|
from uuid import uuid4
|
|
7
7
|
|
|
@@ -46,12 +46,14 @@ def redis_server(redis_port: int) -> Generator[Container, None, None]:
|
|
|
46
46
|
auto_remove=True,
|
|
47
47
|
)
|
|
48
48
|
|
|
49
|
+
url = f"redis://localhost:{redis_port}/0"
|
|
50
|
+
|
|
49
51
|
while True:
|
|
50
52
|
try:
|
|
51
|
-
with Redis.from_url(
|
|
53
|
+
with Redis.from_url(url) as r: # type: ignore
|
|
52
54
|
if r.ping(): # type: ignore
|
|
53
55
|
break
|
|
54
|
-
except redis.exceptions.ConnectionError:
|
|
56
|
+
except redis.exceptions.ConnectionError: # pragma: no cover
|
|
55
57
|
pass
|
|
56
58
|
|
|
57
59
|
time.sleep(0.1)
|
|
@@ -59,8 +61,17 @@ def redis_server(redis_port: int) -> Generator[Container, None, None]:
|
|
|
59
61
|
try:
|
|
60
62
|
yield container
|
|
61
63
|
finally:
|
|
64
|
+
with Redis.from_url(url) as r: # type: ignore
|
|
65
|
+
info: dict[str, Any] = r.info() # type: ignore
|
|
66
|
+
|
|
62
67
|
container.stop()
|
|
63
68
|
|
|
69
|
+
# By the time the test suite finishes, there should have been no more open
|
|
70
|
+
# Redis connections (just the one that we used to ask about client connections).
|
|
71
|
+
assert info["connected_clients"] == 1, (
|
|
72
|
+
f"Expected 1 connected clients, but found {info['connected_clients']}"
|
|
73
|
+
)
|
|
74
|
+
|
|
64
75
|
|
|
65
76
|
@pytest.fixture
|
|
66
77
|
def redis_url(redis_server: Container, redis_port: int) -> str:
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|