containers-py 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.
- containers_py-0.1.0/PKG-INFO +27 -0
- containers_py-0.1.0/README.md +16 -0
- containers_py-0.1.0/pyproject.toml +61 -0
- containers_py-0.1.0/pyproject.toml.orig +48 -0
- containers_py-0.1.0/src/containers/__init__.py +16 -0
- containers_py-0.1.0/src/containers/container.py +2371 -0
- containers_py-0.1.0/src/containers/ffi.py +137 -0
- containers_py-0.1.0/src/containers/py.typed +0 -0
- containers_py-0.1.0/src/containers/state.py +85 -0
- containers_py-0.1.0/src/containers/utils.py +178 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: containers-py
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Cloudflare Containers for Python Workers
|
|
5
|
+
Author: Viswa Marepalli
|
|
6
|
+
Author-email: Viswa Marepalli <reachvishm@gmail.com>
|
|
7
|
+
Requires-Dist: typing-extensions>=4.12
|
|
8
|
+
Requires-Dist: workers-runtime-sdk>=1.9.0
|
|
9
|
+
Requires-Python: >=3.12
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
<h1 align="center">
|
|
13
|
+
<sub>
|
|
14
|
+
<img src=".github/python-containers.svg" height="36">
|
|
15
|
+
</sub>
|
|
16
|
+
|
|
17
|
+
containers-py
|
|
18
|
+
</h1>
|
|
19
|
+
<p align="center">
|
|
20
|
+
<sup>
|
|
21
|
+
Cloudflare Containers for Python Workers
|
|
22
|
+
</sup>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
> [!note]
|
|
26
|
+
> This is an unofficial SDK. I worked on a port during my internship at Cloudflare. This SDK is a re-port with improvements in mind from my original port at Cloudflare. Yes, AI was used, but I am actively ensuring the SDK is good and usable.
|
|
27
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<sub>
|
|
3
|
+
<img src=".github/python-containers.svg" height="36">
|
|
4
|
+
</sub>
|
|
5
|
+
|
|
6
|
+
containers-py
|
|
7
|
+
</h1>
|
|
8
|
+
<p align="center">
|
|
9
|
+
<sup>
|
|
10
|
+
Cloudflare Containers for Python Workers
|
|
11
|
+
</sup>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
> [!note]
|
|
15
|
+
> This is an unofficial SDK. I worked on a port during my internship at Cloudflare. This SDK is a re-port with improvements in mind from my original port at Cloudflare. Yes, AI was used, but I am actively ensuring the SDK is good and usable.
|
|
16
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "containers-py"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Cloudflare Containers for Python Workers"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"typing-extensions>=4.12",
|
|
9
|
+
"workers-runtime-sdk>=1.9.0",
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
[[project.authors]]
|
|
13
|
+
name = "Viswa Marepalli"
|
|
14
|
+
email = "reachvishm@gmail.com"
|
|
15
|
+
|
|
16
|
+
[build-system]
|
|
17
|
+
requires = ["uv_build>=0.12.19,<0.13.0"]
|
|
18
|
+
build-backend = "uv_build"
|
|
19
|
+
|
|
20
|
+
[[tool.uv.cache-keys]]
|
|
21
|
+
file = "pyproject.toml"
|
|
22
|
+
|
|
23
|
+
[[tool.uv.cache-keys]]
|
|
24
|
+
file = "src/**/*.py"
|
|
25
|
+
|
|
26
|
+
[tool.uv.build-backend]
|
|
27
|
+
module-name = "containers"
|
|
28
|
+
|
|
29
|
+
[tool.pytest.ini_options]
|
|
30
|
+
asyncio_mode = "auto"
|
|
31
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
32
|
+
testpaths = ["tests"]
|
|
33
|
+
pythonpath = ["tests"]
|
|
34
|
+
|
|
35
|
+
[tool.ruff.lint]
|
|
36
|
+
select = [
|
|
37
|
+
"E",
|
|
38
|
+
"F",
|
|
39
|
+
"W",
|
|
40
|
+
"I",
|
|
41
|
+
"UP",
|
|
42
|
+
"B",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[tool.ruff.lint.per-file-ignores]
|
|
46
|
+
"tests/*" = ["E501"]
|
|
47
|
+
|
|
48
|
+
[tool.ty.analysis]
|
|
49
|
+
allowed-unresolved-imports = [
|
|
50
|
+
"js",
|
|
51
|
+
"pyodide.**",
|
|
52
|
+
"_pyodide_entrypoint_helper",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[dependency-groups]
|
|
56
|
+
dev = [
|
|
57
|
+
"pytest>=9.1.1",
|
|
58
|
+
"pytest-asyncio>=1.4.0",
|
|
59
|
+
"ruff>=0.16.9",
|
|
60
|
+
"ty>=0.0.84",
|
|
61
|
+
]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "containers-py"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Cloudflare Containers for Python Workers"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Viswa Marepalli", email = "reachvishm@gmail.com" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.12"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"typing-extensions>=4.12",
|
|
12
|
+
"workers-runtime-sdk>=1.9.0",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
[build-system]
|
|
16
|
+
requires = ["uv_build>=0.12.19,<0.13.0"]
|
|
17
|
+
build-backend = "uv_build"
|
|
18
|
+
|
|
19
|
+
[tool.uv]
|
|
20
|
+
# Rebuild when sources change, so the .smokes/ projects pick up edits
|
|
21
|
+
cache-keys = [{ file = "pyproject.toml" }, { file = "src/**/*.py" }]
|
|
22
|
+
|
|
23
|
+
[tool.uv.build-backend]
|
|
24
|
+
module-name = "containers"
|
|
25
|
+
|
|
26
|
+
[tool.pytest.ini_options]
|
|
27
|
+
asyncio_mode = "auto"
|
|
28
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
29
|
+
testpaths = ["tests"]
|
|
30
|
+
pythonpath = ["tests"]
|
|
31
|
+
|
|
32
|
+
[tool.ruff.lint]
|
|
33
|
+
select = ["E", "F", "W", "I", "UP", "B"]
|
|
34
|
+
|
|
35
|
+
[tool.ruff.lint.per-file-ignores]
|
|
36
|
+
# Test names mirror the TypeScript test names
|
|
37
|
+
"tests/*" = ["E501"]
|
|
38
|
+
|
|
39
|
+
[tool.ty.analysis]
|
|
40
|
+
allowed-unresolved-imports = ["js", "pyodide.**", "_pyodide_entrypoint_helper"]
|
|
41
|
+
|
|
42
|
+
[dependency-groups]
|
|
43
|
+
dev = [
|
|
44
|
+
"pytest>=9.1.1",
|
|
45
|
+
"pytest-asyncio>=1.4.0",
|
|
46
|
+
"ruff>=0.16.9",
|
|
47
|
+
"ty>=0.0.84",
|
|
48
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from .container import (
|
|
2
|
+
Container,
|
|
3
|
+
ContainerProxy,
|
|
4
|
+
OutboundHandler,
|
|
5
|
+
OutboundHandlerContext,
|
|
6
|
+
Schedule,
|
|
7
|
+
Signal,
|
|
8
|
+
)
|
|
9
|
+
from .state import State
|
|
10
|
+
from .utils import (
|
|
11
|
+
DurableObjectNamespace,
|
|
12
|
+
DurableObjectStub,
|
|
13
|
+
get_container,
|
|
14
|
+
get_random,
|
|
15
|
+
switch_port,
|
|
16
|
+
)
|