workers-py 1.1.4__py3-none-any.whl → 1.1.6__py3-none-any.whl
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.
- pywrangler/cli.py +6 -5
- pywrangler/sync.py +22 -3
- {workers_py-1.1.4.dist-info → workers_py-1.1.6.dist-info}/METADATA +1 -1
- workers_py-1.1.6.dist-info/RECORD +9 -0
- workers_py-1.1.4.dist-info/RECORD +0 -9
- {workers_py-1.1.4.dist-info → workers_py-1.1.6.dist-info}/WHEEL +0 -0
- {workers_py-1.1.4.dist-info → workers_py-1.1.6.dist-info}/entry_points.txt +0 -0
pywrangler/cli.py
CHANGED
|
@@ -55,7 +55,7 @@ class ProxyToWranglerGroup(click.Group):
|
|
|
55
55
|
remaining_args = []
|
|
56
56
|
|
|
57
57
|
if cmd_name in ["dev", "publish", "deploy", "versions"]:
|
|
58
|
-
ctx.invoke(sync_command, force=False)
|
|
58
|
+
ctx.invoke(sync_command, force=False, directly_requested=False)
|
|
59
59
|
|
|
60
60
|
_proxy_to_wrangler(cmd_name, remaining_args)
|
|
61
61
|
sys.exit(0)
|
|
@@ -92,7 +92,7 @@ def app(ctx, debug=False):
|
|
|
92
92
|
|
|
93
93
|
@app.command("sync")
|
|
94
94
|
@click.option("--force", is_flag=True, help="Force sync even if no changes detected")
|
|
95
|
-
def sync_command(force=False):
|
|
95
|
+
def sync_command(force=False, directly_requested=True):
|
|
96
96
|
"""
|
|
97
97
|
Installs Python packages from pyproject.toml into src/vendor.
|
|
98
98
|
|
|
@@ -116,9 +116,10 @@ def sync_command(force=False):
|
|
|
116
116
|
# Check if sync is needed based on file timestamps
|
|
117
117
|
sync_needed = force or is_sync_needed()
|
|
118
118
|
if not sync_needed:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
if directly_requested:
|
|
120
|
+
logger.warning(
|
|
121
|
+
"pyproject.toml hasn't changed since last sync, use --force to ignore timestamp check"
|
|
122
|
+
)
|
|
122
123
|
return
|
|
123
124
|
|
|
124
125
|
# Check to make sure a wrangler config file exists.
|
pywrangler/sync.py
CHANGED
|
@@ -55,6 +55,10 @@ def check_wrangler_config():
|
|
|
55
55
|
raise click.exceptions.Exit(code=1)
|
|
56
56
|
|
|
57
57
|
|
|
58
|
+
def _get_python_version():
|
|
59
|
+
return os.environ.get("_PYWRANGLER_PYTHON_VERSION", "3.12")
|
|
60
|
+
|
|
61
|
+
|
|
58
62
|
def create_workers_venv():
|
|
59
63
|
"""
|
|
60
64
|
Creates a virtual environment at `VENV_WORKERS_PATH` if it doesn't exist.
|
|
@@ -64,8 +68,10 @@ def create_workers_venv():
|
|
|
64
68
|
return
|
|
65
69
|
|
|
66
70
|
logger.debug(f"Creating virtual environment at {VENV_WORKERS_PATH}...")
|
|
67
|
-
|
|
68
|
-
run_command(
|
|
71
|
+
python_version = _get_python_version()
|
|
72
|
+
run_command(
|
|
73
|
+
["uv", "venv", str(VENV_WORKERS_PATH), "--python", f"python{python_version}"]
|
|
74
|
+
)
|
|
69
75
|
|
|
70
76
|
|
|
71
77
|
def _get_pyodide_cli_path():
|
|
@@ -99,7 +105,14 @@ def install_pyodide_build():
|
|
|
99
105
|
run_command(["uv", "pip", "install", "-p", str(venv_python_executable), "pip"])
|
|
100
106
|
|
|
101
107
|
run_command(
|
|
102
|
-
[
|
|
108
|
+
[
|
|
109
|
+
"uv",
|
|
110
|
+
"pip",
|
|
111
|
+
"install",
|
|
112
|
+
"-p",
|
|
113
|
+
str(venv_python_executable),
|
|
114
|
+
"pyodide-build==0.30.7",
|
|
115
|
+
]
|
|
103
116
|
)
|
|
104
117
|
|
|
105
118
|
|
|
@@ -111,6 +124,12 @@ def create_pyodide_venv():
|
|
|
111
124
|
)
|
|
112
125
|
return
|
|
113
126
|
|
|
127
|
+
# Workaround to fix caching issue on some machines.
|
|
128
|
+
#
|
|
129
|
+
# Fix is here: pyodide/pyodide-build#239
|
|
130
|
+
logger.debug("Installing xbuildenv...")
|
|
131
|
+
run_command([str(pyodide_cli_path), "xbuildenv", "install"])
|
|
132
|
+
|
|
114
133
|
logger.debug(f"Creating Pyodide virtual environment at {PYODIDE_VENV_PATH}...")
|
|
115
134
|
PYODIDE_VENV_PATH.parent.mkdir(parents=True, exist_ok=True)
|
|
116
135
|
run_command([str(pyodide_cli_path), "venv", str(PYODIDE_VENV_PATH)])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: workers-py
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.6
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
pywrangler/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
2
|
+
pywrangler/__main__.py,sha256=BnrUM7YiBmlM4HAn2MI9hP1kVNtzeK_kEgQhRy5HTq0,38
|
|
3
|
+
pywrangler/cli.py,sha256=BnGGrdksWP-qBj-b0ipji-61Q0kZJohyr2KZZz-XG5s,5150
|
|
4
|
+
pywrangler/sync.py,sha256=80pPCz-DTTAk5xTQ0j4ufrh3wv1nQ8y_-zpdPkaLVfw,9740
|
|
5
|
+
pywrangler/utils.py,sha256=6mR3kst-Y0w1DMQc5LQ2M9xiNWcVezctTKIWXKQXMJ8,2781
|
|
6
|
+
workers_py-1.1.6.dist-info/METADATA,sha256=rI1Ka0dZmdZPfLyanLGulrUewvzy0wnWeUZi9sMdMCI,1750
|
|
7
|
+
workers_py-1.1.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
+
workers_py-1.1.6.dist-info/entry_points.txt,sha256=pt6X-Nv5-gSiKUwrnvLwzlSXs9yP37m7zdTAi8f6nAM,50
|
|
9
|
+
workers_py-1.1.6.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
pywrangler/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
2
|
-
pywrangler/__main__.py,sha256=BnrUM7YiBmlM4HAn2MI9hP1kVNtzeK_kEgQhRy5HTq0,38
|
|
3
|
-
pywrangler/cli.py,sha256=twJZRqXR0jmueeCEPa1R6tTXnRf5xoKEI2NEFQBy4j4,5056
|
|
4
|
-
pywrangler/sync.py,sha256=PIoahRYJkSSIOcK5slLCyRuaOt6dCT6HZ03aA9PJjI0,9335
|
|
5
|
-
pywrangler/utils.py,sha256=6mR3kst-Y0w1DMQc5LQ2M9xiNWcVezctTKIWXKQXMJ8,2781
|
|
6
|
-
workers_py-1.1.4.dist-info/METADATA,sha256=asMfnUo0bli83D23qM6vCyYeCqRE4UUuNTWHDlPtObQ,1750
|
|
7
|
-
workers_py-1.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
-
workers_py-1.1.4.dist-info/entry_points.txt,sha256=pt6X-Nv5-gSiKUwrnvLwzlSXs9yP37m7zdTAi8f6nAM,50
|
|
9
|
-
workers_py-1.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|