From f590ff1cf62a9bbb6f69bc156590b41b7a674d8b Mon Sep 17 00:00:00 2001 From: my1e5 <10064103+my1e5@users.noreply.github.com> Date: Sun, 12 May 2024 13:23:19 +0100 Subject: [PATCH 01/49] Fix some spellings (#1068) Similar to https://github.com/astral-sh/rye/pull/165 and https://github.com/astral-sh/rye/pull/167, there are some more instances of synched/synching which should be changed to synced/syncing to make the docs consistent. --- docs/guide/commands/lock.md | 2 +- docs/guide/commands/sync.md | 2 +- docs/guide/virtual.md | 4 ++-- rye/src/cli/shim.rs | 2 +- rye/src/cli/show.rs | 2 +- rye/src/cli/sync.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/guide/commands/lock.md b/docs/guide/commands/lock.md index 374e0744b6..7fe3506541 100644 --- a/docs/guide/commands/lock.md +++ b/docs/guide/commands/lock.md @@ -3,7 +3,7 @@ Updates the lockfiles without installing dependencies. Usually one would use the [`sync`](sync.md) command instead which both locks and installs dependencies. -For more information see [Synching and Locking](../sync.md). +For more information see [Syncing and Locking](../sync.md). ## Example diff --git a/docs/guide/commands/sync.md b/docs/guide/commands/sync.md index f1306264cb..2a1ad45921 100644 --- a/docs/guide/commands/sync.md +++ b/docs/guide/commands/sync.md @@ -2,7 +2,7 @@ Updates the lockfiles and installs the dependencies into the virtualenv. -For more information see [Synching and Locking](../sync.md). +For more information see [Syncing and Locking](../sync.md). ## Example diff --git a/docs/guide/virtual.md b/docs/guide/virtual.md index ee0533db13..133ae885c9 100644 --- a/docs/guide/virtual.md +++ b/docs/guide/virtual.md @@ -18,11 +18,11 @@ rye run mkdocs ``` This will create a `pyproject.toml` but does not actually declare any python code itself. -Yet when synching you will end up with mkdocs in your project. +Yet when syncing you will end up with mkdocs in your project. ## Behavior Changes -When synching the project itself is never installed into the virtualenv as it's not +When syncing the project itself is never installed into the virtualenv as it's not considered to be a valid package. Likewise you cannot publish virtual packages to PyPI or another index. diff --git a/rye/src/cli/shim.rs b/rye/src/cli/shim.rs index 2592372b17..68ec8370a1 100644 --- a/rye/src/cli/shim.rs +++ b/rye/src/cli/shim.rs @@ -187,7 +187,7 @@ fn get_shim_target( ) -> Result>, Error> { // if we can find a project, we always look for a local virtualenv first for shims. if let Some(pyproject) = pyproject { - // However we only allow automatic synching, if we are rye managed. + // However we only allow automatic syncing, if we are rye managed. if pyproject.rye_managed() { let _guard = redirect_to_stderr(true); sync(SyncOptions::python_only()).context("sync ahead of shim resolution failed")?; diff --git a/rye/src/cli/show.rs b/rye/src/cli/show.rs index adaeeb0142..1c5105db40 100644 --- a/rye/src/cli/show.rs +++ b/rye/src/cli/show.rs @@ -40,7 +40,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { echo!("venv python: {}", style(&ver).cyan()); if let Some(actual) = get_current_venv_python_version(&project.venv_path()) { if actual != ver { - echo!("last synched venv python: {}", style(&actual).red()); + echo!("last synced venv python: {}", style(&actual).red()); } } } diff --git a/rye/src/cli/sync.rs b/rye/src/cli/sync.rs index 15b12bec76..ff3caec29c 100644 --- a/rye/src/cli/sync.rs +++ b/rye/src/cli/sync.rs @@ -34,7 +34,7 @@ pub struct Args { /// Update to pre-release versions #[arg(long)] pre: bool, - /// Extras/features to enable when synching the workspace. + /// Extras/features to enable when syncing the workspace. #[arg(long)] features: Vec, /// Enables all features. From 674e99ba9858db312868d23f7bd74b5e0b5429b6 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 12 May 2024 14:27:44 +0200 Subject: [PATCH 02/49] Add missing features for windows build (#1073) Fixes #1072 --- rye/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 204f3006d1..3e7ae93977 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -60,7 +60,7 @@ dotenvy = "0.15.7" xattr = "1.3.1" [target."cfg(windows)".dependencies] -winapi = { version = "0.3.9", default-features = false, features = ["winuser"] } +winapi = { version = "0.3.9", default-features = false, features = ["winuser", "winioctl", "ioapiset"] } winreg = "0.52.0" [target."cfg(windows)".build-dependencies] From 4f95b61dcfa69ed4d666cb4ca8323c44e5977df7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 May 2024 12:30:23 +0000 Subject: [PATCH 03/49] Sync UV Releases (#1063) - Synced latest UV releases Auto-generated by [sync-uv-releases.yml](https://github.com/astral-sh/rye/blob/main/.github/workflows/sync-uv-releases.yml) --------- Co-authored-by: mitsuhiko <7396+mitsuhiko@users.noreply.github.com> Co-authored-by: Armin Ronacher --- rye/src/sources/generated/uv_downloads.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rye/src/sources/generated/uv_downloads.inc b/rye/src/sources/generated/uv_downloads.inc index a7377da519..55e214f0f7 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: 1, patch: 39, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.39/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("35e320cfa41c8902d66e2c491b5b2d2414e1c6443177c660736de657c66fb2c2") }, - UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 39, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.39/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("62b24363f21c07e02f62cf8e298ee6ec30e844006f3a52ac55c02903c755586d") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 39, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.39/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("53e4c2ae32318699a5f6c4c7f19f1dd114b39b15e63704be902ff894b428dfed") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 39, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.39/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("f0280538ed9bc68283606e4db031f9cc4c4c8404dc5719e9d1f03f705762966c") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 1, patch: 39, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.39/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("cf5393f17de6961c7140d68f80e09c1f43ef47f8fac923ccd41896cce698f296") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 39, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.39/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("a44eb417b0c1e1c7cffd7349b8019d684f6200d0b5cfaef7dc322e8312bb254c") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 39, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.39/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("e748caea4ddafd3aebba771f4e8f51fe5aa517b71151a648269b3be982a349a1") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("d49e7dea59668962765b8aa2f3a4512b03c166042e380e7a6fec971146ce11e4") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("d4f1192eb260fb67a7b2f69313474c5a08bb3feb777b6ce6e9a74b3c12d22374") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("7c31034d3869d0b38c64c3b5c066676e0f0e03b1598bc51d931d958bce4ef214") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("cd7395cb8bf4380f895d88912d872470eae7656e549fec1c2fcf404ab84018d1") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("b510fb1ba6b039acac0e1b4278ef0b8e935feea4dc8006c68e3ac4cf793a0876") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("57d82e1b0507aa7b4f2259e411dde942876888265aff04ae1eaa3575ab53fced") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("cf3ca3ffbd1971ccef9b4d6cf703c8cf1730b824888bf63a7f1ede13943ddf7d") }, ]; From 43ac3a3ebfe2fd647e7b9a9fca723eeb37194b7d Mon Sep 17 00:00:00 2001 From: davfsa Date: Mon, 13 May 2024 02:19:45 +0200 Subject: [PATCH 04/49] Bump boostrap ruff to 0.4.4 (#1075) Noticed ruff was a bit old and was missing a lot of rules, leading to a lot of "unused noqa". I unfortunately dont have the rust knowledge to improve this, but it would be nice if we could update ruff independently of rye and still run it using `rye lint/fmt`. Thanks for this amazing tool! Gave it a shot today and really really enjoyed playing around with it and testing it out. Currently porting some of my projects to use it! --- rye/src/bootstrap.rs | 4 ++-- rye/tests/test_ruff.rs | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index 7efed5d2f2..dac4da8b60 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -33,7 +33,7 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques suffix: None, }; -const SELF_VERSION: u64 = 18; +const SELF_VERSION: u64 = 19; const SELF_REQUIREMENTS: &str = r#" build==1.2.1 @@ -52,7 +52,7 @@ twine==4.0.2 unearth==0.14.0 urllib3==2.0.7 virtualenv==20.25.0 -ruff==0.3.0 +ruff==0.4.4 "#; static FORCED_TO_UPDATE: AtomicBool = AtomicBool::new(false); diff --git a/rye/tests/test_ruff.rs b/rye/tests/test_ruff.rs index 1d2a9027bd..aa2d700c64 100644 --- a/rye/tests/test_ruff.rs +++ b/rye/tests/test_ruff.rs @@ -9,7 +9,10 @@ fn test_lint_and_format() { let space = Space::new(); space.init("my-project"); space.write( - "src/my_project/__init__.py", + // `test.py` is used instead of `__init__.py` to make ruff consider it a fixable + // issue instead of requiring user intervention. + // ref: https://github.com/astral-sh/ruff/pull/11168 + "src/my_project/test.py", r#"import os def hello(): @@ -24,8 +27,8 @@ def hello(): success: false exit_code: 1 ----- stdout ----- - src/my_project/__init__.py:1:8: F401 [*] `os` imported but unused - src/my_project/__init__.py:6:25: E703 [*] Statement ends with an unnecessary semicolon + src/my_project/test.py:1:8: F401 [*] `os` imported but unused + src/my_project/test.py:6:25: E703 [*] Statement ends with an unnecessary semicolon Found 2 errors. [*] 2 fixable with the `--fix` option. @@ -39,7 +42,7 @@ def hello(): ----- stderr ----- "###); - assert_snapshot!(space.read_string("src/my_project/__init__.py"), @r###" + assert_snapshot!(space.read_string("src/my_project/test.py"), @r###" def hello(): @@ -48,12 +51,13 @@ def hello(): "###); // fmt next + // Already reformatted file mentioned bellow is `__init__.py` rye_cmd_snapshot!(space.rye_cmd().arg("fmt").arg("--check"), @r###" success: false exit_code: 1 ----- stdout ----- - Would reformat: src/my_project/__init__.py - 1 file would be reformatted + Would reformat: src/my_project/test.py + 1 file would be reformatted, 1 file already formatted ----- stderr ----- "###); @@ -61,11 +65,11 @@ def hello(): success: true exit_code: 0 ----- stdout ----- - 1 file reformatted + 1 file reformatted, 1 file left unchanged ----- stderr ----- "###); - assert_snapshot!(space.read_string("src/my_project/__init__.py"), @r###" + assert_snapshot!(space.read_string("src/my_project/test.py"), @r###" def hello(): return "Hello World" "###); From 3dfdcdb5360bf92d200ad1d24c14e09b52447b2d Mon Sep 17 00:00:00 2001 From: my1e5 <10064103+my1e5@users.noreply.github.com> Date: Wed, 15 May 2024 05:20:26 +0100 Subject: [PATCH 05/49] Fix TOML array formatting (#1084) Closes #1083 A trailing newline is only added if there are dependencies or comments in the array. --- rye/src/utils/toml.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rye/src/utils/toml.rs b/rye/src/utils/toml.rs index b38f5351ff..48fc655ecb 100644 --- a/rye/src/utils/toml.rs +++ b/rye/src/utils/toml.rs @@ -48,7 +48,9 @@ pub fn reformat_array_multiline(deps: &mut Array) { rv.push_str(comment); } } - rv.push('\n'); + if !rv.is_empty() || !deps.is_empty() { + rv.push('\n'); + } rv }); deps.set_trailing_comma(true); From 7c4b6991e81e0c6885fac846cc76f8a4425de130 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 04:23:29 +0000 Subject: [PATCH 06/49] Sync UV Releases (#1085) - Synced latest UV releases Auto-generated by [sync-uv-releases.yml](https://github.com/astral-sh/rye/blob/main/.github/workflows/sync-uv-releases.yml) Co-authored-by: mitsuhiko <7396+mitsuhiko@users.noreply.github.com> --- rye/src/sources/generated/uv_downloads.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rye/src/sources/generated/uv_downloads.inc b/rye/src/sources/generated/uv_downloads.inc index 55e214f0f7..05dc66ec88 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: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("d49e7dea59668962765b8aa2f3a4512b03c166042e380e7a6fec971146ce11e4") }, - UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("d4f1192eb260fb67a7b2f69313474c5a08bb3feb777b6ce6e9a74b3c12d22374") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("7c31034d3869d0b38c64c3b5c066676e0f0e03b1598bc51d931d958bce4ef214") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("cd7395cb8bf4380f895d88912d872470eae7656e549fec1c2fcf404ab84018d1") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("b510fb1ba6b039acac0e1b4278ef0b8e935feea4dc8006c68e3ac4cf793a0876") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("57d82e1b0507aa7b4f2259e411dde942876888265aff04ae1eaa3575ab53fced") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 42, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.42/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("cf3ca3ffbd1971ccef9b4d6cf703c8cf1730b824888bf63a7f1ede13943ddf7d") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("154d45db602d5c4f8dbffb0e038fee581f161963f5562568be565625ac7bc753") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("afb7039f033546d55730dae38a106dd56b358117a565a42bf3ebda9c48db53c6") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("c0f74ab851a704b8dfe6afd6bc7fad9d23947561d6c2da1a6cd5274a762c6c4f") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("6e68901f49540494274fbccb83feda57bef7ef137443228669c790f5f1a14fc9") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("0c2deb646f49ad7dbf8db9a9a7fa839b76654569d97b1ccd9d18bea89a34b3e0") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("f876f8c0867707db2d653973caf9ea306d65503ec772d0df9c02b6d0973fc7df") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("68e8fda65c987cc104bdf7ae1eb332477733d44a27823032826f9370928568b2") }, ]; From 8074daa308a10da241e69b06de7489201abfed9b Mon Sep 17 00:00:00 2001 From: mataha Date: Mon, 20 May 2024 21:41:53 +0200 Subject: [PATCH 07/49] Discover cosmo-ified (`.com`) binaries on Windows (#1091) Executables compiled with [Cosmopolitan](https://justine.lol/cosmopolitan/index.html) libc runtime have a `.com` extension on Windows. This includes cosmo-ified Python binaries. Example [here](https://github.com/astral-sh/rye/files/15366179/python.zip). --- rye/src/utils/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rye/src/utils/mod.rs b/rye/src/utils/mod.rs index c1121d1c5e..fc431a98c7 100644 --- a/rye/src/utils/mod.rs +++ b/rye/src/utils/mod.rs @@ -166,7 +166,7 @@ pub fn is_executable(path: &Path) -> bool { } #[cfg(windows)] { - ["exe", "bat", "cmd"] + ["com", "exe", "bat", "cmd"] .iter() .any(|x| path.with_extension(x).is_file()) } @@ -181,7 +181,7 @@ pub fn get_short_executable_name(path: &Path) -> String { #[cfg(windows)] { let short_name = path.file_name().unwrap().to_string_lossy().to_lowercase(); - for ext in [".exe", ".bat", ".cmd"] { + for ext in [".com", ".exe", ".bat", ".cmd"] { if let Some(base_name) = short_name.strip_suffix(ext) { return base_name.into(); } From 0cd65d8176c0afbe06a00fb2f9c2cc2a716a1005 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 20 May 2024 15:42:40 -0400 Subject: [PATCH 08/49] Write `use-uv = true` in no-prompt mode (#1098) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Ensures that if the user runs in `InstallMode::NoPrompts`, we still write the default (`use-uv = true`) to the configuration file. Closes https://github.com/astral-sh/rye/issues/1081. ## Test Plan ``` rye on  charlie/def:main ❯ cargo run self install -y Finished dev [unoptimized + debuginfo] target(s) in 0.08s Running `target/debug/rye self install -y` Welcome to Rye! This installer will install rye to /Users/crmarsh/.rye This path can be changed by exporting the RYE_HOME environment variable. Details: Rye Version: 0.34.0 Platform: macos (aarch64) Installed binary to /Users/crmarsh/.rye/shims/rye Updated self-python installation at /Users/crmarsh/.rye/self The rye directory /Users/crmarsh/.rye/shims was not detected on PATH. It is highly recommended that you add it. Added to PATH. note: for this to take effect you will need to restart your shell or run this manually: source "$HOME/.rye/env" To make it work with zsh, you might need to add this to your .zprofile: source "$HOME/.rye/env" To make it work with fish, run this once instead: set -Ua fish_user_paths "$HOME/.rye/shims" For more information read https://rye-up.com/guide/installation/ All done! rye on  charlie/def:main ❯ cat /Users/crmarsh/.rye/config.toml [behavior] use-uv = true global-python = true ``` --- rye/src/cli/rye.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index 72d7ca357f..506446ac80 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -590,15 +590,15 @@ fn perform_install( .get("behavior") .and_then(|x| x.get("use-uv")) .is_none() - && !matches!(mode, InstallMode::NoPrompts) { - let use_uv = dialoguer::Select::with_theme(tui_theme()) - .with_prompt("Select the preferred package installer") - .item("uv (fast, recommended)") - .item("pip-tools (slow, higher compatibility)") - .default(0) - .interact()? - == 0; + let use_uv = matches!(mode, InstallMode::NoPrompts) + || dialoguer::Select::with_theme(tui_theme()) + .with_prompt("Select the preferred package installer") + .item("uv (fast, recommended)") + .item("pip-tools (slow, higher compatibility)") + .default(0) + .interact()? + == 0; toml::ensure_table(config_doc, "behavior")["use-uv"] = toml_edit::value(use_uv); } From 28efbe9f95e103e5b791d43e6390a0bd7eac9cc5 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 20 May 2024 16:17:06 -0400 Subject: [PATCH 09/49] Run `cargo update` (#1099) --- Cargo.lock | 362 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 203 insertions(+), 159 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc0642af75..3a7d4b0e21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,19 +99,28 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" dependencies = [ "backtrace", ] +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "arc-swap" version = "1.7.1" @@ -120,9 +129,9 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" @@ -151,6 +160,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "bech32" version = "0.9.1" @@ -223,9 +238,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.95" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", @@ -348,7 +363,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", ] [[package]] @@ -396,18 +411,18 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -483,7 +498,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", ] [[package]] @@ -501,9 +516,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "deranged" @@ -514,11 +529,22 @@ dependencies = [ "powerfmt", ] +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.65", +] + [[package]] name = "deunicode" -version = "1.4.4" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322ef0094744e63628e6f0eb2295517f79276a5b342a4c2ff3042566ca181d4e" +checksum = "339544cc9e2c4dc3fc7149fd630c5f22263a4fdf18a98afd0075784968b5cf00" [[package]] name = "dialoguer" @@ -551,7 +577,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", ] [[package]] @@ -562,9 +588,9 @@ checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "either" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "encode_unicode" @@ -589,9 +615,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -608,15 +634,15 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fiat-crypto" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38793c55593b33412e3ae40c2c9781ffaa6f438f6f8c10f24e71846fbd7ae01e" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "filetime" @@ -626,7 +652,7 @@ checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "windows-sys 0.52.0", ] @@ -641,9 +667,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -651,9 +677,9 @@ dependencies = [ [[package]] name = "fluent" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f69378194459db76abd2ce3952b790db103ceb003008d3d50d97c41ff847a7" +checksum = "bb74634707bebd0ce645a981148e8fb8c7bccd4c33c652aeffd28bf2f96d555a" dependencies = [ "fluent-bundle", "unic-langid", @@ -661,9 +687,9 @@ dependencies = [ [[package]] name = "fluent-bundle" -version = "0.15.2" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e242c601dec9711505f6d5bbff5bedd4b61b2469f2e8bb8e57ee7c9747a87ffd" +checksum = "7fe0a21ee80050c678013f82edf4b705fe2f26f1f9877593d13198612503f493" dependencies = [ "fluent-langneg", "fluent-syntax", @@ -686,9 +712,9 @@ dependencies = [ [[package]] name = "fluent-syntax" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0abed97648395c902868fee9026de96483933faa54ea3b40d652f7dfe61ca78" +checksum = "2a530c4694a6a8d528794ee9bbd8ba0122e779629ac908d15ad5a7ae7763a33d" dependencies = [ "thiserror", ] @@ -787,7 +813,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", ] [[package]] @@ -832,9 +858,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -865,7 +891,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", "time", ] @@ -884,9 +910,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -941,7 +967,7 @@ dependencies = [ "serde", "serde_derive", "thiserror", - "toml 0.8.12", + "toml 0.8.13", "unic-langid", ] @@ -983,7 +1009,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.60", + "syn 2.0.65", "unic-langid", ] @@ -997,7 +1023,7 @@ dependencies = [ "i18n-config", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", ] [[package]] @@ -1044,9 +1070,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.38.0" +version = "1.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eab73f58e59ca6526037208f0e98851159ec1633cf17b6cd2e1f2c3fd5d53cc" +checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" dependencies = [ "console", "lazy_static", @@ -1069,18 +1095,18 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] [[package]] name = "intl-memoizer" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c310433e4a310918d6ed9243542a6b83ec1183df95dff8f23f87bb88a264a66f" +checksum = "fe22e020fce238ae18a6d5d8c502ee76a52a6e880d99477657e6acc30ec57bda" dependencies = [ "type-map", "unic-langid", @@ -1118,12 +1144,12 @@ dependencies = [ [[package]] name = "junction" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca39ef0d69b18e6a2fd14c2f0a1d593200f4a4ed949b240b5917ab51fac754cb" +checksum = "1c9c415a9b7b1e86cd5738f39d34c9e78c765da7fb1756dbd7d31b3b0d2e7afa" dependencies = [ "scopeguard", - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -1134,9 +1160,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libz-sys" @@ -1169,15 +1195,15 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1191,13 +1217,13 @@ checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "mailparse" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d096594926cab442e054e047eb8c1402f7d5b2272573b97ba68aa40629f9757" +checksum = "3da03d5980411a724e8aaf7b61a7b5e386ec55a7fb49ee3d0ff79efc7e5e7c7e" dependencies = [ "charset", "data-encoding", - "quoted_printable 0.5.0", + "quoted_printable", ] [[package]] @@ -1224,9 +1250,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -1248,7 +1274,7 @@ dependencies = [ "target-lexicon", "tempfile", "thiserror", - "toml 0.8.12", + "toml 0.8.13", "tracing", "unscanny", "ureq", @@ -1340,9 +1366,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -1350,15 +1376,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -1428,7 +1454,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", ] [[package]] @@ -1510,9 +1536,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" dependencies = [ "unicode-ident", ] @@ -1528,9 +1554,9 @@ dependencies = [ [[package]] name = "python-pkginfo" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037469c164f08c891bf6d69ca02f1d56210011451e229618669777df82124cfa" +checksum = "85f2c5f010e6a63cabc4abcd60d8a61f8f8c450ac60ff0f4ae32a23b2c17d626" dependencies = [ "flate2", "fs-err", @@ -1539,7 +1565,7 @@ dependencies = [ "serde", "tar", "thiserror", - "zip", + "zip 1.3.0", ] [[package]] @@ -1551,12 +1577,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "quoted_printable" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3866219251662ec3b26fc217e3e05bf9c4f84325234dfb96bf0bf840889e49" - [[package]] name = "quoted_printable" version = "0.5.0" @@ -1602,6 +1622,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "regex" version = "1.10.4" @@ -1642,15 +1671,15 @@ dependencies = [ [[package]] name = "rfc2047-decoder" -version = "0.2.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61fc4b4e52897c3e30b12b7e9b04461215b647fbe66f6def60dd8edbce14ec2e" +checksum = "e90a668c463c412c3118ae1883e18b53d812c349f5af7a06de3ba4bb0c17cc73" dependencies = [ "base64 0.21.7", "charset", "chumsky", "memchr", - "quoted_printable 0.4.8", + "quoted_printable", "thiserror", ] @@ -1671,9 +1700,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "8.3.0" +version = "8.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb78f46d0066053d16d4ca7b898e9343bc3530f71c61d5ad84cd404ada068745" +checksum = "19549741604902eb99a7ed0ee177a0663ee1eda51a29f71401f166e47e77806a" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -1682,22 +1711,22 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.3.0" +version = "8.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91ac2a3c6c0520a3fb3dd89321177c3c692937c4eb21893378219da10c44fc8" +checksum = "cb9f96e283ec64401f30d3df8ee2aaeb2561f34c824381efa24a35f79bf40ee4" dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.60", + "syn 2.0.65", "walkdir", ] [[package]] name = "rust-embed-utils" -version = "8.3.0" +version = "8.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f69089032567ffff4eada41c573fc43ff466c7db7c5688b2e7969584345581" +checksum = "38c74a686185620830701348de757fd36bef4aa9680fd23c49fc539ddcc1af32" dependencies = [ "sha2", "walkdir", @@ -1705,9 +1734,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -1753,15 +1782,15 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.5.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.102.3" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring", "rustls-pki-types", @@ -1820,15 +1849,15 @@ dependencies = [ "winapi", "winreg", "xattr", - "zip", + "zip 0.6.6", "zstd", ] [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa20" @@ -1900,46 +1929,46 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e14e4d63b804dc0c7ec4a1e52bcb63f02c7ac94476755aa579edac21e01f915d" dependencies = [ - "self_cell 1.0.3", + "self_cell 1.0.4", ] [[package]] name = "self_cell" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.198" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", ] [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -1948,9 +1977,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -2011,9 +2040,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2068,9 +2097,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" dependencies = [ "proc-macro2", "quote", @@ -2101,7 +2130,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.2", + "fastrand 2.1.0", "rustix", "windows-sys 0.52.0", ] @@ -2118,22 +2147,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", ] [[package]] @@ -2202,9 +2231,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ "serde", "serde_spanned", @@ -2214,18 +2243,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ "indexmap", "serde", @@ -2254,7 +2283,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", ] [[package]] @@ -2268,9 +2297,9 @@ dependencies = [ [[package]] name = "type-map" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d3364c5e96cb2ad1603037ab253ddd34d7fb72a58bdddf4b7350760fc69a46" +checksum = "deb68604048ff8fa93347f02441e4487594adc20bb8a084f9e564d2b827a0a9f" dependencies = [ "rustc-hash", ] @@ -2283,18 +2312,18 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unic-langid" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238722e6d794ed130f91f4ea33e01fcff4f188d92337a21297892521c72df516" +checksum = "23dd9d1e72a73b25e07123a80776aae3e7b0ec461ef94f9151eed6ec88005a44" dependencies = [ "unic-langid-impl", ] [[package]] name = "unic-langid-impl" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd55a2063fdea4ef1f8633243a7b0524cbeef1905ae04c31a1c9b9775c55bc6" +checksum = "0a5422c1f65949306c99240b81de9f3f15929f5a8bfe05bb44b034cc8bf593e5" dependencies = [ "serde", "tinystr", @@ -2329,9 +2358,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "universal-hash" @@ -2357,11 +2386,11 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.6" +version = "2.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11f214ce18d8b2cbe84ed3aa6486ed3f5b285cf8d8fbdbce9f3f767a724adc35" +checksum = "d11a831e3c0b56e438a28308e7c810799e3c118417f342d30ecec080105395cd" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "flate2", "log", "once_cell", @@ -2435,7 +2464,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", "wasm-bindgen-shared", ] @@ -2457,7 +2486,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2507,9 +2536,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134306a13c5647ad6453e8deaec55d3a44d6021970129e6188735e74bf546697" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ "windows-sys 0.52.0", ] @@ -2661,9 +2690,9 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ "memchr", ] @@ -2709,29 +2738,29 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", ] [[package]] name = "zeroize" -version = "1.8.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63381fa6624bf92130a6b87c0d07380116f80b565c42cf0d754136f0238359ef" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -2744,7 +2773,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.65", ] [[package]] @@ -2754,10 +2783,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ "byteorder", + "crc32fast", + "crossbeam-utils", + "flate2", +] + +[[package]] +name = "zip" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f4a27345eb6f7aa7bd015ba7eb4175fa4e1b462a29874b779e0bbcf96c6ac7" +dependencies = [ + "arbitrary", "bzip2", "crc32fast", "crossbeam-utils", + "displaydoc", "flate2", + "indexmap", + "thiserror", "time", ] From d31340178df9b1cf97ea96b6856f2b13383bed8f Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 20 May 2024 16:18:16 -0400 Subject: [PATCH 10/49] Prep v0.34.0 for release (#1100) --- CHANGELOG.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 371864c620..f897126aa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,13 +3,24 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. -## 0.34.0 - -_Unreleased_ + -- Use uv in `rye build` when uv is enabled. #978 +## 0.34.0 - +Released on 2024-05-20. + +* Add nushell completion support by @MilesCranmer in https://github.com/astral-sh/rye/pull/1030 +* Use uv in rye build when enabled by @bluss in https://github.com/astral-sh/rye/pull/978 +* Add short version add -d for rye add --dev by @bluss in https://github.com/astral-sh/rye/pull/1044 +* Flip uv to the default Rye backend by @charliermarsh in https://github.com/astral-sh/rye/pull/1053 +* Fix Rye not using user-chosen toolchain as default during installation by @pjdon in https://github.com/astral-sh/rye/pull/1054 +* Add keyring support for uv by @emarsden-iso in https://github.com/astral-sh/rye/pull/1016 +* Allow to generate lockfiles with hashes when using uv by @mvaled in https://github.com/astral-sh/rye/pull/1070 +* Bump ruff to 0.4.4 by @davfsa in https://github.com/astral-sh/rye/pull/1075 +* Fix TOML array formatting by @my1e5 in https://github.com/astral-sh/rye/pull/1084 +* Bump uv to 0.1.44 in https://github.com/astral-sh/rye/pull/1085 +* Discover cosmo-ified (`.com`) binaries on Windows by @mataha in https://github.com/astral-sh/rye/pull/1091 +* Write `use-uv = true` in no-prompt mode by @charliermarsh in https://github.com/astral-sh/rye/pull/1098 ## 0.33.0 From 39fe0d082ab95447d4c37b3aa7623b24861dd540 Mon Sep 17 00:00:00 2001 From: davfsa Date: Mon, 20 May 2024 22:34:31 +0200 Subject: [PATCH 11/49] Bump actions/checkout to v4 (#1101) Removes all the Node.js 16 versions from the CI runs ![image](https://github.com/astral-sh/rye/assets/29100934/e2f3b3c0-206e-449e-a4a2-b6efd803f3bb) --- .github/workflows/clippy.yml | 2 +- .github/workflows/rustfmt.yml | 2 +- .github/workflows/spelling.yml | 4 ++-- .github/workflows/tests.yml | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 91a6e165ad..43ce104a69 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: stable diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index 416cd1d1ca..a511902c92 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: stable diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml index 375999ae4b..79ed4cfbf0 100644 --- a/.github/workflows/spelling.yml +++ b/.github/workflows/spelling.yml @@ -11,7 +11,7 @@ jobs: name: "Spell check" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: crate-ci/typos@master with: - files: . \ No newline at end of file + files: . diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ffd5f729a1..0158e3e431 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: stable @@ -31,7 +31,7 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: stable @@ -50,7 +50,7 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: stable From 6d395c6195aa0af6754dc1e00347ba89b55a6f15 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Tue, 21 May 2024 20:53:58 -0400 Subject: [PATCH 12/49] Enforce `--pre` when auto-syncing (#1107) ## Summary We weren't passing `--pre` when auto-syncing after `rye `add`. Closes https://github.com/astral-sh/rye/issues/1102 --- rye/src/cli/add.rs | 34 +++++++++++++++++++++++----------- rye/src/cli/lock.rs | 6 +++--- rye/src/cli/remove.rs | 25 +++++++++++++++++++++---- rye/src/cli/sync.rs | 6 +++--- rye/src/cli/test.rs | 27 ++++++++++++++++++++++----- rye/src/sync.rs | 10 +++++++++- 6 files changed, 81 insertions(+), 27 deletions(-) diff --git a/rye/src/cli/add.rs b/rye/src/cli/add.rs index 3e357c9b0b..9fa56f2ad2 100644 --- a/rye/src/cli/add.rs +++ b/rye/src/cli/add.rs @@ -208,15 +208,9 @@ pub struct Args { /// Add this to an optional dependency group. #[arg(long, conflicts_with = "dev", conflicts_with = "excluded")] optional: Option, - /// Include pre-releases when finding a package version. - #[arg(long)] - pre: bool, /// Overrides the pin operator #[arg(long)] pin: Option, - /// Attempt to use `keyring` for authentication for index URLs. - #[arg(long, value_enum, default_value_t)] - keyring_provider: KeyringProvider, /// Runs `sync` even if auto-sync is disabled. #[arg(long)] sync: bool, @@ -229,6 +223,19 @@ pub struct Args { /// Turns off all output. #[arg(short, long, conflicts_with = "verbose")] quiet: bool, + + /// Include pre-releases when finding a package version and automatically syncing the workspace. + #[arg(long)] + pre: bool, + /// Set to `true` to lock with sources in the lockfile when automatically syncing the workspace. + #[arg(long)] + with_sources: bool, + /// Set to `true` to lock with hashes in the lockfile when automatically syncing the workspace. + #[arg(long)] + generate_hashes: bool, + /// Attempt to use `keyring` for authentication for index URLs. + #[arg(long, value_enum, default_value_t)] + keyring_provider: KeyringProvider, } pub fn execute(cmd: Args) -> Result<(), Error> { @@ -264,8 +271,6 @@ pub fn execute(cmd: Args) -> Result<(), Error> { requirements.push(requirement); } - let keyring_provider = cmd.keyring_provider; - if !cmd.excluded { if cfg.use_uv() { sync(SyncOptions::python_only().pyproject(None)) @@ -277,10 +282,10 @@ pub fn execute(cmd: Args) -> Result<(), Error> { cmd.pre, output, &default_operator, - keyring_provider, + cmd.keyring_provider, )?; } else { - if keyring_provider != KeyringProvider::Disabled { + if cmd.keyring_provider != KeyringProvider::Disabled { bail!("`--keyring-provider` option requires the uv backend"); } for requirement in &mut requirements { @@ -314,7 +319,14 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } if (cfg.autosync() && !cmd.no_sync) || cmd.sync { - autosync(&pyproject_toml, output, keyring_provider)?; + autosync( + &pyproject_toml, + output, + cmd.pre, + cmd.with_sources, + cmd.generate_hashes, + cmd.keyring_provider, + )?; } Ok(()) diff --git a/rye/src/cli/lock.rs b/rye/src/cli/lock.rs index ecbeef1316..97f84f2eb2 100644 --- a/rye/src/cli/lock.rs +++ b/rye/src/cli/lock.rs @@ -37,15 +37,15 @@ pub struct Args { /// Attempt to use `keyring` for authentication for index URLs. #[arg(long, value_enum, default_value_t)] keyring_provider: KeyringProvider, + /// Set to true to lock with hashes in the lockfile. + #[arg(long)] + generate_hashes: bool, /// Reset prior lock options. #[arg(long)] reset: bool, /// Use this pyproject.toml file #[arg(long, value_name = "PYPROJECT_TOML")] pyproject: Option, - /// Set to true to lock with hashes in the lockfile. - #[arg(long)] - generate_hashes: bool, } pub fn execute(cmd: Args) -> Result<(), Error> { diff --git a/rye/src/cli/remove.rs b/rye/src/cli/remove.rs index f47812b652..f950bdbfcc 100644 --- a/rye/src/cli/remove.rs +++ b/rye/src/cli/remove.rs @@ -28,15 +28,25 @@ pub struct Args { /// Does not run `sync` even if auto-sync is enabled. #[arg(long, conflicts_with = "sync")] no_sync: bool, - /// Attempt to use `keyring` for authentication for index URLs. - #[arg(long, value_enum, default_value_t)] - keyring_provider: KeyringProvider, /// Enables verbose diagnostics. #[arg(short, long)] verbose: bool, /// Turns off all output. #[arg(short, long, conflicts_with = "verbose")] quiet: bool, + + /// Include pre-releases when automatically syncing the workspace. + #[arg(long)] + pre: bool, + /// Set to `true` to lock with sources in the lockfile when automatically syncing the workspace. + #[arg(long)] + with_sources: bool, + /// Set to `true` to lock with hashes in the lockfile when automatically syncing the workspace. + #[arg(long)] + generate_hashes: bool, + /// Attempt to use `keyring` for authentication for index URLs. + #[arg(long, value_enum, default_value_t)] + keyring_provider: KeyringProvider, } pub fn execute(cmd: Args) -> Result<(), Error> { @@ -69,7 +79,14 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } if (Config::current().autosync() && !cmd.no_sync) || cmd.sync { - autosync(&pyproject_toml, output, cmd.keyring_provider)?; + autosync( + &pyproject_toml, + output, + cmd.pre, + cmd.with_sources, + cmd.generate_hashes, + cmd.keyring_provider, + )?; } Ok(()) diff --git a/rye/src/cli/sync.rs b/rye/src/cli/sync.rs index ff3caec29c..fc10379b98 100644 --- a/rye/src/cli/sync.rs +++ b/rye/src/cli/sync.rs @@ -46,15 +46,15 @@ pub struct Args { /// Attempt to use `keyring` for authentication for index URLs. #[arg(long, value_enum, default_value_t)] keyring_provider: KeyringProvider, + /// Set to true to lock with hashes in the lockfile. + #[arg(long)] + generate_hashes: bool, /// Use this pyproject.toml file #[arg(long, value_name = "PYPROJECT_TOML")] pyproject: Option, /// Do not reuse (reset) prior lock options. #[arg(long)] reset: bool, - /// Set to true to lock with hashes in the lockfile. - #[arg(long)] - generate_hashes: bool, } pub fn execute(cmd: Args) -> Result<(), Error> { diff --git a/rye/src/cli/test.rs b/rye/src/cli/test.rs index 5221121ce7..bb2a0042b1 100644 --- a/rye/src/cli/test.rs +++ b/rye/src/cli/test.rs @@ -29,10 +29,7 @@ pub struct Args { /// Use this pyproject.toml file #[arg(long, value_name = "PYPROJECT_TOML")] pyproject: Option, - /// Attempt to use `keyring` for authentication for index URLs. - #[arg(long, value_enum, default_value_t)] - keyring_provider: KeyringProvider, - // Disable test output capture to stdout + /// Disable test output capture to stdout. #[arg(long = "no-capture", short = 's')] no_capture: bool, /// Enables verbose diagnostics. @@ -44,6 +41,19 @@ pub struct Args { /// Extra arguments to pytest #[arg(last = true)] extra_args: Vec, + + /// Include pre-releases when automatically syncing the workspace. + #[arg(long)] + pre: bool, + /// Set to `true` to lock with sources in the lockfile when automatically syncing the workspace. + #[arg(long)] + with_sources: bool, + /// Set to `true` to lock with hashes in the lockfile when automatically syncing the workspace. + #[arg(long)] + generate_hashes: bool, + /// Attempt to use `keyring` for authentication for index URLs. + #[arg(long, value_enum, default_value_t)] + keyring_provider: KeyringProvider, } pub fn execute(cmd: Args) -> Result<(), Error> { @@ -77,7 +87,14 @@ pub fn execute(cmd: Args) -> Result<(), Error> { let has_pytest = has_pytest_dependency(&projects)?; if has_pytest { if Config::current().autosync() { - autosync(&projects[0], output, cmd.keyring_provider)?; + autosync( + &projects[0], + output, + cmd.pre, + cmd.with_sources, + cmd.generate_hashes, + cmd.keyring_provider, + )?; } else { bail!("pytest not installed but in dependencies. Run `rye sync`.") } diff --git a/rye/src/sync.rs b/rye/src/sync.rs index 0c644fb5bf..5ab816a616 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -319,6 +319,9 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { pub fn autosync( pyproject: &PyProject, output: CommandOutput, + pre: bool, + with_sources: bool, + generate_hashes: bool, keyring_provider: KeyringProvider, ) -> Result<(), Error> { sync(SyncOptions { @@ -327,7 +330,12 @@ pub fn autosync( mode: SyncMode::Regular, force: false, no_lock: false, - lock_options: LockOptions::default(), + lock_options: LockOptions { + pre, + with_sources, + generate_hashes, + ..Default::default() + }, pyproject: Some(pyproject.toml_path().to_path_buf()), keyring_provider, }) From c388c12f89949e8bf9edf394a6593da4a286b85e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 22 May 2024 09:10:14 -0400 Subject: [PATCH 13/49] Sync UV Releases (#1103) - Synced latest UV releases Auto-generated by [sync-uv-releases.yml](https://github.com/astral-sh/rye/blob/main/.github/workflows/sync-uv-releases.yml) Co-authored-by: mitsuhiko <7396+mitsuhiko@users.noreply.github.com> --- rye/src/sources/generated/uv_downloads.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rye/src/sources/generated/uv_downloads.inc b/rye/src/sources/generated/uv_downloads.inc index 05dc66ec88..47b93be95c 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: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("154d45db602d5c4f8dbffb0e038fee581f161963f5562568be565625ac7bc753") }, - UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("afb7039f033546d55730dae38a106dd56b358117a565a42bf3ebda9c48db53c6") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("c0f74ab851a704b8dfe6afd6bc7fad9d23947561d6c2da1a6cd5274a762c6c4f") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("6e68901f49540494274fbccb83feda57bef7ef137443228669c790f5f1a14fc9") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("0c2deb646f49ad7dbf8db9a9a7fa839b76654569d97b1ccd9d18bea89a34b3e0") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("f876f8c0867707db2d653973caf9ea306d65503ec772d0df9c02b6d0973fc7df") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 44, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.44/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("68e8fda65c987cc104bdf7ae1eb332477733d44a27823032826f9370928568b2") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("4990c1ca07e87ea215085c798294205057efd7ed97d7d5f4c76e840fc366753c") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("71ff02cac3e257e12d35fe9bbd6dc096858ec23e218b069b5ec6e5157db39e1b") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("b010c1ddf3c0de9ec25068e1f7026b369df453b78c6619634da9cdd14aa9d810") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("2f14d4d41617b0358aadbf1bc8d77db60ca27200a8bdf66b8fd87fe66a18575a") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("b820364764eb628a89e11b25acd3fe19dfce436546f4f7c8dc38ede3f7d939df") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("3de68132a6316e346f2ae3847dcedaa13ee89a8672b91544bc7d31f49362f20e") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("11341c386088233e197707a30fd9b13233deb222fd366cd39f9daf8e5924c7db") }, ]; From 6b2c3f4ae1088960ad7b5c887511b0ee63a3da63 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 23 May 2024 00:12:13 -0400 Subject: [PATCH 14/49] Temporarily change installer location (#1112) The site is down due to DNS issues, changing this in the interim. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b3929bfc4..725391b43a 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ The installation takes just a minute: * **Linux and macOS:** ``` - curl -sSf https://rye-up.com/get | bash + curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | sh ``` * **Windows:** From 68d85ed2b38c6fb801b5c32e1ddc55267412f99f Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 23 May 2024 11:20:29 -0400 Subject: [PATCH 15/49] Move from `rye-up.com` to `rye.astral.sh` (#1113) ## Summary We're having issues with `rye-up.com`. We're trying to recover it but need to work with the registrar. In the interim, I'm going to move the docs and installers to `rye.astral.sh`. When `rye-up.com` is recovered, we can redirect, either from `rye.astral.sh` to `rye-up.com` or vice versa. Closes #1111. --- README.md | 12 ++++++------ docs/.includes/curl-to-bash-options.md | 2 +- docs/.includes/quick-install.md | 4 ++-- docs/CNAME | 2 +- docs/community.md | 8 ++++---- docs/guide/faq.md | 2 +- rye/src/bootstrap.rs | 2 +- rye/src/cli/rye.rs | 6 +++--- rye/src/cli/shim.rs | 2 +- rye/src/uv.rs | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 725391b43a..8d5af94451 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ----
-[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/rye/main/artwork/badge.json)](https://rye-up.com) +[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/rye/main/artwork/badge.json)](https://rye.astral.sh) [![](https://dcbadge.vercel.app/api/server/drbkcdtSbg?style=flat)](https://discord.gg/drbkcdtSbg)
@@ -47,21 +47,21 @@ The installation takes just a minute: * **Linux and macOS:** ``` - curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | sh + curl -sSf https://rye.astral.sh/get | sh ``` * **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)). -For more details and other options, refer to the [installation instructions](https://rye-up.com/guide/installation/). +For more details and other options, refer to the [installation instructions](https://rye.astral.sh/guide/installation/). ## Learn More Did I spark your interest? -* [Visit the Website](https://rye-up.com/) -* [Read the Documentation](https://rye-up.com/guide/) +* [Visit the Website](https://rye.astral.sh/) +* [Read the Documentation](https://rye.astral.sh/guide/) * [Report Problems in the Issue Tracker](https://github.com/astral-sh/rye/issues) ## More @@ -70,5 +70,5 @@ Did I spark your interest? on GitHub * [Discord](https://discord.gg/drbkcdtSbg), for conversations with other developers in text form * [Issue Tracker](https://github.com/astral-sh/rye/issues), if you run into bugs or have suggestions -* [Badges](https://rye-up.com/community/#badges), if you want to show that you use Rye +* [Badges](https://rye.astral.sh/community/#badges), if you want to show that you use Rye * License: MIT diff --git a/docs/.includes/curl-to-bash-options.md b/docs/.includes/curl-to-bash-options.md index 9fec62be05..9c67a60039 100644 --- a/docs/.includes/curl-to-bash-options.md +++ b/docs/.includes/curl-to-bash-options.md @@ -14,5 +14,5 @@ variables: This for instance installs a specific version of Rye without asking questions: ```bash -curl -sSf https://rye-up.com/get | RYE_VERSION="0.4.0" RYE_INSTALL_OPTION="--yes" bash +curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.4.0" RYE_INSTALL_OPTION="--yes" bash ``` \ No newline at end of file diff --git a/docs/.includes/quick-install.md b/docs/.includes/quick-install.md index 1ae5b317b0..2f20ddb166 100644 --- a/docs/.includes/quick-install.md +++ b/docs/.includes/quick-install.md @@ -4,7 +4,7 @@ operating system and CPU architecture and install it: ```bash - curl -sSf https://rye-up.com/get | bash + curl -sSf https://rye.astral.sh/get | bash ``` Alternatively if you don't trust this approach, you can download the latest release @@ -25,7 +25,7 @@ operating system and CPU architecture and install it: ```bash - curl -sSf https://rye-up.com/get | bash + curl -sSf https://rye.astral.sh/get | bash ``` Alternatively if you don't trust this approach, you can download the latest release diff --git a/docs/CNAME b/docs/CNAME index ced6063925..0c6d7c3fb4 100644 --- a/docs/CNAME +++ b/docs/CNAME @@ -1 +1 @@ -rye-up.com +rye.astral.sh diff --git a/docs/community.md b/docs/community.md index b82ef2bc8a..ec394f8ce0 100644 --- a/docs/community.md +++ b/docs/community.md @@ -22,21 +22,21 @@ You can also reach out [via Twitter](https://twitter.com/mitsuhiko) or Want to show that you are using Rye? Why not throw a badge into your project's `README.md`: ```md -[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/rye/main/artwork/badge.json)](https://rye-up.com) +[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/rye/main/artwork/badge.json)](https://rye.astral.sh) ``` ... or `README.rst`: ```rst .. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/rye/main/artwork/badge.json - :target: https://rye-up.com + :target: https://rye.astral.sh :alt: Rye ``` ... or, as HTML: ```html -Rye +Rye ``` -[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/rye/main/artwork/badge.json)](https://rye-up.com) +[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/rye/main/artwork/badge.json)](https://rye.astral.sh) diff --git a/docs/guide/faq.md b/docs/guide/faq.md index 9e72463b2d..b3bc103bd8 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -92,7 +92,7 @@ the default one higher priority in the `PATH: ``` export PATH="/usr/bin:$PATH" -curl -sSf https://rye-up.com/get | bash +curl -sSf https://rye.astral.sh/get | bash ``` ## References to Build-Time Paths diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index dac4da8b60..ecde15da95 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -618,6 +618,6 @@ fn validate_shared_libraries(py: &Path) -> Result<(), Error> { } bail!( "Python installation is unable to run on this machine due to missing libraries.\n\ - Visit https://rye-up.com/guide/faq/#missing-shared-libraries-on-linux for next steps." + Visit https://rye.astral.sh/guide/faq/#missing-shared-libraries-on-linux for next steps." ); } diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index 506446ac80..ad5e2fcebd 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -533,7 +533,7 @@ fn perform_install( echo!("automatically started the installer for you. For more information"); echo!( "read {}", - style("https://rye-up.com/guide/installation/").yellow() + style("https://rye.astral.sh/guide/installation/").yellow() ); } @@ -571,7 +571,7 @@ fn perform_install( echo!("enable symlinks. You need to enable this before continuing the setup."); echo!( "Learn more at {}", - style("https://rye-up.com/guide/faq/#windows-developer-mode").yellow() + style("https://rye.astral.sh/guide/faq/#windows-developer-mode").yellow() ); } @@ -782,7 +782,7 @@ fn add_rye_to_path(mode: &InstallMode, shims: &Path, ask: bool) -> Result<(), Er ); echo!(); } - echo!("For more information read https://rye-up.com/guide/installation/"); + echo!("For more information read https://rye.astral.sh/guide/installation/"); } } // On Windows, we add the rye directory to the user's PATH unconditionally. diff --git a/rye/src/cli/shim.rs b/rye/src/cli/shim.rs index 68ec8370a1..aa8bb16a4c 100644 --- a/rye/src/cli/shim.rs +++ b/rye/src/cli/shim.rs @@ -327,7 +327,7 @@ pub fn execute_shim(args: &[OsString]) -> Result<(), Error> { "Target Python binary '{}' not found.\nYou are currently outside of a project. \ To resolve this, consider enabling global shims. \ Global shims allow for a Rye-managed Python installation.\n\ - For more information: https://rye-up.com/guide/shims/#global-shims", shim_name + For more information: https://rye.astral.sh/guide/shims/#global-shims", shim_name ); } } else { diff --git a/rye/src/uv.rs b/rye/src/uv.rs index 303fe9a9d8..9dbf87db42 100644 --- a/rye/src/uv.rs +++ b/rye/src/uv.rs @@ -311,7 +311,7 @@ impl Uv { format!( "unable to create self venv using {}. It might be that \ the used Python build is incompatible with this machine. \ - For more information see https://rye-up.com/guide/installation/", + For more information see https://rye.astral.sh/guide/installation/", py_bin.display() ) })?; From 9caff1c71fa1d9b3e85d29b65e37955d8f14112a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 15:35:05 +0000 Subject: [PATCH 16/49] Sync UV Releases (#1110) --- rye/src/sources/generated/uv_downloads.inc | 14 +++++++------- rye/tests/test_add.rs | 12 ++++++------ rye/tests/test_cli.rs | 1 + rye/tests/test_init.rs | 3 +++ rye/tests/test_sync.rs | 10 ++++++---- rye/tests/test_test.rs | 2 +- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/rye/src/sources/generated/uv_downloads.inc b/rye/src/sources/generated/uv_downloads.inc index 47b93be95c..7636650dbb 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: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("4990c1ca07e87ea215085c798294205057efd7ed97d7d5f4c76e840fc366753c") }, - UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("71ff02cac3e257e12d35fe9bbd6dc096858ec23e218b069b5ec6e5157db39e1b") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("b010c1ddf3c0de9ec25068e1f7026b369df453b78c6619634da9cdd14aa9d810") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("2f14d4d41617b0358aadbf1bc8d77db60ca27200a8bdf66b8fd87fe66a18575a") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("b820364764eb628a89e11b25acd3fe19dfce436546f4f7c8dc38ede3f7d939df") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("3de68132a6316e346f2ae3847dcedaa13ee89a8672b91544bc7d31f49362f20e") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 1, patch: 45, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.1.45/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("11341c386088233e197707a30fd9b13233deb222fd366cd39f9daf8e5924c7db") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("4533c5a3f81f64dbcf9fd154cfa5e1cf904e4d9698eca63ec6a209f554a0beb9") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("fa01c8584e6dbea991e9f14e50ad33e51c1a321cabedae738075fe58ee5a3ab7") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("e3c321c02572db320f1f6555da93fa0a2550cee84be49df8890f45dba49cc31c") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("e81b97d0dc2756b7ca632d1344d9dcdf0dd3d127f1c4b134c338a05b28454e8a") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("4c0acbde53ce0fec440379c112bcc6beafd924dbbd6717d97e92245473d1e51a") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("fdfede202032b74e3a3e94034c26e23607b4a4326625953f48eae74c1f7d4d0b") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("d19904a4eb2dca1b654639e82fc0327957c73427e504492005645f62d2205a3b") }, ]; diff --git a/rye/tests/test_add.rs b/rye/tests/test_add.rs index 7576a4f35d..df27ede1bc 100644 --- a/rye/tests/test_add.rs +++ b/rye/tests/test_add.rs @@ -27,7 +27,7 @@ fn test_add_flask() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] - Resolved 8 packages in [EXECUTION_TIME] + Resolved 9 packages in [EXECUTION_TIME] Downloaded 8 packages in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 @@ -63,7 +63,7 @@ fn test_add_flask_dotenv() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] - Resolved 9 packages in [EXECUTION_TIME] + Resolved 10 packages in [EXECUTION_TIME] Downloaded 9 packages in [EXECUTION_TIME] Installed 10 packages in [EXECUTION_TIME] + blinker==1.7.0 @@ -116,7 +116,7 @@ fn test_add_from_find_links() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] - Resolved 2 packages in [EXECUTION_TIME] + Resolved 3 packages in [EXECUTION_TIME] Downloaded 2 packages in [EXECUTION_TIME] Installed 3 packages in [EXECUTION_TIME] + colorama==0.4.6 @@ -148,7 +148,7 @@ fn test_add_flask_wrong_venv_exported() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] - Resolved 8 packages in [EXECUTION_TIME] + Resolved 9 packages in [EXECUTION_TIME] Downloaded 8 packages in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 @@ -183,7 +183,7 @@ fn test_add_explicit_version_or_url() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] - Resolved 2 packages in [EXECUTION_TIME] + Resolved 3 packages in [EXECUTION_TIME] Downloaded 2 packages in [EXECUTION_TIME] Installed 3 packages in [EXECUTION_TIME] + markupsafe==2.1.3 @@ -205,7 +205,7 @@ fn test_add_explicit_version_or_url() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] - Resolved 1 package in [EXECUTION_TIME] + Resolved 4 packages in [EXECUTION_TIME] Downloaded 1 package in [EXECUTION_TIME] Uninstalled 1 package in [EXECUTION_TIME] Installed 2 packages in [EXECUTION_TIME] diff --git a/rye/tests/test_cli.rs b/rye/tests/test_cli.rs index 18dd47b482..bd754a8657 100644 --- a/rye/tests/test_cli.rs +++ b/rye/tests/test_cli.rs @@ -34,6 +34,7 @@ fn test_dotenv() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] + Resolved 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); diff --git a/rye/tests/test_init.rs b/rye/tests/test_init.rs index 8b6ab12a0e..d20a9522ab 100644 --- a/rye/tests/test_init.rs +++ b/rye/tests/test_init.rs @@ -30,6 +30,7 @@ fn test_init_lib() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] + Resolved 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); @@ -78,6 +79,7 @@ fn test_init_default() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] + Resolved 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); @@ -127,6 +129,7 @@ fn test_init_script() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] + Resolved 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); diff --git a/rye/tests/test_sync.rs b/rye/tests/test_sync.rs index 61bf9e768b..7b3faa8bc3 100644 --- a/rye/tests/test_sync.rs +++ b/rye/tests/test_sync.rs @@ -23,6 +23,7 @@ fn test_empty_sync() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] + Resolved 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); @@ -71,7 +72,7 @@ fn test_add_and_sync_no_auto_sync() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] - Resolved 8 packages in [EXECUTION_TIME] + Resolved 9 packages in [EXECUTION_TIME] Downloaded 8 packages in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 @@ -107,7 +108,7 @@ fn test_add_autosync() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] - Resolved 8 packages in [EXECUTION_TIME] + Resolved 9 packages in [EXECUTION_TIME] Downloaded 8 packages in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 @@ -145,6 +146,7 @@ fn test_autosync_remember() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] + Resolved 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); @@ -165,7 +167,7 @@ fn test_autosync_remember() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] - Resolved 8 packages in [EXECUTION_TIME] + Resolved 9 packages in [EXECUTION_TIME] Downloaded 8 packages in [EXECUTION_TIME] Uninstalled 1 package in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] @@ -218,7 +220,7 @@ fn test_autosync_remember() { ----- stderr ----- Built 1 editable in [EXECUTION_TIME] - Resolved 1 package in [EXECUTION_TIME] + Resolved 10 packages in [EXECUTION_TIME] Downloaded 1 package in [EXECUTION_TIME] Uninstalled 1 package in [EXECUTION_TIME] Installed 2 packages in [EXECUTION_TIME] diff --git a/rye/tests/test_test.rs b/rye/tests/test_test.rs index c23b24f9f9..38d2d95be2 100644 --- a/rye/tests/test_test.rs +++ b/rye/tests/test_test.rs @@ -91,7 +91,7 @@ fn test_basic_tool_behavior() { ----- stderr ----- Built 2 editables in [EXECUTION_TIME] - Resolved 3 packages in [EXECUTION_TIME] + Resolved 7 packages in [EXECUTION_TIME] Downloaded 3 packages in [EXECUTION_TIME] Installed 7 packages in [EXECUTION_TIME] + child-dep==0.1.0 (from file:[TEMP_PATH]/project/child-dep) From 703cf9ea9617cb7c22cb00a9facdc6bfd3033920 Mon Sep 17 00:00:00 2001 From: Timothy Edmund Crosley Date: Thu, 23 May 2024 14:52:39 -0400 Subject: [PATCH 17/49] Fix install instructions on README.md for mac/linux (#1114) On latest Ubuntu current install instructions result with an error: ``` user@user-laptop:~$ curl -sSf https://rye.astral.sh/get | sh sh: 2: set: Illegal option -o pipefail ``` While using the instructions on the official website: https://rye.astral.sh/ work as expected. This PR updates the README.md version to match --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d5af94451..82d1df2455 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ The installation takes just a minute: * **Linux and macOS:** ``` - curl -sSf https://rye.astral.sh/get | sh + curl -sSf https://rye.astral.sh/get | bash ``` * **Windows:** From ec1e5135e2d1c86a1287e7f19af837142da381cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 May 2024 13:02:58 +0000 Subject: [PATCH 18/49] Sync UV Releases (#1115) --- rye/src/sources/generated/uv_downloads.inc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/rye/src/sources/generated/uv_downloads.inc b/rye/src/sources/generated/uv_downloads.inc index 7636650dbb..8f1fbe2d55 100644 --- a/rye/src/sources/generated/uv_downloads.inc +++ b/rye/src/sources/generated/uv_downloads.inc @@ -2,11 +2,10 @@ // 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: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("4533c5a3f81f64dbcf9fd154cfa5e1cf904e4d9698eca63ec6a209f554a0beb9") }, - UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("fa01c8584e6dbea991e9f14e50ad33e51c1a321cabedae738075fe58ee5a3ab7") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("e3c321c02572db320f1f6555da93fa0a2550cee84be49df8890f45dba49cc31c") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("e81b97d0dc2756b7ca632d1344d9dcdf0dd3d127f1c4b134c338a05b28454e8a") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("4c0acbde53ce0fec440379c112bcc6beafd924dbbd6717d97e92245473d1e51a") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("fdfede202032b74e3a3e94034c26e23607b4a4326625953f48eae74c1f7d4d0b") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 2, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.2/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("d19904a4eb2dca1b654639e82fc0327957c73427e504492005645f62d2205a3b") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 3, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.3/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("20e466f87ebeda26da0fff5306ad998375fe1e27d2514e4b4f5711f9fad6bcee") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 3, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.3/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("4f9c95a4f10ca3a35ef3d7c84b02ee473826ca3089c0e701c84efaf9bc5dd1dc") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 3, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.3/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("1e9a60953f4c7910bc2a28e1b131cad975c4e0b8e4c1616a2c494160badfd330") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 3, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.3/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("79c28e2121d4299a2190ab0c8f149d676a6d623a4396c86cda947a9280f494a8") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 3, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.3/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("c02509cee8e75ac1e17ea0101c4e0d624a8e4e033eb74d3fd50d7f06d30ff949") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 3, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.3/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("d94b9f679b3718ed0f62eee1126f02f1552301b7dc473a7dc3727f20b889e057") }, ]; From c14f2a73f4c7525b0d47667d5819bc26a3f4df42 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 00:40:25 +0000 Subject: [PATCH 19/49] Sync UV Releases (#1117) --- rye/src/sources/generated/uv_downloads.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rye/src/sources/generated/uv_downloads.inc b/rye/src/sources/generated/uv_downloads.inc index 8f1fbe2d55..0d46d39f29 100644 --- a/rye/src/sources/generated/uv_downloads.inc +++ b/rye/src/sources/generated/uv_downloads.inc @@ -2,10 +2,10 @@ // 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: 3, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.3/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("20e466f87ebeda26da0fff5306ad998375fe1e27d2514e4b4f5711f9fad6bcee") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 3, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.3/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("4f9c95a4f10ca3a35ef3d7c84b02ee473826ca3089c0e701c84efaf9bc5dd1dc") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 3, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.3/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("1e9a60953f4c7910bc2a28e1b131cad975c4e0b8e4c1616a2c494160badfd330") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 3, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.3/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("79c28e2121d4299a2190ab0c8f149d676a6d623a4396c86cda947a9280f494a8") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 3, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.3/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("c02509cee8e75ac1e17ea0101c4e0d624a8e4e033eb74d3fd50d7f06d30ff949") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 3, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.3/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("d94b9f679b3718ed0f62eee1126f02f1552301b7dc473a7dc3727f20b889e057") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 4, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.4/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("2edcd05f37e6f1c44aba1388086768dbc53777473c354feef3033fcb5cc3434a") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 4, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.4/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("4e6255288f9041070bb0736b4626ddbe9b8933ff5e067224584c9ca14867902f") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 4, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.4/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("7f78cc0b7f0316500539f8c9e4f4077c2a94d015673c1aa6ac9402dc8f35ebd4") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 4, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.4/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("a5bd83234920728797fc523e2aa3605c45c7c3ca760e611c4071943cf109e58d") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 4, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.4/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("60599a616c7ea04b2c6a4baac30de0b70e3d934795b672eef73298fdf187656a") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 4, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.4/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("2c470b016f749063080fefc5dd19176bd25b9761033df9df7b5ab914eba1a8e5") }, ]; From 2107ff0617affa503fcb71eb18f3f31457693c2a Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 29 May 2024 23:57:39 -0400 Subject: [PATCH 20/49] Fix CLI deserialization of PowerShell (powershell) (#1125) Closes https://github.com/astral-sh/rye/issues/1124. --- rye/src/cli/rye.rs | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index ad5e2fcebd..b744bb0b7c 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -7,6 +7,7 @@ use std::sync::Arc; use std::{env, fs}; use anyhow::{anyhow, bail, Context, Error}; +use clap::builder::PossibleValue; use clap::{CommandFactory, Parser, ValueEnum}; use clap_complete::{Generator, Shell}; use clap_complete_nushell::Nushell; @@ -53,7 +54,7 @@ pub struct Args { command: SubCommand, } -#[derive(Clone, Debug, ValueEnum)] +#[derive(Clone, Debug)] enum ShellCompletion { /// Bourne Again SHell (bash) Bash, @@ -69,6 +70,32 @@ enum ShellCompletion { Nushell, } +impl ValueEnum for ShellCompletion { + /// Returns the variants for the shell completion. + fn value_variants<'a>() -> &'a [Self] { + &[ + ShellCompletion::Bash, + ShellCompletion::Elvish, + ShellCompletion::Fish, + ShellCompletion::PowerShell, + ShellCompletion::Zsh, + ShellCompletion::Nushell, + ] + } + + /// Returns the possible value for the shell completion. + fn to_possible_value<'a>(&self) -> Option { + Some(match self { + ShellCompletion::Bash => PossibleValue::new("bash"), + ShellCompletion::Elvish => PossibleValue::new("elvish"), + ShellCompletion::Fish => PossibleValue::new("fish"), + ShellCompletion::PowerShell => PossibleValue::new("powershell"), + ShellCompletion::Zsh => PossibleValue::new("zsh"), + ShellCompletion::Nushell => PossibleValue::new("nushell"), + }) + } +} + impl Generator for ShellCompletion { /// Generate the file name for the completion script. fn file_name(&self, name: &str) -> String { From 7828a2841813bab96d1ab6f7cbc5729e2d9c21d2 Mon Sep 17 00:00:00 2001 From: asmith26 Date: Mon, 24 Jun 2024 13:32:31 +0100 Subject: [PATCH 21/49] Add ability to specify option to generate hashes within pyproject.toml (#1129) Please note: I haven't written any Rust before, but just wanted this feature hence thought I'd try submitting a PR for this. I've essentially tried to mimic the code regarding the `--with-sources` feature. I'm not sure how to compile and test locally (so welcome any info on this - and if helpful I would be happy to test this locally and get back to confirm if this works). All thoughts/help/feedback etc. very welcome, and no worries if this feature is not useful. - Adds ability to specify option to generate hashes via the pyproject.toml (similar to https://rye.astral.sh/guide/pyproject/#toolryelock-with-sources). - Updates doc regarding the `--generate-hashes` option too. - Added [`+++ 0.35.0`](https://github.com/astral-sh/rye/pull/1129/files#diff-8ea7c706930a01df775defe815afe2478a41699e0ac0b99d7b069c0fe0d9f45fR65) to the doc in case it gets merged for this version, but feel free to amend as appropriate. Thanks! --- docs/guide/commands/lock.md | 2 ++ docs/guide/commands/sync.md | 2 ++ docs/guide/pyproject.md | 13 +++++++++++++ rye/src/pyproject.rs | 23 ++++++++++++++++++++++- rye/src/sync.rs | 5 +++++ 5 files changed, 44 insertions(+), 1 deletion(-) diff --git a/docs/guide/commands/lock.md b/docs/guide/commands/lock.md index 7fe3506541..079f69363d 100644 --- a/docs/guide/commands/lock.md +++ b/docs/guide/commands/lock.md @@ -30,6 +30,8 @@ Done! * `--all-features`: Enables all features +* `--generate-hashes`: Set to true to lock with hashes in the lockfile + * `--with-sources`: Set to true to lock with sources in the lockfile * `--pyproject `: Use this pyproject.toml file diff --git a/docs/guide/commands/sync.md b/docs/guide/commands/sync.md index 2a1ad45921..df85869325 100644 --- a/docs/guide/commands/sync.md +++ b/docs/guide/commands/sync.md @@ -53,6 +53,8 @@ To exit the sub shell run `exit`. * `--all-features`: Enables all features +* `--generate-hashes`: Set to true to lock with hashes in the lockfile + * `--with-sources`: Set to true to lock with sources in the lockfile * `--pyproject `: Use this pyproject.toml file diff --git a/docs/guide/pyproject.md b/docs/guide/pyproject.md index 34db616b37..44317384a4 100644 --- a/docs/guide/pyproject.md +++ b/docs/guide/pyproject.md @@ -60,6 +60,19 @@ pulled in as indirect dependencies. These are added here automatically with `ry excluded-dependencies = ["cffi"] ``` +## `tool.rye.generate-hashes` + ++++ 0.35.0 + +When this flag is enabled all `lock` and `sync` operations in the project or workspace +operate as if `--generate-hashes` is passed. This means that all dependencies in all +lock files will include a hash. + +```toml +[tool.rye] +generate-hashes = true +``` + ## `tool.rye.lock-with-sources` +++ 0.18.0 diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index bf32b073f4..da8b847487 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -535,6 +535,11 @@ impl Workspace { is_rye_managed(&self.doc) } + /// Should requirements.txt based locking include generating hashes? + pub fn generate_hashes(&self) -> bool { + generate_hashes(&self.doc) + } + /// Should requirements.txt based locking include a find-links reference? pub fn lock_with_sources(&self) -> bool { lock_with_sources(&self.doc) @@ -1006,7 +1011,15 @@ impl PyProject { .unwrap_or(false) } - /// Should requirements.txt based locking include a find-links reference? + /// Should requirements.txt-based locking include generating hashes? + pub fn generate_hashes(&self) -> bool { + match self.workspace { + Some(ref workspace) => workspace.generate_hashes(), + None => generate_hashes(&self.doc), + } + } + + /// Should requirements.txt-based locking include a find-links reference? pub fn lock_with_sources(&self) -> bool { match self.workspace { Some(ref workspace) => workspace.lock_with_sources(), @@ -1280,6 +1293,14 @@ fn is_rye_managed(doc: &DocumentMut) -> bool { .unwrap_or(false) } +fn generate_hashes(doc: &DocumentMut) -> bool { + doc.get("tool") + .and_then(|x| x.get("rye")) + .and_then(|x| x.get("generate-hashes")) + .and_then(|x| x.as_bool()) + .unwrap_or(false) +} + fn lock_with_sources(doc: &DocumentMut) -> bool { doc.get("tool") .and_then(|x| x.get("rye")) diff --git a/rye/src/sync.rs b/rye/src/sync.rs index 5ab816a616..589680e775 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -105,6 +105,11 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { bail!("cannot sync or generate lockfile: package needs 'pyproject.toml'"); } + // Turn on generate_hashes if the project demands it. + if pyproject.generate_hashes() { + cmd.lock_options.generate_hashes = true; + } + // Turn on locking with sources if the project demands it. if pyproject.lock_with_sources() { cmd.lock_options.with_sources = true; From 7412ee432c5bc0eb6aa4e54b9d407a3cc01e34a9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:53:50 +0000 Subject: [PATCH 22/49] Sync UV Releases (#1123) --- rye/src/sources/generated/uv_downloads.inc | 13 +++++++------ rye/tests/test_add.rs | 18 ++++++------------ rye/tests/test_cli.rs | 2 +- rye/tests/test_init.rs | 6 +++--- rye/tests/test_sync.rs | 16 ++++++---------- rye/tests/test_test.rs | 3 +-- 6 files changed, 24 insertions(+), 34 deletions(-) diff --git a/rye/src/sources/generated/uv_downloads.inc b/rye/src/sources/generated/uv_downloads.inc index 0d46d39f29..98642d5941 100644 --- a/rye/src/sources/generated/uv_downloads.inc +++ b/rye/src/sources/generated/uv_downloads.inc @@ -2,10 +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: 4, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.4/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("2edcd05f37e6f1c44aba1388086768dbc53777473c354feef3033fcb5cc3434a") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 4, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.4/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("4e6255288f9041070bb0736b4626ddbe9b8933ff5e067224584c9ca14867902f") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 4, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.4/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("7f78cc0b7f0316500539f8c9e4f4077c2a94d015673c1aa6ac9402dc8f35ebd4") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 4, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.4/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("a5bd83234920728797fc523e2aa3605c45c7c3ca760e611c4071943cf109e58d") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 4, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.4/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("60599a616c7ea04b2c6a4baac30de0b70e3d934795b672eef73298fdf187656a") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 4, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.4/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("2c470b016f749063080fefc5dd19176bd25b9761033df9df7b5ab914eba1a8e5") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("f588388d2b13f77e4526e619f618a306b6b026a96975fbfb2c6dd1ded134cb72") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("f342442088a56a8a5e4af6781501870bed1b388b37ac2e9deb250cd1d0dc1845") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("644e97188d6f4d96e0b149992958c20cce928ad0f4ab4800e0fed70ae16198ef") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("aa94cec4368c615297aa4d81ab81c9034b4a40d66c75854002f0e26857e659a5") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("6262eba42ebb9035a574b74c5ea253a41353fb4b6b264600e3b05b1a7f4cabc0") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("898ce45b3767ea97429426a7bd0ec54d070eb9e29ff2b072bdcf288bf6ddc9a1") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("3f96048fa1b82eca14d45bbcc86714cd0dee19a73ef9311da6707faa308ec25f") }, ]; diff --git a/rye/tests/test_add.rs b/rye/tests/test_add.rs index df27ede1bc..447b932a83 100644 --- a/rye/tests/test_add.rs +++ b/rye/tests/test_add.rs @@ -26,9 +26,8 @@ fn test_add_flask() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 9 packages in [EXECUTION_TIME] - Downloaded 8 packages in [EXECUTION_TIME] + Downloaded 9 packages in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 + click==8.1.7 @@ -62,9 +61,8 @@ fn test_add_flask_dotenv() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 10 packages in [EXECUTION_TIME] - Downloaded 9 packages in [EXECUTION_TIME] + Downloaded 10 packages in [EXECUTION_TIME] Installed 10 packages in [EXECUTION_TIME] + blinker==1.7.0 + click==8.1.7 @@ -115,9 +113,8 @@ fn test_add_from_find_links() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 3 packages in [EXECUTION_TIME] - Downloaded 2 packages in [EXECUTION_TIME] + Downloaded 3 packages in [EXECUTION_TIME] Installed 3 packages in [EXECUTION_TIME] + colorama==0.4.6 + my-project==0.1.0 (from file:[TEMP_PATH]/project) @@ -147,9 +144,8 @@ fn test_add_flask_wrong_venv_exported() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 9 packages in [EXECUTION_TIME] - Downloaded 8 packages in [EXECUTION_TIME] + Downloaded 9 packages in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 + click==8.1.7 @@ -182,9 +178,8 @@ fn test_add_explicit_version_or_url() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 3 packages in [EXECUTION_TIME] - Downloaded 2 packages in [EXECUTION_TIME] + Downloaded 3 packages in [EXECUTION_TIME] Installed 3 packages in [EXECUTION_TIME] + markupsafe==2.1.3 + my-project==0.1.0 (from file:[TEMP_PATH]/project) @@ -204,9 +199,8 @@ fn test_add_explicit_version_or_url() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 4 packages in [EXECUTION_TIME] - Downloaded 1 package in [EXECUTION_TIME] + Downloaded 2 packages in [EXECUTION_TIME] Uninstalled 1 package in [EXECUTION_TIME] Installed 2 packages in [EXECUTION_TIME] - my-project==0.1.0 (from file:[TEMP_PATH]/project) diff --git a/rye/tests/test_cli.rs b/rye/tests/test_cli.rs index bd754a8657..a1197014fa 100644 --- a/rye/tests/test_cli.rs +++ b/rye/tests/test_cli.rs @@ -33,8 +33,8 @@ fn test_dotenv() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 1 package in [EXECUTION_TIME] + Downloaded 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); diff --git a/rye/tests/test_init.rs b/rye/tests/test_init.rs index d20a9522ab..83e0091e7c 100644 --- a/rye/tests/test_init.rs +++ b/rye/tests/test_init.rs @@ -29,8 +29,8 @@ fn test_init_lib() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 1 package in [EXECUTION_TIME] + Downloaded 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); @@ -78,8 +78,8 @@ fn test_init_default() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 1 package in [EXECUTION_TIME] + Downloaded 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); @@ -128,8 +128,8 @@ fn test_init_script() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 1 package in [EXECUTION_TIME] + Downloaded 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); diff --git a/rye/tests/test_sync.rs b/rye/tests/test_sync.rs index 7b3faa8bc3..852d86441c 100644 --- a/rye/tests/test_sync.rs +++ b/rye/tests/test_sync.rs @@ -22,8 +22,8 @@ fn test_empty_sync() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 1 package in [EXECUTION_TIME] + Downloaded 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); @@ -71,9 +71,8 @@ fn test_add_and_sync_no_auto_sync() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 9 packages in [EXECUTION_TIME] - Downloaded 8 packages in [EXECUTION_TIME] + Downloaded 9 packages in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 + click==8.1.7 @@ -107,9 +106,8 @@ fn test_add_autosync() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 9 packages in [EXECUTION_TIME] - Downloaded 8 packages in [EXECUTION_TIME] + Downloaded 9 packages in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 + click==8.1.7 @@ -145,8 +143,8 @@ fn test_autosync_remember() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 1 package in [EXECUTION_TIME] + Downloaded 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); @@ -166,9 +164,8 @@ fn test_autosync_remember() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 9 packages in [EXECUTION_TIME] - Downloaded 8 packages in [EXECUTION_TIME] + Downloaded 9 packages in [EXECUTION_TIME] Uninstalled 1 package in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 @@ -219,9 +216,8 @@ fn test_autosync_remember() { Done! ----- stderr ----- - Built 1 editable in [EXECUTION_TIME] Resolved 10 packages in [EXECUTION_TIME] - Downloaded 1 package in [EXECUTION_TIME] + Downloaded 2 packages in [EXECUTION_TIME] Uninstalled 1 package in [EXECUTION_TIME] Installed 2 packages in [EXECUTION_TIME] - my-project==0.1.0 (from file:[TEMP_PATH]/project) diff --git a/rye/tests/test_test.rs b/rye/tests/test_test.rs index 38d2d95be2..9ccd3c4af7 100644 --- a/rye/tests/test_test.rs +++ b/rye/tests/test_test.rs @@ -90,9 +90,8 @@ fn test_basic_tool_behavior() { ========================= 1 failed, 1 passed in [EXECUTION_TIME] ========================= ----- stderr ----- - Built 2 editables in [EXECUTION_TIME] Resolved 7 packages in [EXECUTION_TIME] - Downloaded 3 packages in [EXECUTION_TIME] + Downloaded 7 packages in [EXECUTION_TIME] Installed 7 packages in [EXECUTION_TIME] + child-dep==0.1.0 (from file:[TEMP_PATH]/project/child-dep) + colorama==0.4.6 From 5df957d1b562b1e2deec820fc30e01d1fe9c7889 Mon Sep 17 00:00:00 2001 From: zys864 <616561164@qq.com> Date: Mon, 24 Jun 2024 20:56:35 +0800 Subject: [PATCH 23/49] improve config.toml error msg (#1155) improve config.toml error msg when I write a unvalid config.toml ```toml [[sources]] # name = "company-internal" url = "https://company.internal/simple/" ``` the before msg is very strange: `error: expected name` after: `error: bad config.toml syntax,expected source.name` --- rye/src/config.rs | 3 ++- rye/src/pyproject.rs | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/rye/src/config.rs b/rye/src/config.rs index 2d151d9966..dd173268d6 100644 --- a/rye/src/config.rs +++ b/rye/src/config.rs @@ -232,7 +232,8 @@ impl Config { if let Some(sources) = self.doc.get("sources").map(|x| toml::iter_tables(x)) { for source in sources { let source = source.context("invalid value for source in config.toml")?; - let source_ref = SourceRef::from_toml_table(source)?; + let source_ref = SourceRef::from_toml_table(source) + .context("invalid source definition in config.toml")?; if source_ref.name == "default" { need_default = false; } diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index da8b847487..600e02e606 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -152,12 +152,12 @@ impl SourceRef { .get("name") .and_then(|x| x.as_str()) .map(|x| x.to_string()) - .ok_or_else(|| anyhow!("expected name"))?; + .ok_or_else(|| anyhow!("expected source.name"))?; let url = source .get("url") .and_then(|x| x.as_str()) .map(|x| x.to_string()) - .ok_or_else(|| anyhow!("expected url"))?; + .ok_or_else(|| anyhow!("expected source.url"))?; let verify_ssl = source .get("verify_ssl") .and_then(|x| x.as_bool()) @@ -174,7 +174,7 @@ impl SourceRef { .get("type") .and_then(|x| x.as_str()) .map_or(Ok(SourceRefType::Index), |x| x.parse::()) - .context("invalid value for type")?; + .context("invalid value for source.type")?; Ok(SourceRef { name, url, @@ -1265,7 +1265,8 @@ fn get_sources(doc: &DocumentMut) -> Result, Error> { { for source in sources { let source = source.context("invalid value for pyproject.toml's tool.rye.sources")?; - let source_ref = SourceRef::from_toml_table(source)?; + let source_ref = SourceRef::from_toml_table(source) + .context("invalid source definition in pyproject.toml")?; rv.push(source_ref); } } @@ -1320,6 +1321,7 @@ fn get_project_metadata(path: &Path) -> Result { } serde_json::from_slice(&metadata.stdout).map_err(Into::into) } + /// Represents expanded sources. #[derive(Debug, Clone, Serialize)] pub struct ExpandedSources { From a1dbc56d424cef520564548618d5e31eea2e0c17 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 24 Jun 2024 16:06:13 +0300 Subject: [PATCH 24/49] Prep for v0.35.0 release (#1169) --- CHANGELOG.md | 14 +++++++++++++- Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f897126aa8..1cb52399fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ that were not yet released. +## 0.35.0 + +Released on 2024-06-24. + +* Enforce `--pre` when auto-syncing by @charliermarsh in https://github.com/astral-sh/rye/pull/1107 +* Move from `rye-up.com` to `rye.astral.sh` by @charliermarsh in https://github.com/astral-sh/rye/pull/1113 +* Fix install instructions on README.md for mac/linux by @timothycrosley in https://github.com/astral-sh/rye/pull/1114 +* Fix CLI deserialization of PowerShell (`powershell`) by @charliermarsh in https://github.com/astral-sh/rye/pull/1125 +* Add ability to specify option to generate hashes within pyproject.toml by @asmith26 in https://github.com/astral-sh/rye/pull/1129 +* Bump uv to 0.2.13 by @charliermarsh in https://github.com/astral-sh/rye/pull/1123 +* Improve `config.toml` error messages by @zys864 in https://github.com/astral-sh/rye/pull/1155 + ## 0.34.0 Released on 2024-05-20. @@ -18,7 +30,7 @@ Released on 2024-05-20. * Allow to generate lockfiles with hashes when using uv by @mvaled in https://github.com/astral-sh/rye/pull/1070 * Bump ruff to 0.4.4 by @davfsa in https://github.com/astral-sh/rye/pull/1075 * Fix TOML array formatting by @my1e5 in https://github.com/astral-sh/rye/pull/1084 -* Bump uv to 0.1.44 in https://github.com/astral-sh/rye/pull/1085 +* Bump uv to 0.1.44 by @charliermarsh in https://github.com/astral-sh/rye/pull/1085 * Discover cosmo-ified (`.com`) binaries on Windows by @mataha in https://github.com/astral-sh/rye/pull/1091 * Write `use-uv = true` in no-prompt mode by @charliermarsh in https://github.com/astral-sh/rye/pull/1098 diff --git a/Cargo.lock b/Cargo.lock index 3a7d4b0e21..e2d27c9ead 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1799,7 +1799,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.34.0" +version = "0.35.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 3e7ae93977..012e1f1890 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.34.0" +version = "0.35.0" edition = "2021" license = "MIT" From 288bf4ea5cf7f3e3311a324f94bea278c77842d0 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 24 Jun 2024 16:53:54 +0300 Subject: [PATCH 25/49] Upgrade pyyaml to v6.0.1 (#1170) ## Summary It looks like `pyyaml==6.0.0` has a faulty source distribution that we can't build (`pip install pyyaml==6.0.0 --no-cache --force-reinstall --no-binary pyyaml` fails). But `pyyaml==6.0.1` works as expected. The documentation seems to build in a musl container, so it has to build from source. --- requirements-dev.lock | 45 ++++++++++++++++++++++--------------------- requirements.lock | 43 +++++++++++++++++++++-------------------- 2 files changed, 45 insertions(+), 43 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index df89841004..70c818ffe0 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -6,17 +6,18 @@ # features: [] # all-features: false # with-sources: false +# generate-hashes: false -e file:rye-devtools -anyio==4.2.0 +anyio==4.4.0 # via httpx -certifi==2023.5.7 +certifi==2024.6.2 # via httpcore # via httpx # via requests -charset-normalizer==3.1.0 +charset-normalizer==3.3.2 # via requests -click==8.1.3 +click==8.1.7 # via mkdocs colorama==0.4.6 # via mkdocs-material @@ -24,17 +25,17 @@ ghp-import==2.1.0 # via mkdocs h11==0.14.0 # via httpcore -httpcore==1.0.2 +httpcore==1.0.5 # via httpx -httpx==0.26.0 +httpx==0.27.0 # via rye-devtools -idna==3.4 +idna==3.7 # via anyio # via httpx # via requests iniconfig==2.0.0 # via pytest -jinja2==3.1.2 +jinja2==3.1.4 # via mkdocs # via mkdocs-material markdown==3.3.7 @@ -42,50 +43,50 @@ markdown==3.3.7 # via mkdocs # via mkdocs-material # via pymdown-extensions -markupsafe==2.1.2 +markupsafe==2.1.5 # via jinja2 -mdx-gh-links==0.3 +mdx-gh-links==0.4 mergedeep==1.3.4 # via mkdocs mkdocs==1.4.3 # via mkdocs-material # via mkdocs-simple-hooks mkdocs-include-markdown-plugin==4.0.4 -mkdocs-material==9.1.12 -mkdocs-material-extensions==1.1.1 +mkdocs-material==9.1.20 +mkdocs-material-extensions==1.3.1 # via mkdocs-material mkdocs-simple-hooks==0.1.5 mkdocs-version-annotations==1.0.0 -packaging==23.1 +packaging==24.1 # via mkdocs # via pytest -pluggy==1.4.0 +pluggy==1.5.0 # via pytest -pygments==2.15.1 +pygments==2.18.0 # via mkdocs-material pymdown-extensions==9.11 # via mkdocs-material pytest==8.0.2 -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via ghp-import -pyyaml==6.0 +pyyaml==6.0.1 # via mkdocs # via pymdown-extensions # via pyyaml-env-tag pyyaml-env-tag==0.1 # via mkdocs -regex==2023.5.5 +regex==2024.5.15 # via mkdocs-material -requests==2.31.0 +requests==2.32.3 # via mkdocs-material six==1.16.0 # via python-dateutil -sniffio==1.3.0 +sniffio==1.3.1 # via anyio # via httpx socksio==1.0.0 # via httpx -urllib3==2.0.2 +urllib3==2.2.2 # via requests -watchdog==3.0.0 +watchdog==4.0.1 # via mkdocs diff --git a/requirements.lock b/requirements.lock index c18881bfc2..c2cd892a2d 100644 --- a/requirements.lock +++ b/requirements.lock @@ -6,17 +6,18 @@ # features: [] # all-features: false # with-sources: false +# generate-hashes: false -e file:rye-devtools -anyio==4.2.0 +anyio==4.4.0 # via httpx -certifi==2023.5.7 +certifi==2024.6.2 # via httpcore # via httpx # via requests -charset-normalizer==3.1.0 +charset-normalizer==3.3.2 # via requests -click==8.1.3 +click==8.1.7 # via mkdocs colorama==0.4.6 # via mkdocs-material @@ -24,15 +25,15 @@ ghp-import==2.1.0 # via mkdocs h11==0.14.0 # via httpcore -httpcore==1.0.2 +httpcore==1.0.5 # via httpx -httpx==0.26.0 +httpx==0.27.0 # via rye-devtools -idna==3.4 +idna==3.7 # via anyio # via httpx # via requests -jinja2==3.1.2 +jinja2==3.1.4 # via mkdocs # via mkdocs-material markdown==3.3.7 @@ -40,46 +41,46 @@ markdown==3.3.7 # via mkdocs # via mkdocs-material # via pymdown-extensions -markupsafe==2.1.2 +markupsafe==2.1.5 # via jinja2 -mdx-gh-links==0.3 +mdx-gh-links==0.4 mergedeep==1.3.4 # via mkdocs mkdocs==1.4.3 # via mkdocs-material # via mkdocs-simple-hooks mkdocs-include-markdown-plugin==4.0.4 -mkdocs-material==9.1.12 -mkdocs-material-extensions==1.1.1 +mkdocs-material==9.1.20 +mkdocs-material-extensions==1.3.1 # via mkdocs-material mkdocs-simple-hooks==0.1.5 mkdocs-version-annotations==1.0.0 -packaging==23.1 +packaging==24.1 # via mkdocs -pygments==2.15.1 +pygments==2.18.0 # via mkdocs-material pymdown-extensions==9.11 # via mkdocs-material -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via ghp-import -pyyaml==6.0 +pyyaml==6.0.1 # via mkdocs # via pymdown-extensions # via pyyaml-env-tag pyyaml-env-tag==0.1 # via mkdocs -regex==2023.5.5 +regex==2024.5.15 # via mkdocs-material -requests==2.31.0 +requests==2.32.3 # via mkdocs-material six==1.16.0 # via python-dateutil -sniffio==1.3.0 +sniffio==1.3.1 # via anyio # via httpx socksio==1.0.0 # via httpx -urllib3==2.0.2 +urllib3==2.2.2 # via requests -watchdog==3.0.0 +watchdog==4.0.1 # via mkdocs From 98d7abb0ddb13db3ffc856e108c108b584a4284c Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 27 Jun 2024 20:54:57 -0400 Subject: [PATCH 26/49] Update links to behavior quirks guide (#1178) Closes https://github.com/astral-sh/rye/issues/1176. --- docs/guide/faq.md | 2 +- docs/guide/toolchains/cpython.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/guide/faq.md b/docs/guide/faq.md index b3bc103bd8..fea5a2a7ea 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -133,7 +133,7 @@ due to limitations in `libedit`. In some cases though you might also discover t the backspace key does not work or arrow keys don't work as expected. This can be because the _terminfo_ database cannot be found. -For solutions to this issue, read the [behavior quirks guide](https://python-build-standalone.readthedocs.io/en/latest/quirks.html) in the +For solutions to this issue, read the [behavior quirks guide](https://gregoryszorc.com/docs/python-build-standalone/main/quirks.html) in the Standalone Python Builds documentation for solutions. ## Can I use Rye Alongside Other Python Installations? diff --git a/docs/guide/toolchains/cpython.md b/docs/guide/toolchains/cpython.md index b676b6d609..e78bdade18 100644 --- a/docs/guide/toolchains/cpython.md +++ b/docs/guide/toolchains/cpython.md @@ -37,8 +37,8 @@ The following changes to a regular Python versions you should be aware of: Additionally due to how these builds are created, there are some other quirks you might run into related to terminal support or TKinter. Some of these -issues are collected in the [FAQ](../faq.md). Additionally the Python -Standalone Builds have a [Behavior Quirks](https://python-build-standalone.readthedocs.io/en/latest/quirks.html) +issues are collected in the [FAQ](../faq.md). Additionally, the Python +Standalone Builds have a [Behavior Quirks](https://gregoryszorc.com/docs/python-build-standalone/main/quirks.html) page. ## Sources From 03d535d29a4f26ed68f446268fb90484b6024e90 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 01:01:13 +0000 Subject: [PATCH 27/49] Update `uv` to `v0.2.17` (#1171) --- rye/src/sources/generated/uv_downloads.inc | 14 +++++++------- rye/tests/test_add.rs | 12 ++++++------ rye/tests/test_cli.rs | 2 +- rye/tests/test_init.rs | 6 +++--- rye/tests/test_sync.rs | 12 ++++++------ rye/tests/test_test.rs | 2 +- rye/tests/test_tools.rs | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/rye/src/sources/generated/uv_downloads.inc b/rye/src/sources/generated/uv_downloads.inc index 98642d5941..3c5c3628ae 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: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("f588388d2b13f77e4526e619f618a306b6b026a96975fbfb2c6dd1ded134cb72") }, - UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("f342442088a56a8a5e4af6781501870bed1b388b37ac2e9deb250cd1d0dc1845") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("644e97188d6f4d96e0b149992958c20cce928ad0f4ab4800e0fed70ae16198ef") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("aa94cec4368c615297aa4d81ab81c9034b4a40d66c75854002f0e26857e659a5") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("6262eba42ebb9035a574b74c5ea253a41353fb4b6b264600e3b05b1a7f4cabc0") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("898ce45b3767ea97429426a7bd0ec54d070eb9e29ff2b072bdcf288bf6ddc9a1") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 13, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.13/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("3f96048fa1b82eca14d45bbcc86714cd0dee19a73ef9311da6707faa308ec25f") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("7dc5fe97867ac3bbcbeabf32fb76b3caaf12141b5e20926ed81353f9a2ff7dcb") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("5037a966a2422f40c63d36982d46f10362383c128ce1707a56b4339b44a50c94") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("ed5dc4a4341e7af3d92ef0649df6152b555b16e09c072c43f7f39b9d5bdce784") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("d1d478429fdaeadd56ce280bd43460275bd131cd44f9878987d9d7a5caa4f398") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("78137a1b9d6fd1f8f5f0d4208829dd5f89b6505c314192c0fa2a35d6faff5e91") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("e77465f8a964cf0cbd932af506df6ca42ce288e6db4df312c53f27b05c7c09e5") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("d49537780cd9cd5621bbc34e6864356487155cd4a7540035e1b0acb0d1017def") }, ]; diff --git a/rye/tests/test_add.rs b/rye/tests/test_add.rs index 447b932a83..1c8014a0c6 100644 --- a/rye/tests/test_add.rs +++ b/rye/tests/test_add.rs @@ -27,7 +27,7 @@ fn test_add_flask() { ----- stderr ----- Resolved 9 packages in [EXECUTION_TIME] - Downloaded 9 packages in [EXECUTION_TIME] + Prepared 9 packages in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 + click==8.1.7 @@ -62,7 +62,7 @@ fn test_add_flask_dotenv() { ----- stderr ----- Resolved 10 packages in [EXECUTION_TIME] - Downloaded 10 packages in [EXECUTION_TIME] + Prepared 10 packages in [EXECUTION_TIME] Installed 10 packages in [EXECUTION_TIME] + blinker==1.7.0 + click==8.1.7 @@ -114,7 +114,7 @@ fn test_add_from_find_links() { ----- stderr ----- Resolved 3 packages in [EXECUTION_TIME] - Downloaded 3 packages in [EXECUTION_TIME] + Prepared 3 packages in [EXECUTION_TIME] Installed 3 packages in [EXECUTION_TIME] + colorama==0.4.6 + my-project==0.1.0 (from file:[TEMP_PATH]/project) @@ -145,7 +145,7 @@ fn test_add_flask_wrong_venv_exported() { ----- stderr ----- Resolved 9 packages in [EXECUTION_TIME] - Downloaded 9 packages in [EXECUTION_TIME] + Prepared 9 packages in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 + click==8.1.7 @@ -179,7 +179,7 @@ fn test_add_explicit_version_or_url() { ----- stderr ----- Resolved 3 packages in [EXECUTION_TIME] - Downloaded 3 packages in [EXECUTION_TIME] + Prepared 3 packages in [EXECUTION_TIME] Installed 3 packages in [EXECUTION_TIME] + markupsafe==2.1.3 + my-project==0.1.0 (from file:[TEMP_PATH]/project) @@ -200,7 +200,7 @@ fn test_add_explicit_version_or_url() { ----- stderr ----- Resolved 4 packages in [EXECUTION_TIME] - Downloaded 2 packages in [EXECUTION_TIME] + Prepared 2 packages in [EXECUTION_TIME] Uninstalled 1 package in [EXECUTION_TIME] Installed 2 packages in [EXECUTION_TIME] - my-project==0.1.0 (from file:[TEMP_PATH]/project) diff --git a/rye/tests/test_cli.rs b/rye/tests/test_cli.rs index a1197014fa..32db91c2fd 100644 --- a/rye/tests/test_cli.rs +++ b/rye/tests/test_cli.rs @@ -34,7 +34,7 @@ fn test_dotenv() { ----- stderr ----- Resolved 1 package in [EXECUTION_TIME] - Downloaded 1 package in [EXECUTION_TIME] + Prepared 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); diff --git a/rye/tests/test_init.rs b/rye/tests/test_init.rs index 83e0091e7c..6ac9cd456f 100644 --- a/rye/tests/test_init.rs +++ b/rye/tests/test_init.rs @@ -30,7 +30,7 @@ fn test_init_lib() { ----- stderr ----- Resolved 1 package in [EXECUTION_TIME] - Downloaded 1 package in [EXECUTION_TIME] + Prepared 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); @@ -79,7 +79,7 @@ fn test_init_default() { ----- stderr ----- Resolved 1 package in [EXECUTION_TIME] - Downloaded 1 package in [EXECUTION_TIME] + Prepared 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); @@ -129,7 +129,7 @@ fn test_init_script() { ----- stderr ----- Resolved 1 package in [EXECUTION_TIME] - Downloaded 1 package in [EXECUTION_TIME] + Prepared 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); diff --git a/rye/tests/test_sync.rs b/rye/tests/test_sync.rs index 852d86441c..c989c467b8 100644 --- a/rye/tests/test_sync.rs +++ b/rye/tests/test_sync.rs @@ -23,7 +23,7 @@ fn test_empty_sync() { ----- stderr ----- Resolved 1 package in [EXECUTION_TIME] - Downloaded 1 package in [EXECUTION_TIME] + Prepared 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); @@ -72,7 +72,7 @@ fn test_add_and_sync_no_auto_sync() { ----- stderr ----- Resolved 9 packages in [EXECUTION_TIME] - Downloaded 9 packages in [EXECUTION_TIME] + Prepared 9 packages in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 + click==8.1.7 @@ -107,7 +107,7 @@ fn test_add_autosync() { ----- stderr ----- Resolved 9 packages in [EXECUTION_TIME] - Downloaded 9 packages in [EXECUTION_TIME] + Prepared 9 packages in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 + click==8.1.7 @@ -144,7 +144,7 @@ fn test_autosync_remember() { ----- stderr ----- Resolved 1 package in [EXECUTION_TIME] - Downloaded 1 package in [EXECUTION_TIME] + Prepared 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + my-project==0.1.0 (from file:[TEMP_PATH]/project) "###); @@ -165,7 +165,7 @@ fn test_autosync_remember() { ----- stderr ----- Resolved 9 packages in [EXECUTION_TIME] - Downloaded 9 packages in [EXECUTION_TIME] + Prepared 9 packages in [EXECUTION_TIME] Uninstalled 1 package in [EXECUTION_TIME] Installed 9 packages in [EXECUTION_TIME] + blinker==1.7.0 @@ -217,7 +217,7 @@ fn test_autosync_remember() { ----- stderr ----- Resolved 10 packages in [EXECUTION_TIME] - Downloaded 2 packages in [EXECUTION_TIME] + Prepared 2 packages in [EXECUTION_TIME] Uninstalled 1 package in [EXECUTION_TIME] Installed 2 packages in [EXECUTION_TIME] - my-project==0.1.0 (from file:[TEMP_PATH]/project) diff --git a/rye/tests/test_test.rs b/rye/tests/test_test.rs index 9ccd3c4af7..a7ba4992c2 100644 --- a/rye/tests/test_test.rs +++ b/rye/tests/test_test.rs @@ -91,7 +91,7 @@ fn test_basic_tool_behavior() { ----- stderr ----- Resolved 7 packages in [EXECUTION_TIME] - Downloaded 7 packages in [EXECUTION_TIME] + Prepared 7 packages in [EXECUTION_TIME] Installed 7 packages in [EXECUTION_TIME] + child-dep==0.1.0 (from file:[TEMP_PATH]/project/child-dep) + colorama==0.4.6 diff --git a/rye/tests/test_tools.rs b/rye/tests/test_tools.rs index b8b4a047a2..73a2959d8e 100644 --- a/rye/tests/test_tools.rs +++ b/rye/tests/test_tools.rs @@ -36,7 +36,7 @@ fn test_basic_tool_behavior() { ----- stderr ----- Resolved 1 package in [EXECUTION_TIME] - Downloaded 1 package in [EXECUTION_TIME] + Prepared 1 package in [EXECUTION_TIME] Installed 1 package in [EXECUTION_TIME] + pycowsay==0.0.0.2 "###); From c60682fb6bb5c9a0cc2669f263eeed99d2e5be71 Mon Sep 17 00:00:00 2001 From: Elliot Marsden <160757339+emarsden-iso@users.noreply.github.com> Date: Sun, 30 Jun 2024 22:11:31 +0100 Subject: [PATCH 28/49] Pass keyring-provider to uv sync and install (#1183) When calling `uv pip {install,sync}`, the `keyring-provider` argument doesn't get passed, even though `uv` supports these arguments for both. We already have the functionality implemented for `uv pip compile`, so just extend the support to these. Tested locally for both commands, seems to work fine. --- rye/src/cli/install.rs | 5 +++++ rye/src/installer.rs | 3 +++ rye/src/lock.rs | 11 +++++++++++ rye/src/sync.rs | 7 +++++-- rye/src/uv.rs | 31 ++++++++++++++++++++++++------- 5 files changed, 48 insertions(+), 9 deletions(-) diff --git a/rye/src/cli/install.rs b/rye/src/cli/install.rs index 64aeb49d8a..b1e59bb73e 100644 --- a/rye/src/cli/install.rs +++ b/rye/src/cli/install.rs @@ -7,6 +7,7 @@ use pep508_rs::Requirement; use crate::cli::add::ReqExtras; use crate::config::Config; use crate::installer::{install, resolve_local_requirement}; +use crate::lock::KeyringProvider; use crate::sources::py::PythonVersionRequest; use crate::utils::CommandOutput; @@ -29,6 +30,9 @@ pub struct Args { /// Force install the package even if it's already there. #[arg(short, long)] force: bool, + /// Attempt to use `keyring` for authentication for index URLs. + #[arg(long, value_enum, default_value_t)] + keyring_provider: KeyringProvider, /// Enables verbose diagnostics. #[arg(short, long)] verbose: bool, @@ -74,6 +78,7 @@ pub fn execute(mut cmd: Args) -> Result<(), Error> { &cmd.include_dep, &extra_requirements, output, + cmd.keyring_provider, )?; Ok(()) } diff --git a/rye/src/installer.rs b/rye/src/installer.rs index d93adda388..55fd8f4e51 100644 --- a/rye/src/installer.rs +++ b/rye/src/installer.rs @@ -14,6 +14,7 @@ use url::Url; use crate::bootstrap::{ensure_self_venv, fetch, FetchOptions}; use crate::config::Config; use crate::consts::VENV_BIN; +use crate::lock::KeyringProvider; use crate::platform::get_app_dir; use crate::pyproject::{normalize_package_name, read_venv_marker, ExpandedSources}; use crate::sources::py::PythonVersionRequest; @@ -109,6 +110,7 @@ pub fn install( include_deps: &[String], extra_requirements: &[Requirement], output: CommandOutput, + keyring_provider: KeyringProvider, ) -> Result<(), Error> { let config = Config::current(); let sources = ExpandedSources::from_sources(&config.sources()?)?; @@ -154,6 +156,7 @@ pub fn install( importlib_workaround: py_ver.major == 3 && py_ver.minor == 7, extras: extra_requirements.to_vec(), refresh: force, + keyring_provider, }, ); if result.is_err() { diff --git a/rye/src/lock.rs b/rye/src/lock.rs index d910401274..53eebb23b2 100644 --- a/rye/src/lock.rs +++ b/rye/src/lock.rs @@ -73,6 +73,17 @@ pub enum KeyringProvider { Subprocess, } +impl KeyringProvider { + pub fn add_as_pip_args(self, cmd: &mut Command) { + match self { + KeyringProvider::Disabled => {} + KeyringProvider::Subprocess => { + cmd.arg("--keyring-provider").arg("subprocess"); + } + } + } +} + /// Controls how locking should work. #[derive(Debug, Clone, Default, Serialize)] pub struct LockOptions { diff --git a/rye/src/sync.rs b/rye/src/sync.rs index 589680e775..9fb1d34413 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -23,7 +23,7 @@ use crate::utils::{ get_venv_python_bin, set_proxy_variables, symlink_dir, update_venv_sync_marker, CommandOutput, IoPathContext, }; -use crate::uv::UvBuilder; +use crate::uv::{UvBuilder, UvSyncOptions}; /// Controls the sync mode #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Default)] @@ -257,6 +257,9 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { let tempdir = tempdir()?; let py_path = get_venv_python_bin(&venv); if Config::current().use_uv() { + let uv_options = UvSyncOptions { + keyring_provider: cmd.keyring_provider, + }; UvBuilder::new() .with_output(output.quieter()) .with_workdir(&pyproject.workspace_path()) @@ -264,7 +267,7 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { .ensure_exists()? .venv(&venv, &py_path, &py_ver, None)? .with_output(output) - .sync(&target_lockfile)?; + .sync(&target_lockfile, uv_options)?; } else { let mut pip_sync_cmd = Command::new(get_pip_sync(&py_ver, output)?); let root = pyproject.workspace_path(); diff --git a/rye/src/uv.rs b/rye/src/uv.rs index 9dbf87db42..f633cc061c 100644 --- a/rye/src/uv.rs +++ b/rye/src/uv.rs @@ -21,6 +21,7 @@ pub struct UvInstallOptions { pub importlib_workaround: bool, pub extras: Vec, pub refresh: bool, + pub keyring_provider: KeyringProvider, } pub enum UvPackageUpgrade { @@ -76,12 +77,7 @@ impl UvCompileOptions { UvPackageUpgrade::Nothing => {} } - match self.keyring_provider { - KeyringProvider::Disabled => {} - KeyringProvider::Subprocess => { - cmd.arg("--keyring-provider").arg("subprocess"); - } - } + self.keyring_provider.add_as_pip_args(cmd); } } @@ -99,6 +95,23 @@ impl Default for UvCompileOptions { } } +pub struct UvSyncOptions { + pub keyring_provider: KeyringProvider, +} + +impl UvSyncOptions { + pub fn add_as_pip_args(self, cmd: &mut Command) { + self.keyring_provider.add_as_pip_args(cmd); + } +} + +impl Default for UvSyncOptions { + fn default() -> Self { + Self { + keyring_provider: KeyringProvider::Disabled, + } + } +} pub struct UvBuilder { workdir: Option, sources: Option, @@ -502,6 +515,8 @@ impl UvWithVenv { cmd.arg("--refresh"); } + options.keyring_provider.add_as_pip_args(&mut cmd); + self.uv.sources.add_as_pip_args(&mut cmd); cmd.arg("--").arg(requirement.to_string()); @@ -537,10 +552,12 @@ impl UvWithVenv { } /// Syncs the venv - pub fn sync(&self, lockfile: &Path) -> Result<(), Error> { + pub fn sync(&self, lockfile: &Path, options: UvSyncOptions) -> Result<(), Error> { let mut cmd = self.venv_cmd(); cmd.arg("pip").arg("sync"); + options.add_as_pip_args(&mut cmd); + self.uv.sources.add_as_pip_args(&mut cmd); let status = cmd From b88f1ecc0971273d311c0ff6ca01cd79c4fab800 Mon Sep 17 00:00:00 2001 From: Dennis Rall <56480601+dennisrall@users.noreply.github.com> Date: Tue, 2 Jul 2024 21:37:42 +0200 Subject: [PATCH 29/49] docs: add hint for packages on multiple indexes (#1188) --- docs/guide/sources.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/guide/sources.md b/docs/guide/sources.md index cae24beb75..4371da8942 100644 --- a/docs/guide/sources.md +++ b/docs/guide/sources.md @@ -85,6 +85,9 @@ This is a [PEP 503](https://www.python.org/dev/peps/pep-0503/) type index as pro by tools such as PyPI or [devpi](https://github.com/devpi/devpi). It corresponds to the arguments `--index-url` or `--extra-index-url` in pip. +Note: see the [`uv` documentation](https://github.com/astral-sh/uv/blob/main/PIP_COMPATIBILITY.md#packages-that-exist-on-multiple-indexes) +for more on the use of multiple indexes. + ### `find-links` This is a source that can be of a variety of types and has to point to a file path From 11fc495cc2affa1f12b275040a6447b89a6d6c08 Mon Sep 17 00:00:00 2001 From: Lygon Bowen-West Date: Tue, 2 Jul 2024 21:24:06 +0100 Subject: [PATCH 30/49] Pass universal flag down to uv (#1186) Partially addresses https://github.com/astral-sh/rye/issues/1056 Allows parsing the new `--universal` flag down to uv when calling `lock` or `sync`, also adds it as an option to the pyrpoject.toml Tested locally for `lock` and `sync` with command line args and in the pyproject, seems to work. --- docs/guide/pyproject.md | 14 ++++++++++++++ rye/src/cli/lock.rs | 6 +++++- rye/src/cli/sync.rs | 4 ++++ rye/src/lock.rs | 10 ++++++++-- rye/src/pyproject.rs | 21 +++++++++++++++++++++ rye/src/sync.rs | 5 +++++ rye/src/uv.rs | 9 +++++++++ rye/tests/test_sync.rs | 2 ++ 8 files changed, 68 insertions(+), 3 deletions(-) diff --git a/docs/guide/pyproject.md b/docs/guide/pyproject.md index 44317384a4..7c5a6bcc72 100644 --- a/docs/guide/pyproject.md +++ b/docs/guide/pyproject.md @@ -60,6 +60,20 @@ pulled in as indirect dependencies. These are added here automatically with `ry excluded-dependencies = ["cffi"] ``` +## `tool.rye.universal` + ++++ 0.36.0 + +When this flag is enabled all `lock` and `sync` operations in the project or workspace +operate as if `--universal` is passed. This means that the dependency resolver will +attempt to generate a resolution that's valid on all platforms, operating systems, and +architectures, rather than a resolution that's specific to the current platform. + +```toml +[tool.rye] +universal = true +``` + ## `tool.rye.generate-hashes` +++ 0.35.0 diff --git a/rye/src/cli/lock.rs b/rye/src/cli/lock.rs index 97f84f2eb2..31b3b16292 100644 --- a/rye/src/cli/lock.rs +++ b/rye/src/cli/lock.rs @@ -40,10 +40,13 @@ pub struct Args { /// Set to true to lock with hashes in the lockfile. #[arg(long)] generate_hashes: bool, + /// Use universal lock files. + #[arg(long)] + universal: bool, /// Reset prior lock options. #[arg(long)] reset: bool, - /// Use this pyproject.toml file + /// Use this pyproject.toml file. #[arg(long, value_name = "PYPROJECT_TOML")] pyproject: Option, } @@ -62,6 +65,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { with_sources: cmd.with_sources, reset: cmd.reset, generate_hashes: cmd.generate_hashes, + universal: cmd.universal, }, pyproject: cmd.pyproject, keyring_provider: cmd.keyring_provider, diff --git a/rye/src/cli/sync.rs b/rye/src/cli/sync.rs index fc10379b98..e324d8ed2e 100644 --- a/rye/src/cli/sync.rs +++ b/rye/src/cli/sync.rs @@ -55,6 +55,9 @@ pub struct Args { /// Do not reuse (reset) prior lock options. #[arg(long)] reset: bool, + /// Use universal lock files + #[arg(long)] + universal: bool, } pub fn execute(cmd: Args) -> Result<(), Error> { @@ -78,6 +81,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { with_sources: cmd.with_sources, reset: cmd.reset, generate_hashes: cmd.generate_hashes, + universal: cmd.universal, }, keyring_provider: cmd.keyring_provider, pyproject: cmd.pyproject, diff --git a/rye/src/lock.rs b/rye/src/lock.rs index 53eebb23b2..fc97bc9063 100644 --- a/rye/src/lock.rs +++ b/rye/src/lock.rs @@ -37,10 +37,12 @@ static REQUIREMENTS_HEADER: &str = r#"# generated by rye # all-features: {{ lock_options.all_features|tojson }} # with-sources: {{ lock_options.with_sources|tojson }} # generate-hashes: {{ lock_options.generate_hashes|tojson }} +# universal: {{ lock_options.universal|tojson }} "#; -static PARAM_RE: Lazy = - Lazy::new(|| Regex::new(r"^# (pre|features|all-features|with-sources):\s*(.*?)$").unwrap()); +static PARAM_RE: Lazy = Lazy::new(|| { + Regex::new(r"^# (pre|features|all-features|with-sources|universal):\s*(.*?)$").unwrap() +}); #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub enum LockMode { @@ -103,6 +105,8 @@ pub struct LockOptions { pub reset: bool, /// Generate hashes in the lock file. pub generate_hashes: bool, + /// Use universal lock files. + pub universal: bool, } impl LockOptions { @@ -141,6 +145,7 @@ impl LockOptions { "with-sources" => { rv.with_sources = rv.with_sources || serde_json::from_str(value)? } + "universal" => rv.universal = rv.universal || serde_json::from_str(value)?, _ => unreachable!(), } } @@ -445,6 +450,7 @@ fn generate_lockfile( upgrade, keyring_provider, lock_options.generate_hashes, + lock_options.universal, )?; } else { if keyring_provider != KeyringProvider::Disabled { diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index 600e02e606..1f0f527114 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -540,6 +540,11 @@ impl Workspace { generate_hashes(&self.doc) } + /// Should requirements.txt based locking be universal + pub fn universal(&self) -> bool { + universal(&self.doc) + } + /// Should requirements.txt based locking include a find-links reference? pub fn lock_with_sources(&self) -> bool { lock_with_sources(&self.doc) @@ -1019,6 +1024,14 @@ impl PyProject { } } + /// Should requirements.txt-based locking be universal? + pub fn universal(&self) -> bool { + match self.workspace { + Some(ref workspace) => workspace.universal(), + None => universal(&self.doc), + } + } + /// Should requirements.txt-based locking include a find-links reference? pub fn lock_with_sources(&self) -> bool { match self.workspace { @@ -1302,6 +1315,14 @@ fn generate_hashes(doc: &DocumentMut) -> bool { .unwrap_or(false) } +fn universal(doc: &DocumentMut) -> bool { + doc.get("tool") + .and_then(|x| x.get("rye")) + .and_then(|x| x.get("universal")) + .and_then(|x| x.as_bool()) + .unwrap_or(false) +} + fn lock_with_sources(doc: &DocumentMut) -> bool { doc.get("tool") .and_then(|x| x.get("rye")) diff --git a/rye/src/sync.rs b/rye/src/sync.rs index 9fb1d34413..2f4ef59d01 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -110,6 +110,11 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { cmd.lock_options.generate_hashes = true; } + // Turn on universal locking if the project demands it. + if pyproject.universal() { + cmd.lock_options.universal = true; + } + // Turn on locking with sources if the project demands it. if pyproject.lock_with_sources() { cmd.lock_options.with_sources = true; diff --git a/rye/src/uv.rs b/rye/src/uv.rs index f633cc061c..1eb48fb491 100644 --- a/rye/src/uv.rs +++ b/rye/src/uv.rs @@ -41,6 +41,7 @@ struct UvCompileOptions { pub no_header: bool, pub keyring_provider: KeyringProvider, pub generate_hashes: bool, + pub universal: bool, } impl UvCompileOptions { @@ -65,6 +66,10 @@ impl UvCompileOptions { cmd.arg("--exclude-newer").arg(dt); } + if self.universal { + cmd.arg("--universal"); + } + match self.upgrade { UvPackageUpgrade::All => { cmd.arg("--upgrade"); @@ -91,6 +96,7 @@ impl Default for UvCompileOptions { no_header: false, generate_hashes: false, keyring_provider: KeyringProvider::Disabled, + universal: false, } } } @@ -350,6 +356,7 @@ impl Uv { upgrade: UvPackageUpgrade, keyring_provider: KeyringProvider, generate_hashes: bool, + universal: bool, ) -> Result<(), Error> { let options = UvCompileOptions { allow_prerelease, @@ -359,6 +366,7 @@ impl Uv { no_header: true, generate_hashes, keyring_provider, + universal, }; let mut cmd = self.cmd(); @@ -608,6 +616,7 @@ impl UvWithVenv { no_header: true, generate_hashes: false, keyring_provider, + universal: false, }; cmd.arg("pip").arg("compile"); diff --git a/rye/tests/test_sync.rs b/rye/tests/test_sync.rs index c989c467b8..5bf4b8f64b 100644 --- a/rye/tests/test_sync.rs +++ b/rye/tests/test_sync.rs @@ -189,6 +189,7 @@ fn test_autosync_remember() { # all-features: true # with-sources: true # generate-hashes: false + # universal: false --index-url https://pypi.org/simple/ @@ -246,6 +247,7 @@ fn test_autosync_remember() { # all-features: true # with-sources: true # generate-hashes: false + # universal: false --index-url https://pypi.org/simple/ From f38f9799fef9067ebee12b34a00fe3b025749037 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 4 Jul 2024 23:11:04 +0000 Subject: [PATCH 31/49] Sync UV Releases (#1182) --- rye/src/sources/generated/uv_downloads.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rye/src/sources/generated/uv_downloads.inc b/rye/src/sources/generated/uv_downloads.inc index 3c5c3628ae..abd09e1c67 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: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("7dc5fe97867ac3bbcbeabf32fb76b3caaf12141b5e20926ed81353f9a2ff7dcb") }, - UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("5037a966a2422f40c63d36982d46f10362383c128ce1707a56b4339b44a50c94") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("ed5dc4a4341e7af3d92ef0649df6152b555b16e09c072c43f7f39b9d5bdce784") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("d1d478429fdaeadd56ce280bd43460275bd131cd44f9878987d9d7a5caa4f398") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("78137a1b9d6fd1f8f5f0d4208829dd5f89b6505c314192c0fa2a35d6faff5e91") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("e77465f8a964cf0cbd932af506df6ca42ce288e6db4df312c53f27b05c7c09e5") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 17, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.17/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("d49537780cd9cd5621bbc34e6864356487155cd4a7540035e1b0acb0d1017def") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("5b3925fc797bc5e168b5883a5ba2ff6c5751a1c900748c132f01d1ee5c87d24e") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("77ff74dcda1e08d757632eee8c6aa3928d1e52dddb460056a0c7224c888d2956") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("7740b290f6efdfc73d24977e4dc86be144865ca92ec106cb8e0b206f7b77b80f") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("ec323eb0b67103da905e24de5c6ee4036da22068c439f098b93d4c206e6764b8") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("92eec02ae5ff8ef4b4070cf6ef787a2ee3bfc6ca910b61669a8615e2149d6595") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("bf4946c5a8751cc63def72aaa53a9a0c1ca015876b9ec144cc389ef4901dbc4a") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("bb6ff8fa0ac1d86a32b1ef615ec52acb5c8230f803146ad4ceeaba8aaa26a787") }, ]; From fc7b54cf5ebe772bcc52494c4fbc5f6a5deb4213 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sun, 7 Jul 2024 15:02:49 -0500 Subject: [PATCH 32/49] Use musl build for ARM Linux (#1192) ## Summary uv's dynamically-linked ARM Linux build is only compatible with `manylinux_2_28` (we can't build Ring for earlier versions). You can see that we [dual-tag](https://pypi.org/project/uv/#files) the musl build for this reason as being `manylinux_2014`-compatible. This PR moves the ARM build to use the musl build, which should resolve the compatibility issues with `manylinux_2_17`. Closes https://github.com/astral-sh/rye/issues/1187. --- .../src/rye_devtools/find_uv_downloads.py | 17 +++++++++++------ rye/src/sources/generated/uv_downloads.inc | 14 +++++++------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/rye-devtools/src/rye_devtools/find_uv_downloads.py b/rye-devtools/src/rye_devtools/find_uv_downloads.py index bc355a348b..15d3f7b87d 100644 --- a/rye-devtools/src/rye_devtools/find_uv_downloads.py +++ b/rye-devtools/src/rye_devtools/find_uv_downloads.py @@ -35,9 +35,15 @@ class UvDownloads: "aarch64": "aarch64", } + GLIBC = { + "x86_64": "gnu", + "i686": "gnu", + "aarch64": "musl", + } + PLATFORM_ENV = { "unknown-linux-gnu": ("linux", "gnu"), - # "unknown-linux-musl": ("linux", "musl"), + "unknown-linux-musl": ("linux", "musl"), "apple-darwin": ("macos", None), "pc-windows-msvc": ("windows", None), } @@ -81,9 +87,10 @@ def parse_triple(cls, url: str) -> PlatformTriple | None: if arch_str in cls.ARCH and plat_env_str in cls.PLATFORM_ENV: arch = cls.ARCH[arch_str] plat, env = cls.PLATFORM_ENV[plat_env_str] - return PlatformTriple( - arch=arch, platform=plat, environment=env, flavor=None - ) + if env is None or env == cls.GLIBC[arch_str]: + return PlatformTriple( + arch=arch, platform=plat, environment=env, flavor=None + ) return None @@ -125,8 +132,6 @@ async def async_main(): "Authorization": "Bearer " + token, } - downloads = [] - log("Fetching all uv downloads.") async with httpx.AsyncClient(follow_redirects=True, headers=headers) as client: finder = UvDownloads(client) diff --git a/rye/src/sources/generated/uv_downloads.inc b/rye/src/sources/generated/uv_downloads.inc index abd09e1c67..e8b346c544 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: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("5b3925fc797bc5e168b5883a5ba2ff6c5751a1c900748c132f01d1ee5c87d24e") }, - UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-aarch64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("77ff74dcda1e08d757632eee8c6aa3928d1e52dddb460056a0c7224c888d2956") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("7740b290f6efdfc73d24977e4dc86be144865ca92ec106cb8e0b206f7b77b80f") }, - UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("ec323eb0b67103da905e24de5c6ee4036da22068c439f098b93d4c206e6764b8") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("92eec02ae5ff8ef4b4070cf6ef787a2ee3bfc6ca910b61669a8615e2149d6595") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("bf4946c5a8751cc63def72aaa53a9a0c1ca015876b9ec144cc389ef4901dbc4a") }, - UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 21, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.21/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("bb6ff8fa0ac1d86a32b1ef615ec52acb5c8230f803146ad4ceeaba8aaa26a787") }, + 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") }, ]; From 18dd72fa69af1fbd21e7dd26f7f44b868f1d4d3e Mon Sep 17 00:00:00 2001 From: Guy Rosin Date: Sun, 7 Jul 2024 23:06:40 +0300 Subject: [PATCH 33/49] docs: fix tildes (#1198) --- docs/guide/commands/add.md | 4 ++-- docs/guide/commands/build.md | 4 ++-- docs/guide/faq.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/guide/commands/add.md b/docs/guide/commands/add.md index 816cd154a3..4c51c7a7c8 100644 --- a/docs/guide/commands/add.md +++ b/docs/guide/commands/add.md @@ -73,7 +73,7 @@ Added packagename @ file:///path/to/packagename as regular dependency * `--pre`: Include pre-releases when finding a package version -* `--pin `: Overrides the pin operator [possible values: `equal`, `tilde-equal``, `greater-than-equal``] +* `--pin `: Overrides the pin operator [possible values: `equal`, `tilde-equal`, `greater-than-equal`] * `--sync`: Runs `sync` automatically even if auto-sync is disabled. @@ -83,4 +83,4 @@ Added packagename @ file:///path/to/packagename as regular dependency * `-q, --quiet`: Turns off all output -* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file +* `-h, --help`: Print help (see a summary with `-h`) diff --git a/docs/guide/commands/build.md b/docs/guide/commands/build.md index a8dff8a1d9..46d7498031 100644 --- a/docs/guide/commands/build.md +++ b/docs/guide/commands/build.md @@ -46,7 +46,7 @@ By default you will find the artifacts in the `dist` folder. * `-o, --out `: An output directory (defaults to `workspace/dist`) -* `--pyproject `: Use this `pyproject.toml`` file +* `--pyproject `: Use this `pyproject.toml` file * `-c, --clean`: Clean the output directory first @@ -54,4 +54,4 @@ By default you will find the artifacts in the `dist` folder. * `-q, --quiet`: Turns off all output -* `-h, --help`: Print help \ No newline at end of file +* `-h, --help`: Print help diff --git a/docs/guide/faq.md b/docs/guide/faq.md index fea5a2a7ea..b5b83482ed 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -102,7 +102,7 @@ accommodating to portable builds there are various limitations still with this approach. One of them is that built Python distributions capture some absolute paths and other build-time configuration. These file paths are then often used by build tools to invoke C compilers. For instance you might run into a compiler -error like ``error: stdio.h: No such file or directory`` when building C +error like `error: stdio.h: No such file or directory` when building C extensions. There is no known solution to this problem today other than [registering a non portable toolchain](toolchains/index.md#registering-toolchains). From 3eda35c6082c294041316e4e60a0af5aa7397960 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sun, 7 Jul 2024 15:37:40 -0500 Subject: [PATCH 34/49] Upgrade twine version (#1199) Closes https://github.com/astral-sh/rye/issues/1180. --- rye/src/bootstrap.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index ecde15da95..6acf2fa505 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -33,7 +33,7 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques suffix: None, }; -const SELF_VERSION: u64 = 19; +const SELF_VERSION: u64 = 20; const SELF_REQUIREMENTS: &str = r#" build==1.2.1 @@ -48,7 +48,7 @@ platformdirs==4.0.0 pyproject_hooks==1.0.0 requests==2.31.0 tomli==2.0.1 -twine==4.0.2 +twine==5.1.1 unearth==0.14.0 urllib3==2.0.7 virtualenv==20.25.0 From 12c024c7cba4662deb62f02b86cd19cafafabca6 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sun, 7 Jul 2024 15:43:50 -0500 Subject: [PATCH 35/49] Prep for v0.36.0 release (#1200) --- CHANGELOG.md | 12 ++++++++++++ Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb52399fe..d352102649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ that were not yet released. +## 0.36.0 + +Released on 2024-07-07. + +* Upgrade pyyaml to v6.0.1 by @charliermarsh in https://github.com/astral-sh/rye/pull/1170 +* Pass keyring-provider to uv sync and install by @emarsden-iso in https://github.com/astral-sh/rye/pull/1183 +* Add docs hint for packages on multiple indexes by @dennisrall in https://github.com/astral-sh/rye/pull/1188 +* Pass universal flag down to uv by @lbowenwest in https://github.com/astral-sh/rye/pull/1186 +* Use musl build for ARM Linux by @charliermarsh in https://github.com/astral-sh/rye/pull/1192 +* Bump uv to 0.2.22 by @charliermarsh in https://github.com/astral-sh/rye/pull/1192 +* Upgrade twine to v5.1.1 by @charliermarsh in https://github.com/astral-sh/rye/pull/1199 + ## 0.35.0 Released on 2024-06-24. diff --git a/Cargo.lock b/Cargo.lock index e2d27c9ead..b47b73256b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1799,7 +1799,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.35.0" +version = "0.36.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 012e1f1890..7db3fec299 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.35.0" +version = "0.36.0" edition = "2021" license = "MIT" From a57dd4bdda03bf915ddb29b94635b63ffa4ac6b8 Mon Sep 17 00:00:00 2001 From: Takahiro Kinoshita Date: Sun, 14 Jul 2024 01:43:49 +0900 Subject: [PATCH 36/49] 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 37/49] 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 38/49] 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 39/49] 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###" From e293330e871d302cd812bb992b443efbccd47d8f Mon Sep 17 00:00:00 2001 From: Nikhil Verma Date: Sat, 20 Jul 2024 12:01:39 -0400 Subject: [PATCH 40/49] Add short version `-d` for `rye remove --dev` (#1239) Along the lines of #1044 --- rye/src/cli/remove.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rye/src/cli/remove.rs b/rye/src/cli/remove.rs index f950bdbfcc..3ded3a76bb 100644 --- a/rye/src/cli/remove.rs +++ b/rye/src/cli/remove.rs @@ -17,7 +17,7 @@ pub struct Args { #[arg(required = true)] requirements: Vec, /// Remove this from dev dependencies. - #[arg(long)] + #[arg(short, long)] dev: bool, /// Remove this from an optional dependency group. #[arg(long, conflicts_with = "dev")] From e93210a0f5d1e025640b37cab44c66a1c19afeba Mon Sep 17 00:00:00 2001 From: Piotr Date: Sat, 20 Jul 2024 18:07:52 +0200 Subject: [PATCH 41/49] Remove redundant alias information from CLI (#1237) Remove redundant information about `toolchain fetch` being an alias of `toolchain fetch`. image --- rye/src/cli/fetch.rs | 2 +- rye/src/cli/install.rs | 2 +- rye/src/cli/uninstall.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rye/src/cli/fetch.rs b/rye/src/cli/fetch.rs index a99d6b0e22..dfbd2284c4 100644 --- a/rye/src/cli/fetch.rs +++ b/rye/src/cli/fetch.rs @@ -10,7 +10,7 @@ use crate::pyproject::PyProject; use crate::sources::py::PythonVersionRequest; use crate::utils::CommandOutput; -/// Fetches a Python interpreter for the local machine. This is an alias of `rye toolchain fetch`. +/// Fetches a Python interpreter for the local machine. #[derive(Parser, Debug)] pub struct Args { /// The version of Python to fetch. diff --git a/rye/src/cli/install.rs b/rye/src/cli/install.rs index b1e59bb73e..aae1632584 100644 --- a/rye/src/cli/install.rs +++ b/rye/src/cli/install.rs @@ -11,7 +11,7 @@ use crate::lock::KeyringProvider; use crate::sources::py::PythonVersionRequest; use crate::utils::CommandOutput; -/// Installs a package as global tool. This is an alias of `rye tools install`. +/// Installs a package as global tool. #[derive(Parser, Debug)] pub struct Args { /// The name of the package to install. diff --git a/rye/src/cli/uninstall.rs b/rye/src/cli/uninstall.rs index 7039b30162..a4a689abeb 100644 --- a/rye/src/cli/uninstall.rs +++ b/rye/src/cli/uninstall.rs @@ -4,10 +4,10 @@ use clap::Parser; use crate::installer::uninstall; use crate::utils::CommandOutput; -/// Uninstalls a global tool. This is an alias of `rye tools uninstall`. +/// Uninstalls a global tool. #[derive(Parser, Debug)] pub struct Args { - /// The package to uninstall + /// The package to uninstall. name: String, /// Enables verbose diagnostics. #[arg(short, long)] From 349d4d245a045fa444d8d643087267465088650f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 20 Jul 2024 16:27:22 +0000 Subject: [PATCH 42/49] Update uv to `v0.2.27` (#1232) --- rye/src/sources/generated/uv_downloads.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rye/src/sources/generated/uv_downloads.inc b/rye/src/sources/generated/uv_downloads.inc index c81544c867..63e961a7f9 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: 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") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 27, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.27/uv-aarch64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("d071d3063933e2e98322619bd4318594e84b7f6ce4f6c5c13a2ef424b0704bb7") }, + UvDownload {arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 27, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.27/uv-aarch64-unknown-linux-musl.tar.gz"), sha256: Cow::Borrowed("f7ad07f32e01dfdbd6b217c7f6acd7822eb6600d9992d204b93bfa0749bc6b29") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 27, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.27/uv-i686-pc-windows-msvc.zip"), sha256: Cow::Borrowed("6183e4fecfe5404dc69d9cc23c248441ba25a21541c8046c8a27b09a63f224b7") }, + UvDownload {arch: Cow::Borrowed("i686"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 27, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.27/uv-i686-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("4def707256649e6ad40ad33c8c00464d163728a969e54baf94f9d8463b4b89d8") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 0, minor: 2, patch: 27, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.27/uv-x86_64-apple-darwin.tar.gz"), sha256: Cow::Borrowed("56be1ded925e7c1852f8853f7637942786ae379c0ecdbc88cf101f17f8413129") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 0, minor: 2, patch: 27, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.27/uv-x86_64-pc-windows-msvc.zip"), sha256: Cow::Borrowed("1ea0b0623c362c47c6d00801e09ddf948cc27cc18200e5390469e279dfb85d29") }, + UvDownload {arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 0, minor: 2, patch: 27, suffix: None, url: Cow::Borrowed("https://github.com/astral-sh/uv/releases/download/0.2.27/uv-x86_64-unknown-linux-gnu.tar.gz"), sha256: Cow::Borrowed("224cdff5d82ff7053d1a9bf61e5ae89961d536eb2da8a4a13b93a49a0ab434bf") }, ]; From 9954cc6dafc5115ced1c96659fa6e9db76010dac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 20 Jul 2024 12:28:23 -0400 Subject: [PATCH 43/49] Sync Python Releases (#1230) --- .../sources/generated/python_downloads.inc | 54 ++++++++++--------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/rye/src/sources/generated/python_downloads.inc b/rye/src/sources/generated/python_downloads.inc index 5484f94897..b7886dcb16 100644 --- a/rye/src/sources/generated/python_downloads.inc +++ b/rye/src/sources/generated/python_downloads.inc @@ -101,6 +101,12 @@ pub const PYTHON_VERSIONS: &[(PythonVersion, &str, Option<&str>)] = &[ (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 9, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.3-linux32.tar.bz2", Some("7d81b8e9fcd07c067cfe2f519ab770ec62928ee8787f952cadf2d2786246efc8")), (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 9, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.3-linux64.tar.bz2", Some("37e2804c4661c86c857d709d28c7de716b000d31e89766599fdf5a98928b7096")), (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 7, patch: 9, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.3-osx64.tar.bz2", Some("d72b27d5bb60813273f14f07378a08822186a66e216c5d1a768ad295b582438d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 12, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("c7093d43470f07fce45a8fdc15e9e5bddd696174199083721cb1311ca5a100d1")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 12, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a5ad9b19db463f30138352f1dea620ac182a51aefb3398f3a7b8ed865c1f22e9")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 12, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("b9d5a845480ef06133ca518dffc5083a8a5ba455d227504c6f03012c874caf6c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 12, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("f9eda278682713c45d13671d6e3a78df44293c9ed7be8ba2cc4284dc2ba5d5a9")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 12, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("810cc81031f68d0c6b7b5ae685ad590958a842824e08e5d28dea82396da0af44")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 12, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("3f1eb222d1d43d5d70551e8bd64d54aff40f754eb08600167c779f2f1c3559ac")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 12, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3%2B20240415-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("a4f17d1e3b4ea0e4c2a3664f232c0857979522936af582f7de92b57050220f74")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 12, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3%2B20240415-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("fa2b8c377f17dfb097a93c0fba217d93075a7ceba0cc877066e95be969e6b73d")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 12, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3%2B20240415-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("31bb3f579f3dcbbf3bf1dc71a188112e821cdfc77d21c9dbfe82ea78538110e1")), @@ -125,12 +131,12 @@ pub const PYTHON_VERSIONS: &[(PythonVersion, &str, Option<&str>)] = &[ (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 12, patch: 0, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.12.0%2B20231002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("5ce861907a2751a3a7395b1aaada830c2b072acc03f3dd0bcbaaa2b7a9166fc0")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 12, patch: 0, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.12.0%2B20231002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("3b4781e7fd4efabe574ba0954e54c35c7d5ac4dc5b2990b40796c1c6aec67d79")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 12, patch: 0, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.12.0%2B20231002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("5bdff7ed56550d96f9b26a27a8c25f0cc58a03bff19e5f52bba84366183cab8b")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.11.9%2B20240415-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("c9f5e493c686ed8a5c38d1748c45fed18dc9b6faa70794d9cc9bb32489cc0b77")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.11.9%2B20240415-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("9a59eb9e8e509e742a25cada7b2c1123a56022081d91a8fbe48015cf495b0d0f")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.11.9%2B20240415-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("f0405bb7e19e4dbf7db290c224fc4aa333d3e16e0ed571f0794becac620fa26a")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.11.9%2B20240415-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("1c5038da28a4379c065db85116594524010f30e653307c53bb9694e4e710d2c7")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.11.9%2B20240415-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("b1b156ceed6bc53c3c8816b3b5c3983d2c7070a8a42558b9c6dd730faec164e2")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.11.9%2B20240415-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("25344b08303f72ba2a37c33aa240fbd2c8d5a41bcce79cff63923b3d778c645c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.11.9%2B20240713-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("806a1c30d200ba7cc491f024d122fd4127bb6e094f45040f4d6ff5738a7897e5")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.11.9%2B20240713-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("4cb03ac8b12366038059045aa8405794b96d9b3c73919c157a98f73e21b13031")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.11.9%2B20240713-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("4ef2bc9db41b845d35a44bc166abbbb30514a2742ef37643f8c122a6bd71534e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.11.9%2B20240713-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("131d8c047f5ca97773c22bed35aca2a9cde267d3ebe13de54aa3c333fe1d19f6")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.11.9%2B20240713-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d4f99453e0ab87c11c10ee1d173ef55afc0e4750492b38e89c9e30aa14198e19")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.11.9%2B20240713-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("126ddab6d6f6fbfe2f3e73176476fdf306d3ccfac67f8542d12ce0c998142644")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.11.8%2B20240224-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("1d84ed69e5acce555513e9261ce4b78bed19969b06a51a26b2781a375d70083d")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.11.8%2B20240224-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("c0650884b929253b8688797d1955850f6e339bf0428b3d935f62ab3159f66362")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.11.8%2B20240224-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("c3e90962996177a027bd73dd9fd8c42a2d6ef832cda26db4ab4efc6105160537")), @@ -177,12 +183,12 @@ pub const PYTHON_VERSIONS: &[(PythonVersion, &str, Option<&str>)] = &[ (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.11.1%2B20230116-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("02332441cb610b1e1aa2d2972e261e2910cc6a950b7973cac22c0759a93c5fcd")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.11.1%2B20230116-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("0eb61be53ee13cf75a30b8a164ef513a2c7995b25b118a3a503245d46231b13a")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.11.1%2B20230116-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("f5c46fffda7d7894b975af728f739b02d1cec50fd4a3ea49f69de9ceaae74b17")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.10.14%2B20240415-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("630bbbba148557bf670fbd65eb7fcd3c212cac45387d135c02799a13967d0f3d")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.10.14%2B20240415-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("fa95c3a18e29234cf10c0befa2f08246307cab7f473ccc1804845be3caab076d")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.10.14%2B20240415-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("4fafd723944ae98611005caf0ad7dbb262e02c61ddfa7c45f0d097f0965839a8")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.10.14%2B20240415-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("add8cc6cbb4f2a3f8af2272e62b7604f7529a8c357c0af0f8a9f7d3dd444ef1e")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.10.14%2B20240415-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("cc3fa88159a50d639dff84af9ffe2a50d6eda41b51037c755b5a13b88ce50153")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.10.14%2B20240415-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("abc3041f0de7e700229c0628dfcba7ba1d15c8b2924621add7baf1554a088768")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.10.14%2B20240713-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("115204ab7c5013ec2b0e9e594c4ef55b5eb892bdfcc55eb56ed5b4845515df7e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.10.14%2B20240713-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("4558c58bd03309d0c7131d4b5c2cbce9843d385fbcc7d75e575b4bf887bf5f68")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.10.14%2B20240713-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("d6fc0101ba01d63aae1416d8205fe5c700f80d5bed1edbab1250c900d85a7d20")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.10.14%2B20240713-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("01c1038755944cbd7017a4e13e53237e68cd6bbfcff34ca8c9f53a71653e5c9a")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.10.14%2B20240713-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("ece66670f9464828bce9e276a74da62d4663ab8cfd277f6758a7c65d1f245fa0")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.10.14%2B20240713-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("1003c93f92fdcca57308076995b224b888a7ee556763759e69d36e198b5bef14")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.10.13%2B20240224-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("7f23a4afa4032a7c5a4e0ec926da37eea242472142613c2baa029ef61c3c493c")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.10.13%2B20240224-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("57b83a4aa32bdbe7611f1290313ef24f2574dff5fa59181c0ccb26c14c688b73")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("cc5625a16fbec682d4ce40c0d185318164bd181efaa7eaf945ca63015db9fea3")), @@ -267,12 +273,12 @@ pub const PYTHON_VERSIONS: &[(PythonVersion, &str, Option<&str>)] = &[ (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 0, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.10.0-x86_64-unknown-linux-gnu-pgo%2Blto-20211017T1616.tar.zst", None), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 0, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.10.0-x86_64-apple-darwin-pgo%2Blto-20211017T1616.tar.zst", None), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 0, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.10.0-x86_64-pc-windows-msvc-shared-pgo-20211017T1616.tar.zst", None), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.9.19%2B20240415-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("c462b6f2ab7d87b1000972ff6c1e797c86a1306cceee02cdcc81cd2240f44d34")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.9.19%2B20240415-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("04fd532cfba9b3184a94feaf689bd6147759f1d34ddd674e8b2c146b37a994b1")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.9.19%2B20240415-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("7e6edb16a3973fbb894f3cf4f60a34e22645e84621ec61c622cf4c5a2f4bf2a2")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.9.19%2B20240415-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("e1a07336705b58215f8ea138f4abee4640b1baa018e84a9ed44d9a47c7bfa0c8")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.9.19%2B20240415-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("2bb4ed2fc03bb05ac6680b8c11d3c64f7a7dd24b80089c5ad85a91ea4a1795aa")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.9.19%2B20240415-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("e3611b5699c97bf5ac289e3636e8f932fb177997ee69a81b0c2b15c766ca6f13")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.9.19%2B20240713-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("dbd9882b61082c05496ef00c43760802d04cf3158b51d69b29b088d9346c1f09")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.9.19%2B20240713-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e1a251fc23529800653be104aae59cf60f74fa0ebecf373b35e20bfaabee3fe4")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.9.19%2B20240713-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("02095d278a23244d84c82dafc608c259b0cd0c8a21f5a7faf8b1630271304a75")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.9.19%2B20240713-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("c623fad21b04611a3456a95b03d286fd29297b803b99f59bf45ec8eb87dae12d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.9.19%2B20240713-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("46a30e4f7d93c8863e1ef4064f9e9dbe088af35147f57553c3dbf5188290b1e5")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.9.19%2B20240713-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("961fda1c29d7280ac7989a5055d9495674a959abc8137402e19da96d7e8a59c1")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.9.18%2B20240224-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("93d7b15bf02a3191cfdee9d9d68bf2da782fc04cb142bcca6a4299fe524d9b37")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.9.18%2B20240224-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("579f9b68bbb3a915cbab9682e4d3c253bc96b0556b8a860982c49c25c61f974a")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("9e40a541b4eb6eb0a5e2f35724a18332aea91c61e18dec77ca40da5cf2496839")), @@ -381,12 +387,12 @@ pub const PYTHON_VERSIONS: &[(PythonVersion, &str, Option<&str>)] = &[ (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 0, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.9.0-x86_64-unknown-linux-gnu-pgo-20201020T0627.tar.zst", None), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 0, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.9.0-x86_64-apple-darwin-pgo-20201020T0626.tar.zst", None), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 0, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.9.0-x86_64-pc-windows-msvc-shared-pgo-20201021T0245.tar.zst", None), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.8.19%2B20240415-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("31415fdb0d8ea48f09d4a7e0e007f0dd77809be67f5e73ec803f6856d491c542")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.8.19%2B20240415-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("08cf698453d0a3080426a70dbb43220e915eb4401a9ea0fc798f9f27a3bf7f88")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.8.19%2B20240415-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("d1776a6eecc3bcf549fdbd7adcc9a1ee6e0f0dfaa8ad77f055f5972882d0d227")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.8.19%2B20240415-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("778a2f806278f033c683b224aa595775c369717d477e0152b1293c9677ba9377")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.8.19%2B20240415-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e011239aec57e2074093a31f6fb3fee036671ab777fb9764e32bfdb869a80652")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.8.19%2B20240415-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("ff0812147ab19101c219d0648cf0dbe22b3612decd6034c286451dafe5fe5134")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.8.19%2B20240713-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("ef62298357f66f9bf808cc27a32b4fdfd61860551fea3e946df820918e5ad6f3")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.8.19%2B20240713-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d27327b398fea1a82bafc574c5d906b2e97192e04c2514dd431d723df72e9711")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.8.19%2B20240713-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("24d65be61d177147b37d4696ad775a6a011b0b3aafac93bd615a9474c53f0a7e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.8.19%2B20240713-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("61ac5bd70e29fa66b4739e37be66ec164b04f1dd5875c7ee2d223cf3265d4292")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.8.19%2B20240713-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d9546a80f2e979b18a915d4c9aa3e053aeec9a4ddb9bab706ee55e6ebaf3b347")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 19, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.8.19%2B20240713-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("625f1c22a8f903abf07eff43209f65fc0c4857be5aef5c9945daef83f2687af2")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.8.18%2B20240224-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("df66801678a5f4accee67784aff058f283fd52e42898527b7ff0e1cbc3e50e8c")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.8.18%2B20240224-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("c732c068cddcd6a008c1d6d8e35802f5bdc7323bd2eb64e77210d3d5fe4740c2")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.8.18%2B20240224-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("9f94c7b54b97116cd308e73cda0b7a7b7fff4515932c5cbba18eeae9ec798351")), From 2c6247b78641c2e1082534b267931121c89cab25 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sat, 20 Jul 2024 13:28:37 -0400 Subject: [PATCH 44/49] Respect `.python-version` in Rye builds (#1250) ## Summary Today, `rye build` uses the bootstrapped (or "self") environment, which means built wheels reflect the version from the bootstrapped environment, rather than the user's Python preference. This PR changes `build` to instead create an ephemeral build environment based on the requested Python version (then install and run `build` in that environment). Creating and populating that ephemeral build environment is extremely fast with uv; there's virtually no overhead. Closes https://github.com/astral-sh/rye/issues/1152. Closes https://github.com/astral-sh/rye/issues/1248. ## Test Plan - Ran `../rye/target/debug/rye build` from a directory with `.python-version` of `3.11`. - Verified that Python 3.11 was used. --- rye/src/bootstrap.rs | 2 +- rye/src/cli/build.rs | 33 +++++++++++++++++++++++++++------ rye/src/uv.rs | 15 ++++++++++++++- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index 6acf2fa505..fe107cc136 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -35,7 +35,7 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques const SELF_VERSION: u64 = 20; -const SELF_REQUIREMENTS: &str = r#" +pub const SELF_REQUIREMENTS: &str = r#" build==1.2.1 certifi==2024.2.2 charset-normalizer==3.3.2 diff --git a/rye/src/cli/build.rs b/rye/src/cli/build.rs index 324f76b201..0d312fde13 100644 --- a/rye/src/cli/build.rs +++ b/rye/src/cli/build.rs @@ -2,12 +2,14 @@ use std::fs; use std::path::PathBuf; use std::process::{Command, Stdio}; -use anyhow::{anyhow, bail, Error}; +use anyhow::{anyhow, bail, Context, Error}; use clap::Parser; use console::style; -use crate::bootstrap::ensure_self_venv; +use crate::bootstrap::{fetch, FetchOptions}; use crate::config::Config; + +use crate::platform::get_toolchain_python_bin; use crate::pyproject::{locate_projects, PyProject}; use crate::utils::{get_venv_python_bin, prepend_path_to_path_env, CommandOutput, IoPathContext}; use crate::uv::UvBuilder; @@ -46,8 +48,8 @@ pub struct Args { pub fn execute(cmd: Args) -> Result<(), Error> { let output = CommandOutput::from_quiet_and_verbose(cmd.quiet, cmd.verbose); - let self_venv = ensure_self_venv(output)?; let project = PyProject::load_or_discover(cmd.pyproject.as_deref())?; + let py_ver = project.venv_python_version()?; let out = match cmd.out { Some(path) => path, @@ -71,6 +73,27 @@ pub fn execute(cmd: Args) -> Result<(), Error> { warn!("skipping build, all projects are virtual"); return Ok(()); } + + // Make sure we have a compatible Python version. + let py_ver = fetch(&py_ver.into(), FetchOptions::with_output(output)) + .context("failed fetching toolchain ahead of sync")?; + echo!(if output, "Python version: {}", style(&py_ver).cyan()); + let py_bin = get_toolchain_python_bin(&py_ver)?; + + // Create a virtual environment in which to perform the builds. + let uv = UvBuilder::new() + .with_output(CommandOutput::Quiet) + .ensure_exists()?; + let venv_dir = tempfile::tempdir().context("failed to create temporary directory")?; + let uv_venv = uv + .venv(venv_dir.path(), &py_bin, &py_ver, None) + .context("failed to create build environment")?; + uv_venv.write_marker()?; + uv_venv.bootstrap()?; + + // Respect the output level for the actual builds. + let uv = uv.with_output(output); + for project in projects { // skip over virtual packages on build if project.is_virtual() { @@ -83,7 +106,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { style(project.normalized_name()?).cyan() ); - let mut build_cmd = Command::new(get_venv_python_bin(&self_venv)); + let mut build_cmd = Command::new(get_venv_python_bin(venv_dir.path())); build_cmd .arg("-mbuild") .env("NO_COLOR", "1") @@ -92,8 +115,6 @@ pub fn execute(cmd: Args) -> Result<(), Error> { .arg(&*project.root_path()); if use_uv { - // we need to ensure uv is available to use without installing it into self_venv - let uv = UvBuilder::new().with_output(output).ensure_exists()?; let uv_dir = uv .uv_bin() .parent() diff --git a/rye/src/uv.rs b/rye/src/uv.rs index 1eb48fb491..4523c0dea1 100644 --- a/rye/src/uv.rs +++ b/rye/src/uv.rs @@ -1,5 +1,6 @@ -use crate::bootstrap::download_url; +use crate::bootstrap::{download_url, SELF_REQUIREMENTS}; use crate::lock::{make_project_root_fragment, KeyringProvider}; +use crate::piptools::LATEST_PIP; use crate::platform::get_app_dir; use crate::pyproject::{read_venv_marker, write_venv_marker, ExpandedSources}; use crate::sources::py::PythonVersion; @@ -267,6 +268,12 @@ impl Uv { Ok(()) } + /// Set the [`CommandOutput`] level for subsequent invocations of uv. + #[must_use] + pub fn with_output(self, output: CommandOutput) -> Self { + Self { output, ..self } + } + /// Returns a new command with the uv binary as the command to run. /// The command will have the correct proxy settings and verbosity level based on CommandOutput. pub fn cmd(&self) -> Command { @@ -446,6 +453,12 @@ impl UvWithVenv { Ok(()) } + /// Install the bootstrap requirements in the venv. + pub fn bootstrap(&self) -> Result<(), Error> { + self.update(LATEST_PIP, SELF_REQUIREMENTS)?; + Ok(()) + } + /// Updates the pip version in the venv. pub fn update_pip(&self, pip_version: &str) -> Result<(), Error> { self.venv_cmd() From 24696867ae4458336c1c7ec3eb5437b0329344e5 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sat, 20 Jul 2024 14:52:58 -0400 Subject: [PATCH 45/49] Update bundled Ruff version to v0.5.4 (#1251) --- rye/src/bootstrap.rs | 4 ++-- rye/tests/test_ruff.rs | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index fe107cc136..da001ea343 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -33,7 +33,7 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques suffix: None, }; -const SELF_VERSION: u64 = 20; +const SELF_VERSION: u64 = 21; pub const SELF_REQUIREMENTS: &str = r#" build==1.2.1 @@ -52,7 +52,7 @@ twine==5.1.1 unearth==0.14.0 urllib3==2.0.7 virtualenv==20.25.0 -ruff==0.4.4 +ruff==0.5.4 "#; static FORCED_TO_UPDATE: AtomicBool = AtomicBool::new(false); diff --git a/rye/tests/test_ruff.rs b/rye/tests/test_ruff.rs index aa2d700c64..08b19f3404 100644 --- a/rye/tests/test_ruff.rs +++ b/rye/tests/test_ruff.rs @@ -28,7 +28,21 @@ def hello(): exit_code: 1 ----- stdout ----- src/my_project/test.py:1:8: F401 [*] `os` imported but unused + | + 1 | import os + | ^^ F401 + 2 | + 3 | def hello(): + | + = help: Remove unused import: `os` + src/my_project/test.py:6:25: E703 [*] Statement ends with an unnecessary semicolon + | + 6 | return "Hello World"; + | ^ E703 + | + = help: Remove unnecessary semicolon + Found 2 errors. [*] 2 fixable with the `--fix` option. From 09b67c469d92acb6d31d561176c7f43e2947ea62 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sat, 20 Jul 2024 15:25:08 -0400 Subject: [PATCH 46/49] Prep for v0.37.0 release (#1252) --- CHANGELOG.md | 13 +++++++++++++ Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d352102649..a1e739decd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ that were not yet released. +## 0.37.0 + +Released on 2024-07-20. + +* Fix verify-ssl option parsing by @taki-d in https://github.com/astral-sh/rye/pull/1208 +* Emit warning when asked to build a virtual project by @nazq in https://github.com/astral-sh/rye/pull/1227 +* Add short version `-d` for `rye remove --dev` by @nikhilweee in https://github.com/astral-sh/rye/pull/1239 +* Remove redundant alias information from CLI by @piotrgredowski in https://github.com/astral-sh/rye/pull/1237 +* Update bundled uv version to `v0.2.27` by @github-actions in https://github.com/astral-sh/rye/pull/1232 +* Update Python releases to include `3.12.4` by @github-actions in https://github.com/astral-sh/rye/pull/1230 +* Respect `.python-version` in Rye builds by @charliermarsh in https://github.com/astral-sh/rye/pull/1250 +* Update bundled Ruff version to `v0.5.4` by @charliermarsh in https://github.com/astral-sh/rye/pull/1251 + ## 0.36.0 Released on 2024-07-07. diff --git a/Cargo.lock b/Cargo.lock index b47b73256b..b2a4a7d789 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1799,7 +1799,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.36.0" +version = "0.37.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 7db3fec299..2194a97456 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.36.0" +version = "0.37.0" edition = "2021" license = "MIT" From 57b7c089e494138aae29a130afb2e17f447970bf Mon Sep 17 00:00:00 2001 From: Alexander Gherm Date: Sun, 21 Jul 2024 14:23:18 +0200 Subject: [PATCH 47/49] Fix `rye add` and `rye remove` to create proper tool.rye section on --dev and --exclude flags (#1256) Hey! This is to address issue https://github.com/astral-sh/rye/issues/1249 Closes https://github.com/astral-sh/rye/issues/1249 Looks like the `[tool.rye]` section in `pyproject.toml` is not created properly if it was not already presented in the file. This was due to the it not being created as a table. Tested it like that: - Have `pyproject.toml` without `[tool.rye]` table: ``` [project] authors = [{ name = "xxx", email = "xxx@xxx.com" }] name = "rye-test" version = "0.1.0" description = "wasm sample use py2wasm, rust, wasmer, gowasm, wasmedge" readme = "README.md" requires-python = ">=3.11.7" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" ``` - ``` $ rye add --dev ipython ``` results in `pyproject.toml` ``` [project] authors = [{ name = "xxx", email = "xxx@xxx.com" }] name = "rye-test" version = "0.1.0" description = "wasm sample use py2wasm, rust, wasmer, gowasm, wasmedge" readme = "README.md" requires-python = ">=3.11.7" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" [tool.rye] dev-dependencies = [ "ipython>=8.26.0", ] ``` Before fix it was: `pyproject.toml` ``` tool = { rye = { dev-dependencies = [ "ipython>=8.26.0", ] } } [project] authors = [{ name = "xxx", email = "xxx@xxx.com" }] name = "rye-test" version = "0.1.0" description = "wasm sample use py2wasm, rust, wasmer, gowasm, wasmedge" readme = "README.md" requires-python = ">=3.11.7" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" ``` --- rye/src/pyproject.rs | 40 ++++++++++++++++++++--- rye/tests/test_add.rs | 74 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 103 insertions(+), 11 deletions(-) diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index ad194b7ba9..d1865bd92f 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -579,6 +579,13 @@ pub struct PyProject { doc: DocumentMut, } +/// Returns an implicit table. +fn implicit() -> Item { + let mut table = Table::new(); + table.set_implicit(true); + Item::Table(table) +} + impl PyProject { /// Load a pyproject toml if explicitly given, else discover from current directory /// @@ -912,8 +919,14 @@ impl PyProject { ) -> Result<(), Error> { let dependencies = match kind { DependencyKind::Normal => &mut self.doc["project"]["dependencies"], - DependencyKind::Dev => &mut self.doc["tool"]["rye"]["dev-dependencies"], - DependencyKind::Excluded => &mut self.doc["tool"]["rye"]["excluded-dependencies"], + DependencyKind::Dev => self + .obtain_tool_config_table()? + .entry("dev-dependencies") + .or_insert(Item::Value(Value::Array(Array::new()))), + DependencyKind::Excluded => self + .obtain_tool_config_table()? + .entry("excluded-dependencies") + .or_insert(Item::Value(Value::Array(Array::new()))), DependencyKind::Optional(ref section) => { // add this as a proper non-inline table if it's missing let table = &mut self.doc["project"]["optional-dependencies"]; @@ -943,8 +956,14 @@ impl PyProject { ) -> Result, Error> { let dependencies = match kind { DependencyKind::Normal => &mut self.doc["project"]["dependencies"], - DependencyKind::Dev => &mut self.doc["tool"]["rye"]["dev-dependencies"], - DependencyKind::Excluded => &mut self.doc["tool"]["rye"]["excluded-dependencies"], + DependencyKind::Dev => self + .obtain_tool_config_table()? + .entry("dev-dependencies") + .or_insert(Item::Value(Value::Array(Array::new()))), + DependencyKind::Excluded => self + .obtain_tool_config_table()? + .entry("excluded-dependencies") + .or_insert(Item::Value(Value::Array(Array::new()))), DependencyKind::Optional(ref section) => { &mut self.doc["project"]["optional-dependencies"][section as &str] } @@ -1047,6 +1066,19 @@ impl PyProject { fs::write(&path, self.doc.to_string()).path_context(&path, "unable to write changes")?; Ok(()) } + + /// Gets or creates the [tool.rye] table in pyproject.toml + fn obtain_tool_config_table(&mut self) -> Result<&mut Table, Error> { + self.doc + .entry("tool") + .or_insert(implicit()) + .as_table_mut() + .ok_or(anyhow!("[tool.rye] in pyproject.toml is malformed"))? + .entry("rye") + .or_insert(implicit()) + .as_table_mut() + .ok_or(anyhow!("[tool.rye] in pyproject.toml is malformed")) + } } pub fn normalize_package_name(x: &str) -> String { diff --git a/rye/tests/test_add.rs b/rye/tests/test_add.rs index 1c8014a0c6..ea4ca29c74 100644 --- a/rye/tests/test_add.rs +++ b/rye/tests/test_add.rs @@ -1,5 +1,5 @@ +use insta::assert_snapshot; use std::fs; - use toml_edit::{value, ArrayOfTables, Table}; use crate::common::{rye_cmd_snapshot, Space}; @@ -39,6 +39,14 @@ fn test_add_flask() { + my-project==0.1.0 (from file:[TEMP_PATH]/project) + werkzeug==3.0.1 "###); + + assert_snapshot!(space.read_toml("pyproject.toml")["project"]["dependencies"], @r###" + [ + "flask>=3.0.0", + "colorama>=0.4.6", + ] + "### + ); } #[test] @@ -76,12 +84,13 @@ fn test_add_flask_dotenv() { + werkzeug==3.0.1 "###); - space.load_toml("pyproject.toml", |doc| { - let deps = doc["project"]["dependencies"].as_array().unwrap(); - assert!(deps - .iter() - .any(|x| x.as_str() == Some("flask[dotenv]>=3.0.0"))); - }); + assert_snapshot!(space.read_toml("pyproject.toml")["project"]["dependencies"], @r###" + [ + "flask[dotenv]>=3.0.0", + "colorama>=0.4.6", + ] + "### + ); } #[test] @@ -120,6 +129,13 @@ fn test_add_from_find_links() { + my-project==0.1.0 (from file:[TEMP_PATH]/project) + tqdm==4.66.1 "###); + + assert_snapshot!(space.read_toml("pyproject.toml")["tool"]["rye"], @r###" + managed = true + dev-dependencies = [] + sources = [{ name = "extra", type = "find-links", url = "https://download.pytorch.org/whl/torch_stable.html" }] + "### + ); } #[test] @@ -208,3 +224,47 @@ fn test_add_explicit_version_or_url() { + pip==1.3.1 (from https://github.com/pypa/pip/archive/1.3.1.zip#sha1=da9234ee9982d4bbb3c72346a6de940a148ea686) "###); } + +#[test] +fn test_add_dev() { + let space = Space::new(); + space.init("my-project"); + // add colorama to ensure we have this as a dependency on all platforms + rye_cmd_snapshot!(space.rye_cmd().arg("add").arg("flask").arg("colorama").arg("--dev"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + Initializing new virtualenv in [TEMP_PATH]/project/.venv + Python version: cpython@3.12.3 + Added flask>=3.0.0 as dev dependency + Added colorama>=0.4.6 as dev dependency + Reusing already existing virtualenv + Generating production lockfile: [TEMP_PATH]/project/requirements.lock + Generating dev lockfile: [TEMP_PATH]/project/requirements-dev.lock + Installing dependencies + Done! + + ----- stderr ----- + Resolved 9 packages in [EXECUTION_TIME] + Prepared 9 packages in [EXECUTION_TIME] + Installed 9 packages in [EXECUTION_TIME] + + blinker==1.7.0 + + click==8.1.7 + + colorama==0.4.6 + + flask==3.0.0 + + itsdangerous==2.1.2 + + jinja2==3.1.2 + + markupsafe==2.1.3 + + my-project==0.1.0 (from file:[TEMP_PATH]/project) + + werkzeug==3.0.1 + "###); + + assert_snapshot!(space.read_toml("pyproject.toml")["tool"]["rye"], @r###" + managed = true + dev-dependencies = [ + "flask>=3.0.0", + "colorama>=0.4.6", + ] + "### + ); +} From 3f9dcfbe572afa28a7632876d9626994eb9e796e Mon Sep 17 00:00:00 2001 From: "E. H." <94212663+250h@users.noreply.github.com> Date: Wed, 24 Jul 2024 04:16:25 +0800 Subject: [PATCH 48/49] uninstall_cmd fix in Windows (#1153) make uninstall_cmd available in Windows --- rye/src/utils/windows.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rye/src/utils/windows.rs b/rye/src/utils/windows.rs index c260d433ee..f8472a9c52 100644 --- a/rye/src/utils/windows.rs +++ b/rye/src/utils/windows.rs @@ -174,7 +174,7 @@ pub(crate) fn add_to_programs(rye_home: &Path) -> Result<(), Error> { let mut uninstall_cmd = OsString::from("\""); uninstall_cmd.push(rye_home); - uninstall_cmd.push("\" self uninstall"); + uninstall_cmd.push("\\shims\\rye.exe\" self uninstall"); let reg_value = RegValue { bytes: to_winreg_bytes(uninstall_cmd.encode_wide().collect()), From 2fd1895c029e0c8d4046fc83c66d922b2dbae64e Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 24 Jul 2024 22:31:53 +0200 Subject: [PATCH 49/49] Make rye run print script list to stdout (#1268) Fixes #1136 --- rye/src/cli/run.rs | 3 ++- rye/tests/common/mod.rs | 2 +- rye/tests/test_scripts.rs | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 rye/tests/test_scripts.rs diff --git a/rye/src/cli/run.rs b/rye/src/cli/run.rs index 7db917d72b..d69433c2f4 100644 --- a/rye/src/cli/run.rs +++ b/rye/src/cli/run.rs @@ -35,7 +35,7 @@ enum Cmd { } pub fn execute(cmd: Args) -> Result<(), Error> { - let _guard = redirect_to_stderr(true); + let guard = redirect_to_stderr(true); let pyproject = PyProject::load_or_discover(cmd.pyproject.as_deref())?; // make sure we have the minimal virtualenv. @@ -43,6 +43,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { .context("failed to sync ahead of run")?; if cmd.list || cmd.cmd.is_none() { + drop(guard); return list_scripts(&pyproject); } let args = match cmd.cmd { diff --git a/rye/tests/common/mod.rs b/rye/tests/common/mod.rs index 081ab7dfd8..7cc24f0745 100644 --- a/rye/tests/common/mod.rs +++ b/rye/tests/common/mod.rs @@ -27,7 +27,7 @@ pub const INSTA_FILTERS: &[(&str, &str)] = &[ (r"/tmp/\.tmp\S+", "[TEMP_FILE]"), // windows temp folders (r"\b[A-Z]:\\.*\\Local\\Temp\\\S+", "[TEMP_FILE]"), - (r" in (\d+\.)?\d+(ms|s)\b", " in [EXECUTION_TIME]"), + (r" in (\d+m )?(\d+\.)?\d+(ms|s)\b", " in [EXECUTION_TIME]"), (r"\\\\?([\w\d.])", "/$1"), (r"rye.exe", "rye"), ]; diff --git a/rye/tests/test_scripts.rs b/rye/tests/test_scripts.rs new file mode 100644 index 0000000000..fb91790c0b --- /dev/null +++ b/rye/tests/test_scripts.rs @@ -0,0 +1,39 @@ +use toml_edit::value; + +use crate::common::{rye_cmd_snapshot, Space}; + +mod common; + +#[test] +fn test_basic_script() { + let mut settings = insta::Settings::clone_current(); + settings.add_filter(r"(?m)(^py[a-z\d._]+$\r?\n)+", "[PYTHON SCRIPTS]\n"); + let _guard = settings.bind_to_scope(); + + let space = Space::new(); + space.init("my-project"); + space.edit_toml("pyproject.toml", |doc| { + doc["tool"]["rye"]["scripts"]["test-script"] = value("python -c 'print(\"Hello World\")'"); + }); + + rye_cmd_snapshot!(space.rye_cmd().arg("run").arg("test-script"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + Hello World + + ----- stderr ----- + Initializing new virtualenv in [TEMP_PATH]/project/.venv + Python version: cpython@3.12.3 + "###); + + rye_cmd_snapshot!(space.rye_cmd().arg("run"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + [PYTHON SCRIPTS] + test-script (python -c 'print("Hello World")') + + ----- stderr ----- + "###); +}