astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
12.08k stars 425 forks source link

Fails to install offline #1126

Open SealedServant opened 4 weeks ago

SealedServant commented 4 weeks ago

Steps to Reproduce

  1. Run rye-x86_64-windows.exe offline

Expected Result

  1. Expected all dependencies/toolchains to be bundled and installed without internet
  2. Additionally, expected installer to work without interaction -- this would be necessary in CI/CD pipelines and for automation

Actual Result

C:\Users\xxx\Downloads>set RYE_HOME=C:\rye

C:\Users\xxx\Downloads>rye-x86_64-windows.exe
Welcome to Rye!

Rye has detected that it's not installed on this computer yet and
automatically started the installer for you. For more information
read https://rye-up.com/guide/installation/

This installer will install rye to C:\rye
This path can be changed by exporting the RYE_HOME environment variable.

Details:
  Rye Version: 0.34.0
  Platform: windows (x86_64)

warning: your Windows configuration does not support symlinks.

It's strongly recommended that you enable developer mode in Windows to
enable symlinks. You need to enable this before continuing the setup.
Learn more at https://rye-up.com/guide/faq/#windows-developer-mode

✔ Continue? · yes
✔ Select the preferred package installer · uv (fast, recommended)
✔ What should running `python` or `python3` do when you are not inside a Rye managed project? · Run a Python installed and managed by Rye
✔ Which version of Python should be used as default toolchain? · cpython@3.12
Installed binary to C:\rye\shims\rye.exe
Bootstrapping rye internals
error: download of https://github.com/astral-sh/uv/releases/download/0.1.44/uv-x86_64-pc-windows-msvc.zip failed

Caused by:
    [6] Couldn't resolve host name (Could not resolve host: github.com)
Press any key to continue

With internet, additional steps also fail behind corporate proxy:

error: error sending request for url (https://pypi.org/simple/pip/)
  Caused by: client error (Connect)
  Caused by: invalid peer certificate: UnknownIssuer
error: error sending request for url (https://pypi.org/simple/urllib3/)
  Caused by: client error (Connect)
  Caused by: invalid peer certificate: UnknownIssuer

I would suggest that rye attempt to read global.cert and global.index-url in pip.ini located in C:\Users\xxx\AppData\Roaming\pip\pip.ini, or allow user to set these in an env variable for the installer. But as previously mentioned, bundling the dependencies to fallback to in absence of internet would be ideal.

Version Info

0.34.0

Stacktrace

N/A

chrisrodrigue commented 3 weeks ago

Possible implementation method: dependencies could be base85 encoded inside the installer (similar to this get-pip.py bootstrapping script).

Zander-1024 commented 3 weeks ago

https://github.com/astral-sh/rye/blob/main/docs/guide/config.md#config-file look this