threadmill 0.5.1__tar.gz → 0.6.1__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.
- {threadmill-0.5.1 → threadmill-0.6.1}/PKG-INFO +11 -13
- threadmill-0.6.1/pyproject.toml +102 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/_version.py +3 -3
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/backends/redis.py +1 -1
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/executor.py +2 -0
- threadmill-0.5.1/pyproject.toml +0 -114
- {threadmill-0.5.1 → threadmill-0.6.1}/LICENSE +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/README.md +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/__init__.py +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/backends/__init__.py +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/backends/base.py +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/backends/lua/acknowledge.lua +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/backends/lua/acquire.lua +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/backends/lua/mover.lua +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/backends/lua/reaper.lua +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/exceptions.py +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/inspector/__init__.py +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/inspector/app.py +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/inspector/inspector.scss +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/inspector/screens.py +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/inspector/telemetry.py +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/management/__init__.py +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/management/commands/__init__.py +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/management/commands/threadmill.py +0 -0
- {threadmill-0.5.1 → threadmill-0.6.1}/threadmill/retry.py +0 -0
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: threadmill
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.1
|
|
4
4
|
Summary: The most reliable backend for Django's task framework.
|
|
5
5
|
Keywords: Django,tasks,worker
|
|
6
6
|
Author-email: Johannes Maron <johannes@maron.family>
|
|
7
7
|
Requires-Python: >=3.14
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
|
-
Classifier: Development Status ::
|
|
10
|
-
Classifier: Programming Language :: Python
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
10
|
Classifier: Environment :: Web Environment
|
|
12
|
-
Classifier:
|
|
11
|
+
Classifier: Framework :: Django
|
|
12
|
+
Classifier: Framework :: Django :: 6.1
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier:
|
|
14
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
15
15
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
16
17
|
Classifier: Operating System :: POSIX
|
|
17
|
-
Classifier: Topic :: Communications :: Email
|
|
18
|
-
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
19
|
-
Classifier: Topic :: Software Development
|
|
20
18
|
Classifier: Programming Language :: Python
|
|
21
|
-
Classifier: Programming Language :: Python :: 3
|
|
22
19
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
20
|
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
-
Classifier:
|
|
25
|
-
Classifier:
|
|
21
|
+
Classifier: Topic :: Communications :: Email
|
|
22
|
+
Classifier: Topic :: Software Development
|
|
23
|
+
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
26
24
|
License-File: LICENSE
|
|
27
|
-
Requires-Dist: django>=6.
|
|
25
|
+
Requires-Dist: django>=6.1
|
|
28
26
|
Requires-Dist: textual>=8.2.7 ; extra == "inspector"
|
|
29
|
-
Requires-Dist: redis>=5
|
|
27
|
+
Requires-Dist: redis>=5 ; extra == "redis"
|
|
30
28
|
Project-URL: Changelog, https://github.com/codingjoe/threadmill/releases
|
|
31
29
|
Project-URL: Documentation, https://github.com/codingjoe/threadmill/
|
|
32
30
|
Project-URL: Funding, https://github.com/sponsors/codingjoe
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
build-backend = "flit_scm:buildapi"
|
|
3
|
+
requires = [ "flit-core>=3.2", "flit-scm", "wheel" ]
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "threadmill"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
keywords = [ "Django", "tasks", "worker" ]
|
|
9
|
+
license = { file = "LICENSE" }
|
|
10
|
+
authors = [
|
|
11
|
+
{ name = "Johannes Maron", email = "johannes@maron.family" },
|
|
12
|
+
]
|
|
13
|
+
requires-python = ">=3.14"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 5 - Production/Stable",
|
|
16
|
+
"Environment :: Web Environment",
|
|
17
|
+
"Framework :: Django",
|
|
18
|
+
"Framework :: Django :: 6.1",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"License :: OSI Approved :: BSD License",
|
|
21
|
+
"Operating System :: MacOS :: MacOS X",
|
|
22
|
+
"Operating System :: Microsoft :: Windows",
|
|
23
|
+
"Operating System :: POSIX",
|
|
24
|
+
"Programming Language :: Python",
|
|
25
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
26
|
+
"Programming Language :: Python :: 3.14",
|
|
27
|
+
"Topic :: Communications :: Email",
|
|
28
|
+
"Topic :: Software Development",
|
|
29
|
+
"Topic :: Text Processing :: Markup :: Markdown",
|
|
30
|
+
]
|
|
31
|
+
dynamic = [ "description", "version" ]
|
|
32
|
+
dependencies = [ "django>=6.1" ]
|
|
33
|
+
optional-dependencies.inspector = [
|
|
34
|
+
"textual>=8.2.7",
|
|
35
|
+
]
|
|
36
|
+
optional-dependencies.redis = [ "redis>=5" ]
|
|
37
|
+
urls.Changelog = "https://github.com/codingjoe/threadmill/releases"
|
|
38
|
+
urls.Documentation = "https://github.com/codingjoe/threadmill/"
|
|
39
|
+
urls.Funding = "https://github.com/sponsors/codingjoe"
|
|
40
|
+
# https://packaging.python.org/en/latest/specifications/well-known-project-urls/#well-known-labels
|
|
41
|
+
urls.Homepage = "https://github.com/codingjoe/threadmill"
|
|
42
|
+
urls.Issues = "https://github.com/codingjoe/threadmill/issues"
|
|
43
|
+
urls.Releasenotes = "https://github.com/codingjoe/threadmill/releases/latest"
|
|
44
|
+
urls.Source = "https://github.com/codingjoe/threadmill"
|
|
45
|
+
|
|
46
|
+
[dependency-groups]
|
|
47
|
+
dev = [
|
|
48
|
+
{ include-group = "test" },
|
|
49
|
+
]
|
|
50
|
+
test = [
|
|
51
|
+
"pytest",
|
|
52
|
+
"pytest-asyncio",
|
|
53
|
+
"pytest-benchmark",
|
|
54
|
+
"pytest-cov",
|
|
55
|
+
"pytest-django",
|
|
56
|
+
"redis>=5",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[tool.setuptools_scm]
|
|
60
|
+
write_to = "threadmill/_version.py"
|
|
61
|
+
|
|
62
|
+
[tool.flit]
|
|
63
|
+
module.name = "threadmill"
|
|
64
|
+
|
|
65
|
+
[tool.ruff]
|
|
66
|
+
src = [ "tests", "threadmill" ]
|
|
67
|
+
lint.select = [
|
|
68
|
+
"B", # flake8-bugbear
|
|
69
|
+
"C", # flake8-comprehensions
|
|
70
|
+
"D", # pydocstyle
|
|
71
|
+
"E", # pycodestyle errors
|
|
72
|
+
"F", # pyflakes
|
|
73
|
+
"I", # isort
|
|
74
|
+
"S", # flake8-bandit
|
|
75
|
+
"UP", # pyupgrade
|
|
76
|
+
"W", # pycodestyle warnings
|
|
77
|
+
]
|
|
78
|
+
lint.ignore = [ "B904", "D1", "E501", "S101" ]
|
|
79
|
+
lint.isort.combine-as-imports = true
|
|
80
|
+
lint.isort.force-wrap-aliases = true
|
|
81
|
+
lint.isort.known-first-party = [ "threadmill", "tests" ]
|
|
82
|
+
lint.isort.section-order = [ "future", "standard-library", "third-party", "first-party", "local-folder" ]
|
|
83
|
+
lint.isort.split-on-trailing-comma = true
|
|
84
|
+
lint.pydocstyle.convention = "pep257"
|
|
85
|
+
|
|
86
|
+
[tool.pytest]
|
|
87
|
+
ini_options.minversion = "6.1"
|
|
88
|
+
ini_options.testpaths = [ "tests" ]
|
|
89
|
+
ini_options.addopts = """\
|
|
90
|
+
--cov --cov-report=xml --cov-report=term --tb=short -rxs --benchmark-autosave --benchmark-group-by=fullname \
|
|
91
|
+
--benchmark-min-rounds=10\
|
|
92
|
+
"""
|
|
93
|
+
ini_options.markers = [
|
|
94
|
+
"benchmark: mark benchmark tests.",
|
|
95
|
+
]
|
|
96
|
+
ini_options.asyncio_mode = "auto"
|
|
97
|
+
ini_options.DJANGO_SETTINGS_MODULE = "tests.testapp.settings"
|
|
98
|
+
|
|
99
|
+
[tool.coverage]
|
|
100
|
+
run.source = [ "threadmill" ]
|
|
101
|
+
report.show_missing = true
|
|
102
|
+
report.skip_covered = true
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.
|
|
22
|
-
__version_tuple__ = version_tuple = (0,
|
|
21
|
+
__version__ = version = '0.6.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 6, 1)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g178578d3a'
|
|
@@ -190,7 +190,7 @@ class RedisTaskBackend(ThreadmillTaskBackend):
|
|
|
190
190
|
enqueued_at = timezone.now()
|
|
191
191
|
task_result = TaskResult(
|
|
192
192
|
task=task,
|
|
193
|
-
id=str(uuid.
|
|
193
|
+
id=str(uuid.uuid7()),
|
|
194
194
|
status=TaskResultStatus.READY,
|
|
195
195
|
enqueued_at=enqueued_at,
|
|
196
196
|
started_at=None,
|
|
@@ -15,6 +15,7 @@ from inspect import iscoroutinefunction
|
|
|
15
15
|
from queue import Empty
|
|
16
16
|
from traceback import format_exception
|
|
17
17
|
|
|
18
|
+
import django
|
|
18
19
|
from django.tasks import TaskResult, task_backends
|
|
19
20
|
from django.tasks.base import TaskContext, TaskError, TaskResultStatus
|
|
20
21
|
from django.tasks.signals import task_finished, task_started
|
|
@@ -146,6 +147,7 @@ class WorkerProcess(multiprocessing.Process):
|
|
|
146
147
|
|
|
147
148
|
def run(self) -> None:
|
|
148
149
|
"""Start consumer execution inside this process."""
|
|
150
|
+
django.setup()
|
|
149
151
|
logger.info("Starting worker process %s", self.name)
|
|
150
152
|
self.lock = threading.Lock()
|
|
151
153
|
self.expired = threading.Event()
|
threadmill-0.5.1/pyproject.toml
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["flit_core>=3.2", "flit_scm", "wheel"]
|
|
3
|
-
build-backend = "flit_scm:buildapi"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "threadmill"
|
|
7
|
-
authors = [
|
|
8
|
-
{ name = "Johannes Maron", email = "johannes@maron.family" },
|
|
9
|
-
]
|
|
10
|
-
readme = "README.md"
|
|
11
|
-
license = { file = "LICENSE" }
|
|
12
|
-
keywords = ["Django", "tasks", "worker"]
|
|
13
|
-
dynamic = ["version", "description"]
|
|
14
|
-
classifiers = [
|
|
15
|
-
"Development Status :: 4 - Beta",
|
|
16
|
-
"Programming Language :: Python",
|
|
17
|
-
"Environment :: Web Environment",
|
|
18
|
-
"License :: OSI Approved :: BSD License",
|
|
19
|
-
"Intended Audience :: Developers",
|
|
20
|
-
"Operating System :: Microsoft :: Windows",
|
|
21
|
-
"Operating System :: MacOS :: MacOS X",
|
|
22
|
-
"Operating System :: POSIX",
|
|
23
|
-
"Topic :: Communications :: Email",
|
|
24
|
-
"Topic :: Text Processing :: Markup :: Markdown",
|
|
25
|
-
"Topic :: Software Development",
|
|
26
|
-
"Programming Language :: Python",
|
|
27
|
-
"Programming Language :: Python :: 3",
|
|
28
|
-
"Programming Language :: Python :: 3 :: Only",
|
|
29
|
-
"Programming Language :: Python :: 3.14",
|
|
30
|
-
"Framework :: Django",
|
|
31
|
-
"Framework :: Django :: 6.1",
|
|
32
|
-
]
|
|
33
|
-
requires-python = ">=3.14"
|
|
34
|
-
dependencies = ["django>=6.0"]
|
|
35
|
-
|
|
36
|
-
[project.optional-dependencies]
|
|
37
|
-
redis = ["redis>=5.0"]
|
|
38
|
-
inspector = [
|
|
39
|
-
"textual>=8.2.7",
|
|
40
|
-
]
|
|
41
|
-
|
|
42
|
-
[project.urls]
|
|
43
|
-
# https://packaging.python.org/en/latest/specifications/well-known-project-urls/#well-known-labels
|
|
44
|
-
Homepage = "https://github.com/codingjoe/threadmill"
|
|
45
|
-
Changelog = "https://github.com/codingjoe/threadmill/releases"
|
|
46
|
-
Source = "https://github.com/codingjoe/threadmill"
|
|
47
|
-
Releasenotes = "https://github.com/codingjoe/threadmill/releases/latest"
|
|
48
|
-
Documentation = "https://github.com/codingjoe/threadmill/"
|
|
49
|
-
Issues = "https://github.com/codingjoe/threadmill/issues"
|
|
50
|
-
Funding = "https://github.com/sponsors/codingjoe"
|
|
51
|
-
|
|
52
|
-
[tool.flit.module]
|
|
53
|
-
name = "threadmill"
|
|
54
|
-
|
|
55
|
-
[tool.setuptools_scm]
|
|
56
|
-
write_to = "threadmill/_version.py"
|
|
57
|
-
|
|
58
|
-
[tool.pytest.ini_options]
|
|
59
|
-
minversion = "6.1a1"
|
|
60
|
-
addopts = "--cov --cov-report=xml --cov-report=term --tb=short -rxs --benchmark-autosave --benchmark-group-by=fullname --benchmark-min-rounds=10"
|
|
61
|
-
testpaths = ["tests"]
|
|
62
|
-
DJANGO_SETTINGS_MODULE = "tests.testapp.settings"
|
|
63
|
-
asyncio_mode = "auto"
|
|
64
|
-
markers = [
|
|
65
|
-
"benchmark: mark benchmark tests.",
|
|
66
|
-
]
|
|
67
|
-
|
|
68
|
-
[tool.coverage.run]
|
|
69
|
-
source = ["threadmill"]
|
|
70
|
-
|
|
71
|
-
[tool.coverage.report]
|
|
72
|
-
show_missing = true
|
|
73
|
-
skip_covered = true
|
|
74
|
-
|
|
75
|
-
[tool.ruff]
|
|
76
|
-
src = ["threadmill", "tests"]
|
|
77
|
-
|
|
78
|
-
[tool.ruff.lint]
|
|
79
|
-
select = [
|
|
80
|
-
"E", # pycodestyle errors
|
|
81
|
-
"W", # pycodestyle warnings
|
|
82
|
-
"F", # pyflakes
|
|
83
|
-
"I", # isort
|
|
84
|
-
"S", # flake8-bandit
|
|
85
|
-
"D", # pydocstyle
|
|
86
|
-
"UP", # pyupgrade
|
|
87
|
-
"B", # flake8-bugbear
|
|
88
|
-
"C", # flake8-comprehensions
|
|
89
|
-
]
|
|
90
|
-
|
|
91
|
-
ignore = ["B904", "D1", "E501", "S101"]
|
|
92
|
-
|
|
93
|
-
[tool.ruff.lint.isort]
|
|
94
|
-
combine-as-imports = true
|
|
95
|
-
split-on-trailing-comma = true
|
|
96
|
-
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
|
|
97
|
-
force-wrap-aliases = true
|
|
98
|
-
known-first-party = ["threadmill", "tests"]
|
|
99
|
-
|
|
100
|
-
[tool.ruff.lint.pydocstyle]
|
|
101
|
-
convention = "pep257"
|
|
102
|
-
|
|
103
|
-
[dependency-groups]
|
|
104
|
-
dev = [
|
|
105
|
-
{ include-group = "test" },
|
|
106
|
-
]
|
|
107
|
-
test = [
|
|
108
|
-
"pytest",
|
|
109
|
-
"pytest-benchmark",
|
|
110
|
-
"pytest-asyncio",
|
|
111
|
-
"pytest-cov",
|
|
112
|
-
"pytest-django",
|
|
113
|
-
"redis>=5.0",
|
|
114
|
-
]
|
|
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
|