Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow offline mode via environment variable #1784

Closed
theCapypara opened this issue Sep 30, 2023 · 4 comments
Closed

Allow offline mode via environment variable #1784

theCapypara opened this issue Sep 30, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@theCapypara
Copy link

Hello! I'm trying to publish an app using Flatpak. Flatpak works with completely offline builds where all artifacts are pre-fetched and no internet connection is available in the build environment,

At the moment (as far as I can tell) maturin only supports offline mode via the maturin CLI. This is very tedious to setup in such a build environment, and there seems to be no way to pass this flag using normal pip or other packaging tool installations. As such I'm currently forced to write rather complicated workarounds to install maturin and run it for every module that requires it.

It would be great if offline mode could be enforced using an environment variable, ideally one shared with Setuptools Rust, see this issue:
PyO3/setuptools-rust#363

@messense
Copy link
Member

You can use pip install --config-settings build-args='--offline'.

@theCapypara
Copy link
Author

Thanks, is this documented anywhere? I went through the documentation and found nothing of the sorts.

@messense
Copy link
Member

No, pull requests are welcome to document it.

See also #1619.

@theCapypara
Copy link
Author

theCapypara commented Sep 30, 2023

Thank you. For reference, the following command works in a Flatpak:

. /usr/lib/sdk/rust-stable/enable.sh && cp /app/whl_tmp/tomli-2.0.1-*.whl . && cp /app/whl_tmp/maturin-1.2.3-cp310-cp310-*.whl . && pip3 wheel --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --config-settings build-args='--offline' \"./rpds_py\" -w /app/whl_tmp```

It must be noted that Maturin and tomli must be pre-built in a preceding module, because maturin itself currently needs to be patched due to PyO3/setuptools-rust#363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants