workers-py 1.5.1__tar.gz → 1.6.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 (26) hide show
  1. workers_py-1.6.0/.gitattributes +1 -0
  2. {workers_py-1.5.1 → workers_py-1.6.0}/CHANGELOG.md +8 -0
  3. {workers_py-1.5.1 → workers_py-1.6.0}/PKG-INFO +4 -9
  4. {workers_py-1.5.1 → workers_py-1.6.0}/README.md +3 -8
  5. {workers_py-1.5.1 → workers_py-1.6.0}/pyproject.toml +1 -1
  6. {workers_py-1.5.1 → workers_py-1.6.0}/src/pywrangler/cli.py +26 -1
  7. {workers_py-1.5.1 → workers_py-1.6.0}/src/pywrangler/utils.py +1 -0
  8. {workers_py-1.5.1 → workers_py-1.6.0}/uv.lock +1 -1
  9. {workers_py-1.5.1 → workers_py-1.6.0}/.github/workflows/commitlint.yml +0 -0
  10. {workers_py-1.5.1 → workers_py-1.6.0}/.github/workflows/lint.yml +0 -0
  11. {workers_py-1.5.1 → workers_py-1.6.0}/.github/workflows/release.yml +0 -0
  12. {workers_py-1.5.1 → workers_py-1.6.0}/.github/workflows/tests.yml +0 -0
  13. {workers_py-1.5.1 → workers_py-1.6.0}/.gitignore +0 -0
  14. {workers_py-1.5.1 → workers_py-1.6.0}/.pre-commit-config.yaml +0 -0
  15. {workers_py-1.5.1 → workers_py-1.6.0}/CLAUDE.md +0 -0
  16. {workers_py-1.5.1 → workers_py-1.6.0}/CONTRIBUTING.md +0 -0
  17. {workers_py-1.5.1 → workers_py-1.6.0}/src/pywrangler/__init__.py +0 -0
  18. {workers_py-1.5.1 → workers_py-1.6.0}/src/pywrangler/__main__.py +0 -0
  19. {workers_py-1.5.1 → workers_py-1.6.0}/src/pywrangler/metadata.py +0 -0
  20. {workers_py-1.5.1 → workers_py-1.6.0}/src/pywrangler/sync.py +0 -0
  21. {workers_py-1.5.1 → workers_py-1.6.0}/src/pywrangler/types.py +0 -0
  22. {workers_py-1.5.1 → workers_py-1.6.0}/tests/__init__.py +0 -0
  23. {workers_py-1.5.1 → workers_py-1.6.0}/tests/test_cli.py +0 -0
  24. {workers_py-1.5.1 → workers_py-1.6.0}/tests/test_py_version_detect.py +0 -0
  25. {workers_py-1.5.1 → workers_py-1.6.0}/tests/test_types.py +0 -0
  26. {workers_py-1.5.1 → workers_py-1.6.0}/workers.py +0 -0
@@ -0,0 +1 @@
1
+ uv.lock binary
@@ -2,6 +2,14 @@
2
2
 
3
3
  <!-- version list -->
4
4
 
5
+ ## v1.6.0 (2025-10-15)
6
+
7
+ ### Features
8
+
9
+ - Pywrangler init proxies to C3 directly with Python preselected
10
+ ([`8ec7724`](https://github.com/cloudflare/workers-py/commit/8ec7724c4768314cf5a6a4434cb0c33b95d3611f))
11
+
12
+
5
13
  ## v1.5.1 (2025-10-13)
6
14
 
7
15
  ### Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: workers-py
3
- Version: 1.5.1
3
+ Version: 1.6.0
4
4
  Summary: A set of libraries and tools for Python 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
@@ -52,19 +52,14 @@ uv run pywrangler sync
52
52
 
53
53
  ### Development
54
54
 
55
- To run the CLI tool while developing it, use:
56
-
57
- ```bash
58
- export REPO_ROOT=/path/to/repo
59
- uv run --project $REPO_ROOT $REPO_ROOT/src/pywrangler --help
60
- ```
61
-
62
- On Linux, to install it globally, you may also be able to run:
55
+ To run the CLI tool while developing it, install it globally:
63
56
 
64
57
  ```
65
58
  uv tool install -e .
66
59
  ```
67
60
 
61
+ Then run it via `pywrangler`.
62
+
68
63
  Alternatively, you can add `workers-py` to your pyproject.toml:
69
64
 
70
65
  ```
@@ -33,19 +33,14 @@ uv run pywrangler sync
33
33
 
34
34
  ### Development
35
35
 
36
- To run the CLI tool while developing it, use:
37
-
38
- ```bash
39
- export REPO_ROOT=/path/to/repo
40
- uv run --project $REPO_ROOT $REPO_ROOT/src/pywrangler --help
41
- ```
42
-
43
- On Linux, to install it globally, you may also be able to run:
36
+ To run the CLI tool while developing it, install it globally:
44
37
 
45
38
  ```
46
39
  uv tool install -e .
47
40
  ```
48
41
 
42
+ Then run it via `pywrangler`.
43
+
49
44
  Alternatively, you can add `workers-py` to your pyproject.toml:
50
45
 
51
46
  ```
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "workers-py"
7
- version = "1.5.1"
7
+ version = "1.6.0"
8
8
  description = "A set of libraries and tools for Python Workers"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -4,7 +4,12 @@ import sys
4
4
  import textwrap
5
5
  import click
6
6
 
7
- from .utils import setup_logging, write_success, WRANGLER_COMMAND
7
+ from .utils import (
8
+ setup_logging,
9
+ write_success,
10
+ WRANGLER_COMMAND,
11
+ WRANGLER_CREATE_COMMAND,
12
+ )
8
13
 
9
14
  setup_logging()
10
15
  logger = logging.getLogger("pywrangler")
@@ -60,6 +65,13 @@ class ProxyToWranglerGroup(click.Group):
60
65
 
61
66
  check_wrangler_version()
62
67
 
68
+ if cmd_name == "init":
69
+ # explicitly call `create-cloudflare` so we can instruct it to only show Python templates
70
+ _proxy_to_create_cloudflare(
71
+ ["--lang=python", "--no-deploy"] + remaining_args
72
+ )
73
+ sys.exit(0)
74
+
63
75
  _proxy_to_wrangler(cmd_name, remaining_args)
64
76
  sys.exit(0)
65
77
 
@@ -175,3 +187,16 @@ def _proxy_to_wrangler(command_name, args_list):
175
187
  f"Wrangler not found. Ensure Node.js and Wrangler are installed and in your PATH. Error was: {str(e)}"
176
188
  )
177
189
  click.get_current_context().exit(1)
190
+
191
+
192
+ def _proxy_to_create_cloudflare(args_list):
193
+ command_to_run = WRANGLER_CREATE_COMMAND + args_list
194
+ logger.info(f"Passing command to npx create-cloudflare: {' '.join(command_to_run)}")
195
+ try:
196
+ process = subprocess.run(command_to_run, check=False, cwd=".")
197
+ click.get_current_context().exit(process.returncode)
198
+ except FileNotFoundError as e:
199
+ logger.error(
200
+ f"Create-cloudflare not found. Ensure Node.js and create-cloudflare are installed and in your PATH. Error was: {str(e)}"
201
+ )
202
+ click.get_current_context().exit(1)
@@ -7,6 +7,7 @@ from rich.logging import Console, RichHandler
7
7
  from rich.theme import Theme
8
8
 
9
9
  WRANGLER_COMMAND = ["npx", "--yes", "wrangler"]
10
+ WRANGLER_CREATE_COMMAND = ["npx", "--yes", "create-cloudflare"]
10
11
 
11
12
  logger = logging.getLogger(__name__)
12
13
 
@@ -689,7 +689,7 @@ wheels = [
689
689
 
690
690
  [[package]]
691
691
  name = "workers-py"
692
- version = "1.5.1"
692
+ version = "1.6.0"
693
693
  source = { editable = "." }
694
694
  dependencies = [
695
695
  { name = "click", version = "8.1.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes