Skip to content

feat(cli): Add --skip-native-installation option to by pass installing packages in native venv - #251

Draft
ryanking13 wants to merge 1 commit into
mainfrom
gyeongjae/skip-native-install
Draft

ryanking13 wants to merge 1 commit into
mainfrom
gyeongjae/skip-native-install

Conversation

@ryanking13

Copy link
Copy Markdown
Contributor

This adds a new --skip-native-installation flag to pywrangler sync.

When this flag is enabled, pywrangler will install packages only to the Pyodide venv, not in native venv. This is useful in two scenarios.

  1. When there is no pre-compiled wheel for the native environment. (e.g. psycopg-c)

  2. In CI, when users don't need auto completion, type hints etc.

Comment thread packages/cli/README.md
Comment on lines +48 to +54
However, when you are testing your local package that does not include
any native extensions, you can use the `--allow-local` flag to allow installing
it from source distribution.

```
uv run pywrangler sync --allow-local
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documented --allow-local option does not exist; the CLI exposes --allow-build.

Suggested change
However, when you are testing your local package that does not include
any native extensions, you can use the `--allow-local` flag to allow installing
it from source distribution.
```
uv run pywrangler sync --allow-local
```
However, when you are testing a local package that does not include any native
extensions, you can use the `--allow-build` flag to allow installing it from a
source distribution.
```bash
uv run pywrangler sync --allow-build

Comment thread packages/cli/README.md
1. It takes more time to install packages.
2. It may fail if the package is built only for the WASM environment / Worker runtime.

In such cases, you can pass the `--skip-native` flag to skip the native installation, and only install the package for the Worker runtime.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prose names a flag that Click does not register, so this direct instruction fails.

Suggested change
In such cases, you can pass the `--skip-native` flag to skip the native installation, and only install the package for the Worker runtime.
In such cases, you can pass the `--skip-native-installation` flag to skip the native installation, and only install the package for the Worker runtime.

@ask-bonk

ask-bonk Bot commented Sep 10, 2026

Copy link
Copy Markdown

I'm Bonk, and I've done a quick review of your PR.

Adds an option to skip native virtual-environment package installation during sync.

  1. Low: README.md documents a nonexistent --allow-local option. Inline suggestion posted.
  2. Low: README.md refers to a nonexistent --skip-native option. Inline suggestion posted.

github run

@dom96 dom96 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine, though I wonder if having these two separate modes is the best way to solve this. The problem to me seems that your project would only have 1 or 2 such packages, so disabling native installation for the full project would affect your other packages too. Could we get pywrangler to intelligently know that a package cannot be installed natively and so skip the installation for only that package?

@ryanking13

Copy link
Copy Markdown
Contributor Author

Could we get pywrangler to intelligently know that a package cannot be installed natively and so skip the installation for only that package?

I think that is possible.


But actually, it turned out that pyscopg does not need this patch (I was building the wrong package), so let me mark this as draft until we find out the actual use case of this flag.

@ryanking13
ryanking13 marked this pull request as draft September 14, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants