From a57dd4bdda03bf915ddb29b94635b63ffa4ac6b8 Mon Sep 17 00:00:00 2001 From: Takahiro Kinoshita Date: Sun, 14 Jul 2024 01:43:49 +0900 Subject: [PATCH 1/4] fix verify-ssl option parsing problem (#1208) https://github.com/astral-sh/rye/blob/main/docs/guide/sources.md?plain=1#L131 The documentation refers to verify-ssl to avoid ssl verification, but during parsing, it refers to verify_ssl. This PR will allow the installation of packages from non-SSL PyPI repositories. If the documentation needs to be corrected instead of the source code, please let me know, and I will commit the changes. --- rye/src/pyproject.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index 1f0f527114..ad194b7ba9 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -160,6 +160,7 @@ impl SourceRef { .ok_or_else(|| anyhow!("expected source.url"))?; let verify_ssl = source .get("verify_ssl") + .or_else(|| source.get("verify-ssl")) .and_then(|x| x.as_bool()) .unwrap_or(true); let username = source From d3a8440c37c8758c98ac6545392dfbcefcf1df59 Mon Sep 17 00:00:00 2001 From: Michael Yochpaz <8832013+MichaelYochpaz@users.noreply.github.com> Date: Sat, 13 Jul 2024 19:45:27 +0300 Subject: [PATCH 2/4] Update Docs Description for Download Options (#1201) Was just downloading Rye to try it out and got a bit annoyed by the confusing download links (like `x64 Intel Windows` - I have an AMD CPU, and it obviously doesn't matter), so I updated them to more standard terms, although there are several options to update them to, so feel free to ask for / make changes). I also think it might be a good idea to consider dropping the Windows x86 (32-bit) builds, as Windows 11 doesn't even support x86, and Windows 10 EOL is next year (plus, I doubt there are many Windows 10 users using the 32-bit version. Especially developers), and it just confuses newcomers with an additional option to pick from. --- README.md | 2 +- docs/.includes/quick-install.md | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 82d1df2455..b38b6d8ef8 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ The installation takes just a minute: * **Windows:** - Download and run the installer ([64bit Intel](https://github.com/astral-sh/rye/releases/latest/download/rye-x86_64-windows.exe) or [32bit Intel](https://github.com/astral-sh/rye/releases/latest/download/rye-x86-windows.exe)). + Download and run the installer ([64-bit (x86-64)](https://github.com/astral-sh/rye/releases/latest/download/rye-x86_64-windows.exe) or [32-bit (x86)](https://github.com/astral-sh/rye/releases/latest/download/rye-x86-windows.exe)). For more details and other options, refer to the [installation instructions](https://rye.astral.sh/guide/installation/). diff --git a/docs/.includes/quick-install.md b/docs/.includes/quick-install.md index 2f20ddb166..383c9116b6 100644 --- a/docs/.includes/quick-install.md +++ b/docs/.includes/quick-install.md @@ -10,8 +10,8 @@ Alternatively if you don't trust this approach, you can download the latest release binary. On first run it will install itself. - * [rye-x86_64-linux.gz](https://github.com/astral-sh/rye/releases/latest/download/rye-x86_64-linux.gz) for 64bit Intel computers - * [rye-aarch64-linux.gz](https://github.com/astral-sh/rye/releases/latest/download/rye-aarch64-linux.gz) for 64bit ARM computers + * [rye-x86_64-linux.gz](https://github.com/astral-sh/rye/releases/latest/download/rye-x86_64-linux.gz) Intel/AMD (x86-64). + * [rye-aarch64-linux.gz](https://github.com/astral-sh/rye/releases/latest/download/rye-aarch64-linux.gz) for ARM64. ```bash gunzip rye-x86_64-linux.gz @@ -31,8 +31,8 @@ Alternatively if you don't trust this approach, you can download the latest release binary. On first run it will install itself. - * [rye-aarch64-macos.gz](https://github.com/astral-sh/rye/releases/latest/download/rye-aarch64-macos.gz) for M1/M2 Macs - * [rye-x86_64-macos.gz](https://github.com/astral-sh/rye/releases/latest/download/rye-x86_64-macos.gz) for Intel Macs + * [rye-aarch64-macos.gz](https://github.com/astral-sh/rye/releases/latest/download/rye-aarch64-macos.gz) for Apple Silicon (M1/M2/M3) (ARM64). + * [rye-x86_64-macos.gz](https://github.com/astral-sh/rye/releases/latest/download/rye-x86_64-macos.gz) for Intel processors (x86-64). ```bash gunzip rye-aarch64-macos.gz @@ -47,8 +47,8 @@ to have "Developer Mode" activated when using Rye and before starting the installation. [Learn more](../guide/faq.md). - * [rye-x86_64-windows.exe](https://github.com/astral-sh/rye/releases/latest/download/rye-x86_64-windows.exe) for 64bit Intel Windows - * [rye-x86-windows.exe](https://github.com/astral-sh/rye/releases/latest/download/rye-x86-windows.exe) for 32bit Intel Windows + * [rye-x86_64-windows.exe](https://github.com/astral-sh/rye/releases/latest/download/rye-x86_64-windows.exe) for 64-bit (x86-64). + * [rye-x86-windows.exe](https://github.com/astral-sh/rye/releases/latest/download/rye-x86-windows.exe) for 32-bit (x86). !!!Note From f742c958acbd5cff425f1e483d586dd72006ad91 Mon Sep 17 00:00:00 2001 From: nazq Date: Sat, 13 Jul 2024 19:09:35 -0400 Subject: [PATCH 3/4] Emit warning when asked to build a virtual proj (#1227) --- rye/src/cli/build.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rye/src/cli/build.rs b/rye/src/cli/build.rs index 6e94f76e25..324f76b201 100644 --- a/rye/src/cli/build.rs +++ b/rye/src/cli/build.rs @@ -66,6 +66,11 @@ pub fn execute(cmd: Args) -> Result<(), Error> { let use_uv = Config::current().use_uv(); let projects = locate_projects(project, cmd.all, &cmd.package[..])?; + let all_virtual = projects.iter().all(|p| p.is_virtual()); + if all_virtual { + warn!("skipping build, all projects are virtual"); + return Ok(()); + } for project in projects { // skip over virtual packages on build if project.is_virtual() { @@ -118,6 +123,5 @@ pub fn execute(cmd: Args) -> Result<(), Error> { bail!("failed to build dist"); } } - Ok(()) } From 93e4cb854ab44acd9639c66970e4d36b55231973 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 14 Jul 2024 01:42:17 +0000 Subject: [PATCH 4/4] Update `uv` to `v0.2.24` (#1205) --- rye/src/sources/generated/uv_downloads.inc | 14 +++++++------- rye/tests/test_tools.rs | 9 +++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/rye/src/sources/generated/uv_downloads.inc b/rye/src/sources/generated/uv_downloads.inc index e8b346c544..c81544c867 100644 --- a/rye/src/sources/generated/uv_downloads.inc +++ b/rye/src/sources/generated/uv_downloads.inc @@ -2,11 +2,11 @@ // To regenerate, run `rye run uv-downloads > rye/src/sources/generated/uv_downloads.inc` from the root of the repository. use std::borrow::Cow; pub const UV_DOWNLOADS: &[UvDownload] = &[ - UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 22, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.22/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("ed44fcb929f8cef958ed9e6de350d542f7392a43331d3605c4fcbf418e204c5c") }, - UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 22, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.22/uv-aarch64-unknown-linux-musl.tar.gz"), sha256: Cow::Borrowed("1855c439577523fd2a3e1afb19712fd80eb59d63c92fa29d24afb7f68c8ba88c") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 22, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.22/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("aa5b36bdc88a16c92d5ca93c4a9325bb82eb875507d363ec28cb6e5ee694e8ed") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 22, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.22/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("00002ada635ce3f17a97a4eca7361eb6ac065db342540dc31e743920a723b92f") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 22, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.22/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("cb03b461250b688e39b19feaa0853d842e5d4193e262c9d4db2d15faafc54dcc") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 22, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.22/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("6ab3ed27e38e3a2c4a3a4880b87b8d607fa14589860aebbb1a34064d792d54ad") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 22, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.22/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("65cd2e2c3660779f8a1fb02eac488b540d1ae30f3a80a381f8a7859d0b76bf06") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 24, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.24/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("49d55dd8a8f2adfb83d1feaee5bf40c20169b411e3809e3455ff0d96bae4f388") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 24, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.24/uv-aarch64-unknown-linux-musl.tar.gz"), sha256: Cow::Borrowed("56bd0db80905d0f5eeba51aa33872727aa40e3dda65c86a584c095ac05609509") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 24, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.24/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("3995fbf5a09bcdfc54824ccd0969a975844d586a5fe5dc689f0b8d36eec6e5e6") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 24, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.24/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("dfb662a3dbb7bd1d5da4dbb20805484d8ba7e9d8cc1f6884e737ffdb3106cba2") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 24, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.24/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("dbb918c9d55b99cfe1c995cc330b6b1dac29379e320c35a84e7bc6bc0e0a55f4") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 24, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.24/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("a044e2cbdfaaea36d15a7c8091d12e2ae81784329116fdf967a573b792fc1fd5") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 24, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.24/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("24a0c6758a4f533c37193592fd0a9a37a61fb583a4b6abd0bb81b83127d86336") }, ]; diff --git a/rye/tests/test_tools.rs b/rye/tests/test_tools.rs index 73a2959d8e..9c0f409ee9 100644 --- a/rye/tests/test_tools.rs +++ b/rye/tests/test_tools.rs @@ -1,5 +1,6 @@ use std::env::consts::EXE_EXTENSION; use std::fs; +use tempfile::TempDir; use crate::common::{rye_cmd_snapshot, Space}; @@ -9,6 +10,9 @@ mod common; fn test_basic_tool_behavior() { let space = Space::new(); + // Cache alongside the home directory, so that the cache lives alongside the tools directory. + let cache_dir = TempDir::new_in(space.rye_home()).unwrap(); + // in case we left things behind from last run. fs::remove_dir_all(space.rye_home().join("tools")).ok(); fs::remove_file( @@ -22,6 +26,7 @@ fn test_basic_tool_behavior() { rye_cmd_snapshot!( space.rye_cmd() + .env("UV_CACHE_DIR", cache_dir.path()) .arg("tools") .arg("install") .arg("pycowsay") @@ -43,6 +48,7 @@ fn test_basic_tool_behavior() { rye_cmd_snapshot!( space.rye_cmd() + .env("UV_CACHE_DIR", cache_dir.path()) .arg("tools") .arg("list"), @r###" success: true @@ -55,6 +61,7 @@ fn test_basic_tool_behavior() { rye_cmd_snapshot!( space.rye_cmd() + .env("UV_CACHE_DIR", cache_dir.path()) .arg("tools") .arg("list") .arg("--include-version"), @r###" @@ -68,6 +75,7 @@ fn test_basic_tool_behavior() { rye_cmd_snapshot!( space.rye_cmd() + .env("UV_CACHE_DIR", cache_dir.path()) .arg("toolchain") .arg("remove") .arg("cpython@3.11.9"), @r###" @@ -81,6 +89,7 @@ fn test_basic_tool_behavior() { rye_cmd_snapshot!( space.rye_cmd() + .env("UV_CACHE_DIR", cache_dir.path()) .arg("tools") .arg("uninstall") .arg("pycowsay"), @r###"