workers-runtime-sdk 1.1.5__tar.gz → 1.2.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.
@@ -0,0 +1,23 @@
1
+ # packages/runtime-sdk
2
+
3
+ ## Overview
4
+
5
+ `workers-runtime-sdk` is a Python package that provides utilities for running Python code in a Cloudflare Worker environment.
6
+
7
+ ## Features
8
+
9
+ This package provides utilities for:
10
+
11
+ - Pythonic wrappers for Cloudflare Worker APIs
12
+ - A simple ASGI server for running Python web applications in Cloudflare Workers
13
+
14
+ ## Development Guidelines
15
+
16
+ - `_pyodide_entrypoint_helper` and `_cloudflare_compat_flags` are internal values that are imported from `workerd`.
17
+ - `workerd` (https://github.com/cloudflare/workerd) is the runtime that Cloudflare Workers use to run Python code.
18
+ - When using a feature from `workerd`, always check if we can implement it in this package instead to avoid tight coupling with the runtime.
19
+
20
+ ## Testing
21
+
22
+ - All the tests should be done inside `workerd`, not in the host environment.
23
+ - Tests should be implemented in `../cli/tests` directory.
@@ -2,6 +2,22 @@
2
2
 
3
3
  <!-- version list -->
4
4
 
5
+ ## v1.2.0 (2026-06-12)
6
+
7
+ ### Features
8
+
9
+ - Implements cf accessor on Request
10
+ ([`5777f80`](https://github.com/cloudflare/workers-py/commit/5777f80ead8d9a3c452fe3b6b8f2dc041d6c80d3))
11
+
12
+
13
+ ## v1.1.6 (2026-05-28)
14
+
15
+ ### Bug Fixes
16
+
17
+ - Include asgi.py in the wheel ([#110](https://github.com/cloudflare/workers-py/pull/110),
18
+ [`cab6fab`](https://github.com/cloudflare/workers-py/commit/cab6fab48e63b05ac6d9b230c69657bde97eb0b8))
19
+
20
+
5
21
  ## v1.1.5 (2026-05-19)
6
22
 
7
23
  ### Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: workers-runtime-sdk
3
- Version: 1.1.5
3
+ Version: 1.2.0
4
4
  Summary: Python SDK for Cloudflare Workers
5
5
  Project-URL: Homepage, https://github.com/cloudflare/workers-py
6
6
  Project-URL: Bug Tracker, https://github.com/cloudflare/workers-py/issues
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "workers-runtime-sdk"
7
- version = "1.1.5"
7
+ version = "1.2.0"
8
8
  description = "Python SDK for Cloudflare Workers"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -68,7 +68,7 @@ warn_unreachable = true
68
68
  no_implicit_optional = true
69
69
 
70
70
  [tool.hatch.build.targets.wheel]
71
- include = ["src/_*.py", "src/_*.pyi", "src/_*.pth", "src/workers"]
71
+ include = ["src/*.py", "src/_*.pyi", "src/_*.pth", "src/workers"]
72
72
 
73
73
  [tool.hatch.build.targets.wheel.sources]
74
74
  "src" = ""
@@ -769,6 +769,20 @@ class Request:
769
769
  def body_used(self) -> bool:
770
770
  return self.js_object.bodyUsed
771
771
 
772
+ @property
773
+ def cf(self) -> "JsProxy | None":
774
+ """
775
+ Cloudflare-specific properties about the incoming request
776
+ (IncomingRequestCfProperties). Access fields via attribute
777
+ notation, for example ``request.cf.colo``.
778
+
779
+ Returns None when not present (for example, in the dashboard/playground
780
+ preview or for requests constructed without a ``cf`` value).
781
+
782
+ See https://developers.cloudflare.com/workers/runtime-apis/request/#incomingrequestcfproperties
783
+ """
784
+ return _jsnull_to_none(self.js_object.cf)
785
+
772
786
  @property
773
787
  def cache(self) -> str:
774
788
  return self.js_object.cache