From 9da44223da5491f8561745693761319f0aa65714 Mon Sep 17 00:00:00 2001 From: dynamicer Date: Sun, 17 Sep 2023 00:47:47 +0800 Subject: [PATCH 001/166] Update pyproject.md (#448) --- docs/guide/pyproject.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/pyproject.md b/docs/guide/pyproject.md index 064b09f5e2..7740bc40f2 100644 --- a/docs/guide/pyproject.md +++ b/docs/guide/pyproject.md @@ -81,7 +81,7 @@ This lets you use indexes other than PyPI. These sources can also be configured main `config.toml` config file with the same syntax. ```toml -[[sources]] +[[tool.rye.sources]] name = "default" url = "http://pypi.org/simple/" ``` From e74711a90215feb9379732ae5c89461099c834ee Mon Sep 17 00:00:00 2001 From: Chaojie Date: Mon, 2 Oct 2023 04:09:13 +0800 Subject: [PATCH 002/166] Fix the wrong behavior when bump version (#454) --- CHANGELOG.md | 2 ++ rye/src/cli/version.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e262885643..cf3b55c7cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ _Unreleased_ - The installer now detects `fish` and will spit out additional instructions for configuring the shell. +- Fix the wrong behavior when bump version. + ## 0.13.0 diff --git a/rye/src/cli/version.rs b/rye/src/cli/version.rs index cd31dd547a..2b204708f3 100644 --- a/rye/src/cli/version.rs +++ b/rye/src/cli/version.rs @@ -65,6 +65,9 @@ fn bump_version(version: &mut Version, bump: Bump, pyproject: &mut PyProject) -> version.release.resize(index + 1, 0); } version.release[index] += 1; + for i in index + 1..version.release.len() { + version.release[i] = 0; + } } pyproject.set_version(version); From 55a98ae49a2ec37e1182aefe317087fb5e1fb1e0 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 1 Oct 2023 22:10:24 +0200 Subject: [PATCH 003/166] Add support for secondary architectures for Python (#447) --- CHANGELOG.md | 2 + docs/guide/toolchains/index.md | 18 + rye/find-downloads.py | 6 +- rye/src/bootstrap.rs | 10 +- rye/src/cli/fetch.rs | 5 + rye/src/cli/install.rs | 4 +- rye/src/cli/rye.rs | 4 +- rye/src/cli/toolchain.rs | 16 +- rye/src/downloads.inc | 692 ++++++++++++++++----------------- rye/src/piptools.rs | 2 +- rye/src/platform.rs | 4 +- rye/src/pyproject.rs | 3 +- rye/src/sources.rs | 133 +++++-- 13 files changed, 500 insertions(+), 399 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf3b55c7cf..9da4dd6964 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ that were not yet released. _Unreleased_ +- Add support for fetching alternative CPU architectures. #447 + - The order of git submodule initialization was changed. This improves the automatic author detection when `includeIf` is used. #443 diff --git a/docs/guide/toolchains/index.md b/docs/guide/toolchains/index.md index 03210f0f55..a8635408dd 100644 --- a/docs/guide/toolchains/index.md +++ b/docs/guide/toolchains/index.md @@ -37,6 +37,24 @@ available compatible version for the virtual environment. Relaxed pinning with `rye pin --relaxed` was added. +## Non Native Architectures + ++++ 0.14.0 + + Support for fetching and pinning of non-native architectures was added. + +By default the pin is for the architecture of the running machine. This means that +if you pin `cpython@3.11` on a mac with aarch64 architecture, you will use a cpython +interpreter of that CPU architecture. A different architecture can be selected by +adding `-{arch}` to the python family name. So for instance to force a `x86_64` version +you need to pin like this: + +``` +rye pin cpython-x86_64@3.11 +``` + +Note that such custom pins are not reflected in `pyproject.toml` but only `.python-version`. + ## Listing Toolchains To see which toolchains are installed, `rye toolchain list` prints a list: diff --git a/rye/find-downloads.py b/rye/find-downloads.py index 596ccb31bc..cc8fdf699c 100644 --- a/rye/find-downloads.py +++ b/rye/find-downloads.py @@ -251,7 +251,7 @@ def _sort_key(info): print("// generated code, do not edit") print("use std::borrow::Cow;") print( - "pub const PYTHON_VERSIONS: &[(PythonVersion, &str, &str, &str, Option<&str>)] = &[" + "pub const PYTHON_VERSIONS: &[(PythonVersion, &str, Option<&str>)] = &[" ) for interpreter, py_ver, choices in sorted( chain( @@ -265,7 +265,7 @@ def _sort_key(info): sha256 = read_sha256(url) sha256 = 'Some("%s")' % sha256 if sha256 else "None" print( - ' (PythonVersion { kind: Cow::Borrowed("%s"), major: %d, minor: %d, patch: %d, suffix: None }, "%s", "%s", "%s", %s),' - % ((interpreter,) + py_ver + (arch, platform, url, sha256)) + ' (PythonVersion { name: Cow::Borrowed("%s"), arch: Cow::Borrowed("%s"), os: Cow::Borrowed("%s"), major: %d, minor: %d, patch: %d, suffix: None }, "%s", %s),' + % ((interpreter, arch, platform) + py_ver + (url, sha256)) ) print("];") diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index c3b11df4ba..ef58585a34 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -1,5 +1,5 @@ use std::borrow::Cow; -use std::env::consts::{ARCH, EXE_EXTENSION, OS}; +use std::env::consts::EXE_EXTENSION; use std::io::Write; use std::path::{Path, PathBuf}; use std::process::Command; @@ -26,7 +26,9 @@ use crate::utils::{ /// this is the target version that we want to fetch pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionRequest { - kind: Some(Cow::Borrowed("cpython")), + name: Some(Cow::Borrowed("cpython")), + arch: None, + os: None, major: 3, minor: Some(11), patch: None, @@ -298,7 +300,7 @@ pub fn get_pip_module(venv: &Path) -> Result { /// we only support cpython 3.9 to 3.11 pub fn is_self_compatible_toolchain(version: &PythonVersion) -> bool { - version.kind == "cpython" && version.major == 3 && version.minor >= 9 && version.minor < 12 + version.name == "cpython" && version.major == 3 && version.minor >= 9 && version.minor < 12 } fn ensure_self_toolchain(output: CommandOutput) -> Result { @@ -333,7 +335,7 @@ pub fn fetch( } } - let (version, url, sha256) = match get_download_url(version, OS, ARCH) { + let (version, url, sha256) = match get_download_url(version) { Some(result) => result, None => bail!("unknown version {}", version), }; diff --git a/rye/src/cli/fetch.rs b/rye/src/cli/fetch.rs index 5a87ae1aad..3a406d6ef9 100644 --- a/rye/src/cli/fetch.rs +++ b/rye/src/cli/fetch.rs @@ -9,6 +9,11 @@ use crate::utils::CommandOutput; pub struct Args { /// The version of Python to fetch. version: String, + /// Overrides the architecture to fetch. + /// + /// When a non native architecture is fetched, the toolchain is + /// installed under an alias. + arch: Option, /// Enables verbose diagnostics. #[arg(short, long)] verbose: bool, diff --git a/rye/src/cli/install.rs b/rye/src/cli/install.rs index 7d316ceb39..61e5a57d8c 100644 --- a/rye/src/cli/install.rs +++ b/rye/src/cli/install.rs @@ -54,7 +54,9 @@ pub fn execute(mut cmd: Args) -> Result<(), Error> { let py_ver: PythonVersionRequest = match cmd.python { Some(ref py) => py.parse()?, None => PythonVersionRequest { - kind: None, + name: None, + arch: None, + os: None, major: 3, minor: None, patch: None, diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index 7020451c70..2da2406e41 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -415,8 +415,8 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( style(toolchain_path.display()).cyan() ); let version = register_toolchain(toolchain_path, None, |ver| { - if ver.kind != "cpython" { - bail!("Only cpython toolchains are allowed, got '{}'", ver.kind); + if ver.name != "cpython" { + bail!("Only cpython toolchains are allowed, got '{}'", ver.name); } else if !is_self_compatible_toolchain(ver) { bail!( "Toolchain {} is not version compatible for internal use.", diff --git a/rye/src/cli/toolchain.rs b/rye/src/cli/toolchain.rs index 6b81e567ba..6979bdfda7 100644 --- a/rye/src/cli/toolchain.rs +++ b/rye/src/cli/toolchain.rs @@ -129,6 +129,15 @@ struct ListVersion { downloadable: Option, } +fn secondary_architectures() -> &'static [&'static str] { + match (OS, ARCH) { + ("windows", "x86_64") => &["x86"], + ("windows", "aarch64") => &["x86_64", "x86"], + ("macos", "aarch64") => &["x86_64"], + _ => &[], + } +} + fn list(cmd: ListCommand) -> Result<(), Error> { let mut toolchains = list_known_toolchains()? .into_iter() @@ -139,10 +148,15 @@ fn list(cmd: ListCommand) -> Result<(), Error> { for version in iter_downloadable(OS, ARCH) { toolchains.entry(version).or_insert(None); } + for secondary_arch in secondary_architectures() { + for version in iter_downloadable(OS, secondary_arch) { + toolchains.entry(version).or_insert(None); + } + } } let mut versions = toolchains.into_iter().collect::>(); - versions.sort_by_cached_key(|a| (a.1.is_none(), a.0.kind.to_string(), Reverse(a.clone()))); + versions.sort_by_cached_key(|a| (a.1.is_none(), a.0.name.to_string(), Reverse(a.clone()))); if let Some(Format::Json) = cmd.format { let json_versions = versions diff --git a/rye/src/downloads.inc b/rye/src/downloads.inc index bee29e499a..1f77d9dc3b 100644 --- a/rye/src/downloads.inc +++ b/rye/src/downloads.inc @@ -1,349 +1,349 @@ // generated code, do not edit use std::borrow::Cow; -pub const PYTHON_VERSIONS: &[(PythonVersion, &str, &str, &str, Option<&str>)] = &[ - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 10, patch: 12, suffix: None }, "aarch64", "linux", "https://downloads.python.org/pypy/pypy3.10-v7.3.12-aarch64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 10, patch: 12, suffix: None }, "aarch64", "macos", "https://downloads.python.org/pypy/pypy3.10-v7.3.12-macos_arm64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 10, patch: 12, suffix: None }, "x86_64", "linux", "https://downloads.python.org/pypy/pypy3.10-v7.3.12-linux64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 10, patch: 12, suffix: None }, "x86_64", "macos", "https://downloads.python.org/pypy/pypy3.10-v7.3.12-macos_x86_64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 10, patch: 12, suffix: None }, "x86_64", "windows", "https://downloads.python.org/pypy/pypy3.10-v7.3.12-win64.zip", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 9, patch: 16, suffix: None }, "aarch64", "linux", "https://downloads.python.org/pypy/pypy3.9-v7.3.11-aarch64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 9, patch: 16, suffix: None }, "aarch64", "macos", "https://downloads.python.org/pypy/pypy3.9-v7.3.11-macos_arm64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 9, patch: 16, suffix: None }, "x86_64", "linux", "https://downloads.python.org/pypy/pypy3.9-v7.3.11-linux64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 9, patch: 16, suffix: None }, "x86_64", "macos", "https://downloads.python.org/pypy/pypy3.9-v7.3.11-macos_x86_64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 9, patch: 16, suffix: None }, "x86_64", "windows", "https://downloads.python.org/pypy/pypy3.9-v7.3.11-win64.zip", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 8, patch: 16, suffix: None }, "aarch64", "linux", "https://downloads.python.org/pypy/pypy3.8-v7.3.11-aarch64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 8, patch: 16, suffix: None }, "aarch64", "macos", "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_arm64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 8, patch: 16, suffix: None }, "x86_64", "linux", "https://downloads.python.org/pypy/pypy3.8-v7.3.11-linux64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 8, patch: 16, suffix: None }, "x86_64", "macos", "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_x86_64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 8, patch: 16, suffix: None }, "x86_64", "windows", "https://downloads.python.org/pypy/pypy3.8-v7.3.11-win64.zip", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 7, patch: 13, suffix: None }, "aarch64", "linux", "https://downloads.python.org/pypy/pypy3.7-v7.3.9-aarch64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 7, patch: 13, suffix: None }, "x86_64", "linux", "https://downloads.python.org/pypy/pypy3.7-v7.3.9-linux64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 7, patch: 13, suffix: None }, "x86_64", "macos", "https://downloads.python.org/pypy/pypy3.7-v7.3.9-osx64.tar.bz2", None), - (PythonVersion { kind: Cow::Borrowed("pypy"), major: 3, minor: 7, patch: 13, suffix: None }, "x86_64", "windows", "https://downloads.python.org/pypy/pypy3.7-v7.3.9-win64.zip", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 5, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("cf131546383f0d9b81eca17c3fcb80508e01b11d9ca956d790c41baefb859d7d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 5, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("7bee180b764722a73c2599fbe2c3a6121cf6bbcb08cb3082851e93c43fe130e7")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 5, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("e156b972b72ae2703c13da3335b16ce5db9f1f33bac27cb0c444a59d04d918fc")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 5, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("c9ffe9c2c88685ce3064f734cbdfede0a07de7d826fada58f8045f3bd8f81a9d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 5, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("556d7d46c2af6f9744da03cac5304975f60de1cd5846a109814dd5c396fe9042")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 5, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e43d70a49919641ca2939a5a9107b13d5fef8c13af0f511a33a94bb6af2044f0")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 5, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("6e4d20e6d498f9edeb3c28cb9541ad20f675f16da350b078e40a9dcfd93cdc3d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 4, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("46982228f02dc6d8a1227289de479f938567ec8acaa361909a998a0196823809")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 4, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("988d476c806f71a3233ff4266eda166a5d28cf83ba306ac88b4220554fc83e8c")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 4, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("1bf5ba6806abbe70770e8e00b2902cbbb75dd4ff0c6e992de85e6752a9998e1a")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 4, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("0d22f43c5bb3f27ff2f9e8c60b0d7abd391bb2cac1790b0960970ff5580f6e9a")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 4, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("b48061173c763971a28669585b47fa26cde98497eee6ebd8057849547b7282ee")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 4, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("6d9765785316c7f1c07def71b413c92c84302f798b30ee09e2e0b5da28353a51")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 4, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("1692d795d6199b2261161ae54250009ffad0317929302903f6f2c773befd4d76")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 3, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("8b8e4c58070f8ff372cf89080f24ecb9154ccfcc7674a8a46d67bdb766a1ee95")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 3, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("cd296d628ceebf55a78c7f6a7aed379eba9dbd72045d002e1c2c85af0d6f5049")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 3, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("58734b66ee8d2762911f32c6bf59f36928990dc637e494f9ac8ebdd589d64547")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 3, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("877c90ef778a526aa25ab417034f5e70728ac14e5eb1fa5cfd741f531203a3fc")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 3, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("b9e2e889a5797b181f086c175a03a0e011277a708199b2b20270bacfca72fb91")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 3, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("2fbb31a8bc6663e2d31d3054319b51a29b1915c03222a94b9d563233e11d1bef")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 3, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("9d27e607fb1cb2d766e17f27853013d8c0f0b09ac53127aaff03ec89ab13370d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 1, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.11.1%2B20230116-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("cd3b910dce032f0ec9b414156b391878010940368b5ea27c33b998016e9c1cb8")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 1, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.11.1%2B20230116-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("da187194cc351d827232b1d2d85b2855d7e25a4ada3e47bc34b4f87b1d989be5")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 1, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.11.1%2B20230116-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("cce57c5fbd3ff10b91d86978b7ad15b9e02f57447d4f429c0bd4e00aa676d389")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 1, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.11.1%2B20230116-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("b062ac2c72a85510fb9300675bd5c716baede21e9482ef6335247b4aa006584c")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 1, suffix: None }, "x86_64", "linux", "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 { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 1, suffix: None }, "x86_64", "macos", "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 { kind: Cow::Borrowed("cpython"), major: 3, minor: 11, patch: 1, suffix: None }, "x86_64", "windows", "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 { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 13, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("7e730a215112ad93d89a8ad091977bc88c15ce06e29f89ccd2c9fe0abf01b832")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 13, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("1e1afee7561ac92a00f06d5531b6bdca8e5f886f24a94dc0dd923cd067ef7dc0")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 13, suffix: None }, "x86", "linux", "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")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 13, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("7a0cd41f7e0f462a184cd0a10357650a890b683d582687252adb52f415b9e21b")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 13, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("da67df5bb26e4097f4747d486a35051f05264a6ab721775e6dfe7e456f6af52a")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 13, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("4ac32857e8b04b235b0be6e70ddb1e61b1d24712e1641f2db16a1507c7d7e4eb")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 13, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("01d120d6b49ee0a3fa05a1cf0ef172d07d9e8dac118647d7c3de8d33938c11c2")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 12, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("bb5fa1d4ad202afc8ee4330f313c093760c9fb1af5be204dc0c6ba50c7610fea")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 12, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a7d0cadbe867cc53dd47d7327244154157a7cca02edb88cf3bb760a4f91d4e44")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 12, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("159124ac71c86d8617eae17db6ed9b98f01078cc9bd76073261901826f2d940d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 12, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("0743b9976f20b06d9cf12de9d1b2dfe06b13f76978275e9dac73a275624bde2c")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 12, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("79fe684338fa26e1af64de583cca77a3fd501d899420de398177952d5182d202")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 12, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("f1fa448384dd48033825e56ee6b5afc76c5dd67dcf2b73b61d2b252ae2e87bca")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 12, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("cb6e7c84d9e369a0ee76c9ea73d415a113ba9982db58f44e6bab5414838d35f3")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 11, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("2e304c39d8af27f9abf1cf44653f5e34e7d05b665cb68e5a5474559c145e7b33")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 11, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("da9c8a3cd04485fd397387ea2fa56f3cac71827aafb51d8438b2868f86eb345b")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 11, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("f55942f89c54c90af53dba603a86f90956eec87c7fb91f5dc2ae543373224ccd")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 11, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("60e76e136ab23b891ed1212e58bd11a73a19cd9fd884ec1c5653ca1c159d674e")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 11, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("38931a156ed020f5c579af37b771871b99f31e74c34fa7e093e97eb1b2d4f978")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 11, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e84c12aa0285235eed365971ceedf040f4d8014f5342d371e138a4da9e4e9b7c")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 11, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("9b4dc4a335b6122ce783bc80f5015b683e3ab1a56054751c5df494db0521da67")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 9, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("3d20f40654e4356bd42c4e70ec28f4b8d8dd559884467a4e1745c08729fb740a")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 9, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("2508b8d4b725bb45c3e03d2ddd2b8441f1a74677cb6bd6076e692c0923135ded")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 9, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("ae0745620168e65df44ae60b21622d488c9dd6ca83566083c565765256315283")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 9, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("3d79cfd229ec12b678bbfd79c30fb4cbad9950d6bfb29741d2315b11839998b4")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 9, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("c5f7ad956c8870573763ed58b59d7f145830a93378234b815c068c893c0d5c1e")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 9, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("1153b4d3b03cf1e1d8ec93c098160586f665fcc2d162c0812140a716a688df58")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 9, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("4cfa6299a78a3959102c461d126e4869616f0a49c60b44220c000fc9aecddd78")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 8, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("5710521ca6958dd2e50f30f2b1591eb7f6a4c55a64c9b66d3196f8257f40bc96")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 8, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("f8ba5f87153a17717e900ff7bba20e2eefe8a53a5bd3c78f9f6922d6d910912d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 8, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("0ab3156bbdc87db8a9b938662a76bb405522b408b1f94d8eb20759f277f96cd8")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 8, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("7547ea172f7fa3d7619855f28780da9feb615b6cb52c5c64d34f65b542799fee")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 8, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("59630be21c77f87b4378f0cf887cbeb6bec64c988c93f3dc795afee782a3322e")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 8, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a18f81ecc7da0779be960ad35c561a834866c0e6d1310a4f742fddfd6163753f")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 8, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("ab40f9584be896c697c5fca351ab82d7b55f01b8eb0494f0a15a67562e49161a")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 7, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("f92fb53661f2ceddeb7b15ae1f165671acf4e4d4f9519a87e033981b93ee33b8")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 7, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("9f44cf63441a90f4ec99a032a2bda43971ae7964822daa0ee730a9cba15d50da")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 7, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("c379f2ef58c8d83f1607357ad75e860770d748232a4eec4263564cbfa6a3efbb")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 7, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("323532701cb468199d6f14031b991f945d4bbf986ca818185e17e132d3763bdf")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 7, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("22e59fa43657dc3487392a44a33a815d507cdd244b6609b6ad08f2661c34169c")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 7, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e03e28dc9fe55ea5ca06fece8f2f2a16646b217d28c0cd09ebcd512f444fdc90")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 7, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("5363974e6ee6c91dbd6bc3533e38b02a26abc2ff1c9a095912f237b916be22d3")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 6, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("6606be4283ebcfe2d83b49b05f6d06b958fe120a4d96c1eeeb072369db06b827")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 6, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("159230851a69cf5cab80318bce48674244d7c6304de81f44c22ff0abdf895cfa")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 6, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("213374fd9845df5c1d3f1d2f5ac2610fe70ddba094aee0cbc2e91fd2dc808de2")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 6, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("8d9a259e15d5a1be48ef13cd5627d7f6c15eadf41a3539e99ed1deee668c075e")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 6, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("8072f01279e05bad7c8d1076715db243489d1c2598f7b7d0457d0cac44fcb8b2")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 6, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("9405499573a7aa8b67d070d096ded4f3e571f18c2b34762606ecc8025290b122")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 6, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("01dc349721594b1bb5b582651f81479a24352f718fdf6279101caa0f377b160a")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 5, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("6e5e1050549c1aa629924b1b6a3080655d9e110f88dfa734d9b1c98af924cc7d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 5, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("f68d25dbe9daa96187fa9e05dd8969f46685547fecf1861a99af898f96a5379e")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 5, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("dea116554852261e4a9e79c8926a0e4ac483f9e624084ded73b30705e221b62d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 5, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("e201192f0aa73904bc5a5f43d1ce4c9fb243dfe02138e690676713fe02c7d662")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 5, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("2a71e32ef8e1bbffbbfcd1825620d6a8944f97e76851bf1a14dc4fa48b626db8")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 5, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("5e372e6738a733532aa985730d9a47ee4c77b7c706e91ef61d37aacbb2e54845")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 5, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("cff35feefe423d4282e9a3e1bb756d0acbb2f776b1ada82c44c71ac3e1491448")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 4, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("5d2ccef5a45d2287d73a6ff63a466b21a197beb373792e644b8881bce3b6aa55")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 4, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("c404f226195d79933b1e0a3ec88f0b79d35c873de592e223e11008f3a37f83d6")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 4, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("b28224a798dea965cb090f831d31aa531c6b9a14028344be6df53ab426497bb4")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 4, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("c37a47e46de93473916f700a790cb43515f00745fba6790004e2731ec934f4d3")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 4, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("15f961b087c6145f326fee30041db4af3ce0a8d24bbdefbd8d24973825728a0e")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 4, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e447f00fe53168d18cbfe110645dbf33982a17580b9e4424a411f9245d99cd21")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 4, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("d636dc1bcca74dd9c6e3b26f7c081b3e229336e8378fe554bf8ba65fe780a2ac")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 3, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("88d2bfc8b714b9e36e95e68129799527077827dd752357934f9d3d0ce756871e")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 3, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("b1abefd0fc66922cf9749e4d5ceb97df4d3cfad0cd9cdc4bd04262a68d565698")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 3, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("ea82b0b12e03fdc461c2337e59cb901ecc763194588db5a97372d26f242f4951")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 3, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("fbc0924a138937fe435fcdb20b0c6241290558e07f158e5578bd91cc8acef469")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 3, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("ee2251d5e59045c6fa1d4431c8a5cd0ed18923a785e7e0f47aa9d32ae0ca344e")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 3, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("bc5d6f284b506104ff6b4e36cec84cbdb4602dfed4c6fe19971a808eb8c439ec")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 3, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("72b91d26f54321ba90a86a3bbc711fa1ac31e0704fec352b36e70b0251ffb13c")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 2, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("fb714771145a49482a113f532e4cbc21d601cf0dee4186a57fbc66ddd8d85aef")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 2, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("1ef939fd471a9d346a7bc43d2c16fb483ddc4f98af6dad7f08a009e299977a1a")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 2, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("817cc2720c9c67cf87e5c0e41e44111098ceb6372d8140c8adbdd2f0397f1e02")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 2, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("698b09b1b8321a4dc43d62f6230b62adcd0df018b2bcf5f1b4a7ce53dcf23bcc")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 2, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("65d2a31c3181ab15342e60a2ef92d6a0df6945200191115d0303d6e77428521c")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 2, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("bacf720c13ab67685a384f1417e9c2420972d88f29c8b7c26e72874177f2d120")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 2, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("7397e78a4fbe429144adc1f33af942bdd5175184e082ac88f3023b3a740dd1a0")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 0, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.10.0-aarch64-unknown-linux-gnu-lto-20211017T1616.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 0, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.10.0-aarch64-apple-darwin-pgo%2Blto-20211017T1616.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 0, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.10.0-i686-unknown-linux-gnu-pgo%2Blto-20211017T1616.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 0, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.10.0-i686-pc-windows-msvc-shared-pgo-20211017T1616.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 0, suffix: None }, "x86_64", "linux", "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 { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 0, suffix: None }, "x86_64", "macos", "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 { kind: Cow::Borrowed("cpython"), major: 3, minor: 10, patch: 0, suffix: None }, "x86_64", "windows", "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 { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 18, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("d646a366b7f0003b1fb943ccf66bacf43cde47e3cc18915fb50b7082d8d2a337")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 18, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a1d1bdc69abcb05850ef7e3af8721b768a3eb88cd7d0e02fc47c1a319b26cc5a")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 18, suffix: None }, "x86", "linux", "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")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 18, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("333ace34d9695ebc87efb0525a5216e6f4990487046d958b06032f2ba97b5065")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 18, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("d8e75f7c4ca2b08f1b24852b628d167ae1529d96762cde1526193af6f9b050c5")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 18, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("8ba6bfc1d97a6e86ae30b075e083544fd3569046197b15b8299fdeb44758d3e7")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 18, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("33930b7d0db71e229b61cfa0d25ea89ce426b37a7410a47a318aeaf4fd7e260d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 17, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("de2eab48ca487550258db38b38cb9372143283f757b3cf9ec522eb657e41a035")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 17, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("2902e2a0add6d584999fa27896b721a359f7308404e936e80b01b07aa06e8f5e")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 17, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("9984f59284048608f6734b032ff76e6bc3cb208e2235fdb511b0e478158fdb2b")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 17, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("ffac27bfb8bdf615d0fc6cbbe0becaa65b6ae73feec417919601497fce2be0ab")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 17, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("cec2385699c047e77d32b93442417ab7d49c3e78c946cf586380dfe0b12a36dd")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 17, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("ba04f9813b78b61d60a27857949403a1b1dd8ac053e1f1aff72fe2689c238d3c")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 17, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("209983b8227e4755197dfed4f6887e45b6a133f61e7eb913c0a934b0d0c3e00f")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 16, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("6c516ed541e7f84ba8b322aa15006082701456bba7c57e68e7263d702927a76d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 16, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("c86ed2bf3ff290af10f96183c53e2b29e954abb520806fbe01d3ef2f9d809a75")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 16, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("4df4cae277ba3ff8de7a16ef3b38f7214c2b0e4cc992f09505b859b0c94f2fd8")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 16, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("d7994b5febb375bb131d028f98f4902ba308913c77095457ccd159b521e20c52")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 16, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("9fc89e1f3e1c03b4f5cd3c289f52e53a7c5fc8779113c2af5a10b19b2e8a2c2f")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 16, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("5809626ca7907c8ea397341f3d5eafb280ed5b19cc5622e57b14d9b4362eba50")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 16, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("199c821505e287c004c3796ba9ac4bd129d7793e1d833e9a7672ed03bdb397d4")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 15, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("4012279410b28c2688b4acfbc9189cdc8c81ef4c4f83c5e4532c39cb8685530e")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 15, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("1799b97619572ad595cd6d309bbcc57606138a57f4e90af04e04ee31d187e22f")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 15, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("7c5d8e6a4255115e96c4b987b76c203ae9c7e6655b2d52c880680f13d2f1af36")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 15, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("a5ad2a6ace97d458ad7b2857fba519c5c332362442d88e2b23ed818f243b8a78")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 15, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("b6860b9872f361af78021dd2e1fe7edfe821963deab91b9a813d12d706288d3d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 15, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("50fd795eac55c4485e2fefbb8e7b365461817733c45becb50a7480a243e6000e")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 15, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("d0f3ce1748a51779eedf155aea617c39426e3f7bfd93b4876cb172576b6e8bda")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 14, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("b099375504383b3a30af02dcf3a9ce01b0e6fecba5b3a8729b4a0a374fee7984")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 14, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("6b9d2ff724aff88a4d0790c86f2e5d17037736f35a796e71732624191ddd6e38")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 14, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("612031ffd5b6dee7f4fe205afeee62a996bbd8df338ae7d0f3731a825aee04fb")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 14, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("fae990eb312314102408cb0c0453dae670f0eb468f4cbf3e72327ceaa1276b46")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 14, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("7f88ff09b2b57c19f4262026b0919aca59558971838093c63b68dfce7834e84d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 14, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("186155e19b63da3248347415f888fbcf982c7587f6f927922ca243ae3f23ed2f")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 14, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("49f27a3a18b4c2d765b0656c6529378a20b3e37fdb0aca9490576ff7a67243a9")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 13, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("e27d88c3c3424a3694f9f111dc4e881c3925aa5d9ec60ec8395a82da2d7c2f31")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 13, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("8612e9328663c0747d1eae36b218d11c2fbc53c39ec7512c7ad6b1b57374a5dc")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 13, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("066d4722bcc75fb16000afd745b11fb5c02847471695c67db633918969e3936b")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 13, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("3860abee418825c6a33f76fe88773fb05eb4bc724d246f1af063106d9ea3f999")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 13, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("e586b6fef3943adff4e74fbc3fe276dfbca12e9d883e273ed0c8d781b24d7d6e")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 13, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("16d21a6e62c19c574a4a225961e80966449095a8eb2c4150905e30d4e807cf86")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 13, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("6ef2b164cae483c61da30fb6d245762b8d6d91346d66cb421989d6d1462e5a48")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 12, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("0749e4f8169b45051c440c81c17449549710d0e5821d4fdb5170b704ddd165c4")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 12, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("b3d09b3c12295e893ee8f2cb60e8af94d8a21fc5c65016282925220f5270b85b")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 12, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("4a32d5f827e9c1fbed68e51974d78f090ccdd8c83f777a2c9f80644a96d53c3f")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 12, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("361b8fa66d6b5d5623fd5e64af29cf220a693ba86d031bf7ce2b61e1ea50f568")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 12, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("9af4ad8e87d1d24352163d519df44f652efefe018b8c7b48ca57604054950abe")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 12, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("825970ae30ae7a30a5b039aa25f1b965e2d1fe046e196e61fa2a3af8fef8c5d9")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 12, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("c49f8b07e9c4dcfd7a5b55c131e882a4ebdf9f37fef1c7820c3ce9eb23bab8ab")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 11, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("e540f92f78cc84a52a77ce621c3da5a427367205884ab4210e763bc7fdaf889c")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 11, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("6d9f20607a20e2cc5ad1428f7366832dc68403fc15f2e4f195817187e7b6dbbf")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 11, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("aeb50fcc54214780244dd64c0d66bf5dec30db075c999cf2c5a58134f8d21c33")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 11, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("f06338422e7e3ad25d0cd61864bdb36d565d46440dd363cbb98821d388ed377a")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 11, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("49dfa5cb99d4f71657dc651ad68d0fce7cc011beb59499141138ef062bd62b49")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 11, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("35e649618e7e602778e72b91c9c50c97d01a0c3509d16225a1f41dd0fd6575f0")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 11, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("1fe3c519d43737dc7743aec43f72735e1429c79e06e3901b21bad67b642f1a10")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 10, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("a40dc3f12bbcaeb487d2ece8c5415f94f3856b400f78202b6055cd514c5e9a24")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 10, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("ba1b63600ed8d9f3b8d739657bd8e7f5ca167de29a1a58d04b2cd9940b289464")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 10, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("218a79ef09d599d95a04819311ee27ab0fd34dd80d3722347003fec0139dca7b")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 10, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("7f3ca15f89775f76a32e6ea9b2c9778ebf0cde753c5973d4493959e75dd92488")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 10, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("de0a1b11f56cd6acdbc4b369a023377fd830946726f3abbbce8fc11dcb56cac0")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 10, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("ef2f090ff920708b4b9aa5d6adf0dc930c09a4bf638d71e6883091f9e629193d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 10, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("56b2738599131d03b39b914ea0597862fd9096e5e64816bf19466bf026e74f0c")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 7, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-aarch64-unknown-linux-gnu-lto-20211017T1616.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 7, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-aarch64-apple-darwin-pgo%2Blto-20211017T1616.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 7, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-i686-unknown-linux-gnu-pgo%2Blto-20211017T1616.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 7, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-i686-pc-windows-msvc-shared-pgo-20211017T1616.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 7, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-x86_64-unknown-linux-gnu-pgo%2Blto-20211017T1616.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 7, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-x86_64-apple-darwin-pgo%2Blto-20211017T1616.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 7, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-x86_64-pc-windows-msvc-shared-pgo-20211017T1616.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 6, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-aarch64-unknown-linux-gnu-lto-20210724T1424.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 6, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-aarch64-apple-darwin-pgo%2Blto-20210724T1424.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 6, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-i686-unknown-linux-gnu-pgo%2Blto-20210724T1424.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 6, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-i686-pc-windows-msvc-shared-pgo-20210724T1424.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 6, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-x86_64-unknown-linux-gnu-pgo%2Blto-20210724T1424.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 6, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-x86_64-apple-darwin-pgo%2Blto-20210724T1424.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 6, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-x86_64-pc-windows-msvc-shared-pgo-20210724T1424.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 5, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.9.5-aarch64-apple-darwin-pgo%2Blto-20210506T0943.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 5, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.9.5-i686-unknown-linux-gnu-pgo%2Blto-20210506T0943.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 5, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.9.5-i686-pc-windows-msvc-shared-pgo-20210506T0943.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 5, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.9.5-x86_64-unknown-linux-gnu-pgo%2Blto-20210506T0943.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 5, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.9.5-x86_64-apple-darwin-pgo%2Blto-20210506T0943.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 5, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.9.5-x86_64-pc-windows-msvc-shared-pgo-20210506T0943.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 4, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.9.4-aarch64-apple-darwin-pgo%2Blto-20210414T1515.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 4, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.9.4-i686-unknown-linux-gnu-pgo%2Blto-20210414T1515.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 4, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.9.4-i686-pc-windows-msvc-shared-pgo-20210414T1515.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 4, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.9.4-x86_64-unknown-linux-gnu-pgo%2Blto-20210414T1515.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 4, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.9.4-x86_64-apple-darwin-pgo%2Blto-20210414T1515.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 4, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.9.4-x86_64-pc-windows-msvc-shared-pgo-20210414T1515.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 3, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210414/cpython-3.9.3-aarch64-apple-darwin-pgo%2Blto-20210413T2055.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 3, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210414/cpython-3.9.3-i686-pc-windows-msvc-shared-pgo-20210413T2055.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 3, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210414/cpython-3.9.3-x86_64-unknown-linux-gnu-pgo%2Blto-20210413T2055.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 3, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210414/cpython-3.9.3-x86_64-apple-darwin-pgo%2Blto-20210413T2055.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 3, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210414/cpython-3.9.3-x86_64-pc-windows-msvc-shared-pgo-20210413T2055.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 2, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.9.2-aarch64-apple-darwin-pgo%2Blto-20210327T1202.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 2, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.9.2-i686-unknown-linux-gnu-pgo%2Blto-20210327T1202.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 2, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.9.2-i686-pc-windows-msvc-shared-pgo-20210327T1202.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 2, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.9.2-x86_64-unknown-linux-gnu-pgo%2Blto-20210327T1202.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 2, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.9.2-x86_64-apple-darwin-pgo%2Blto-20210327T1202.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 2, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.9.2-x86_64-pc-windows-msvc-shared-pgo-20210327T1202.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 1, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.9.1-i686-pc-windows-msvc-shared-pgo-20210103T1125.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 1, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.9.1-x86_64-unknown-linux-gnu-pgo-20210103T1125.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 1, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.9.1-x86_64-apple-darwin-pgo-20210103T1125.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 1, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.9.1-x86_64-pc-windows-msvc-shared-pgo-20210103T1125.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 0, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.9.0-i686-pc-windows-msvc-shared-pgo-20201021T0245.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 0, suffix: None }, "x86_64", "linux", "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 { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 0, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.9.0-x86_64-apple-darwin-pgo-20201020T0626.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 9, patch: 0, suffix: None }, "x86_64", "windows", "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 { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 17, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("efdf69695af469da13f86d5be23556fee6c03f417f8810fca55307a63aabf08d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 17, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d08a542bed35fc74ac6e8f6884c8aa29a77ff2f4ed04a06dcf91578dea622f9a")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 17, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("aaf4b15bdc35674dbe25d4538c9e75e243796a0cc8841fd31d7bbbee6703342a")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 17, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("0931d8ca0e060c6ac1dfcf6bb9b6dea0ac3a9d95daf7906a88128045f4464bf8")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 17, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("4bfe1055dee03d4357b3dca5b334df3076b8aab066cdd84596199b9712ee3632")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 17, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("2c4925f5cf37d498e0d8cfe7b10591cc5f0cd80d2582f566b12006e6f96958b1")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 17, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("68c7d03de5283c4812f2706c797b2139999a28cec647bc662d1459a922059318")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 16, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("62c3e7b417a9c11fb7d251ee6f763c7dd2ae681017a82686122a8167f1b8c081")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 16, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("bfc91d0a1d6d6dfaa5a31c925aa6adae82bd1ae5eb17813a9f0a50bf9d3e6305")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 16, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("e8d832f16548e199e7c622eec9e06f746ba9dbbdf562dac8810c4e64e1f5115a")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 16, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("5de953621402c11cc7db65ba15d45779e838d7ce78e7aa8d43c7d78fff177f13")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 16, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("446a1f600698167a3e70448787f61dd8b1e6fb8f50f50558c901a0f4d3c7a6d6")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 16, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("21c0f4a0fa6ee518b9f2f1901c9667e3baf45d9f84235408b7ca50499d19f56d")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 16, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("6316713c2dcb30127b38ced249fa9608830a33459580b71275a935aaa8cd5d5f")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 15, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("3a4975f1b0c196c98b4867ad41d2f1ba211b52dc6a2965c56acbb00eb7f69aa7")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 15, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("fc0f944e6f01ed649f79c873af1c317db61d2136b82081b4d7cbb7755f878035")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 15, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("f76c0d13f600e819696035851ec47cf5a233cf053d2de85fbd8e5e12a8146f5f")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 15, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("98bb2315c3567316c30b060d613c8d6067b368b64f08ef8fe6196341637c1d78")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 15, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("1fd71062d9b7d632af202972c4488fa9c2255d2ef072b80766ab059b37473ea5")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 15, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e4fd2fa2255295fbdcfadb8b48014fa80810305eccb246d355880aabb45cbe93")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 15, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("59beac5610e6da0848ebaccd72f91f6aaaeed65ef59606d006af909e9e79beba")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 14, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("650821c45386e7727b6e682620007d2532d9ee599b2caf4b4356575bee3c77a0")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 14, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d17a3fcc161345efa2ec0b4ab9c9ed6c139d29128f2e34bb636338a484aa7b72")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 14, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("adb5a08f8dd700bc2d8260226354137349939e9bc5ccfdb8c16493e97b593a19")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 14, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("e43f7a5044eac91e95df59fd08bf96f13245898876fc2afd90a081cfcd847e35")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 14, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("5ca1c591ffb019fad3978018f68d69d4b6c73ce629fb7e42bc2c594cd8344d4f")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 14, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("62edfea77b42e87ca2d85c482319211cd2dd68d55ba85c99f1834f7b64a60133")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 14, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("6986b3e6edf7b37f96ea940b7ccba7b767ed3ea9b3faec2a2a60e5b2c4443314")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 13, suffix: None }, "aarch64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("ad2b859fb502491f72f8d74ed3410bfb78a8886f8a1baa6908faea6128d91265")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 13, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a204e5f9e1566bdc170b163300a29fc9580d5c65cd6e896caf6500cd64471373")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 13, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("9191ac9858eddfc727fa5ebadc654a57a719ac96b9dee4e1e48e6498a27499f4")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 13, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("5630739d1c6fcfbf90311d236c5e46314fc4b439364429bee12d0ffc95e134fb")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 13, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("31c98d8329746c19739558f164e6374a2cd9c5c93c9e213d2548c993566a593c")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 13, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("f706a62de8582bf84b8b693c993314cd786f3e78639892cfd9a7283a526696f9")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 13, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("c36b703b8b806a047ba71e5e85734ac78d204d3a2b7ebc2efcdc7d4af6f6c263")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 12, suffix: None }, "aarch64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.8.12%2B20220227-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("386f667f8d49b6c34aee1910cdc0b5b41883f9406f98e7d59a3753990b1cdbac")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 12, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.8.12%2B20220227-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("61024acdfe5aef07ba4246ea07dba9962770ec1f3d137c54835c0e5b6e040149")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 12, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.8.12%2B20220227-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("3e2e6c7de78b1924aad37904fed7bfbac6efa2bef05348e9be92180b2f2b1ae1")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 12, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.8.12%2B20220227-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("a014cf132a642a5d585f37da0c56f7e6672699811726af18e8905d652b261a3f")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 12, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.8.12%2B20220227-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("cf614d96e2001d526061b3ce0569c79057fd0074ace472ff4f5f601262e08cdb")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 12, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.8.12%2B20220227-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("33f278416ba8074f2ca6d7f8c17b311b60537c9e6431fd47948784c2a78ea227")), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 11, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.8.11-i686-unknown-linux-gnu-pgo%2Blto-20210724T1424.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 11, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.8.11-i686-pc-windows-msvc-shared-pgo-20210724T1424.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 11, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.8.11-x86_64-unknown-linux-gnu-pgo%2Blto-20210724T1424.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 11, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.8.11-x86_64-apple-darwin-pgo%2Blto-20210724T1424.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 11, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.8.11-x86_64-pc-windows-msvc-shared-pgo-20210724T1424.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 10, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.8.10-i686-unknown-linux-gnu-pgo%2Blto-20210506T0943.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 10, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.8.10-i686-pc-windows-msvc-shared-pgo-20210506T0943.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 10, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.8.10-x86_64-unknown-linux-gnu-pgo%2Blto-20210506T0943.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 10, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.8.10-x86_64-apple-darwin-pgo%2Blto-20210506T0943.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 10, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.8.10-x86_64-pc-windows-msvc-shared-pgo-20210506T0943.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 9, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.8.9-i686-unknown-linux-gnu-pgo%2Blto-20210414T1515.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 9, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.8.9-i686-pc-windows-msvc-shared-pgo-20210414T1515.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 9, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.8.9-x86_64-unknown-linux-gnu-pgo%2Blto-20210414T1515.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 9, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.8.9-x86_64-apple-darwin-pgo%2Blto-20210414T1515.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 9, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.8.9-x86_64-pc-windows-msvc-shared-pgo-20210414T1515.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 8, suffix: None }, "x86", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.8.8-i686-unknown-linux-gnu-pgo%2Blto-20210327T1202.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 8, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.8.8-i686-pc-windows-msvc-shared-pgo-20210327T1202.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 8, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.8.8-x86_64-unknown-linux-gnu-pgo%2Blto-20210327T1202.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 8, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.8.8-x86_64-apple-darwin-pgo%2Blto-20210327T1202.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 8, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.8.8-x86_64-pc-windows-msvc-shared-pgo-20210327T1202.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 7, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.8.7-i686-pc-windows-msvc-shared-pgo-20210103T1125.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 7, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.8.7-x86_64-unknown-linux-gnu-pgo-20210103T1125.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 7, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.8.7-x86_64-apple-darwin-pgo-20210103T1125.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 7, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.8.7-x86_64-pc-windows-msvc-shared-pgo-20210103T1125.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 6, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.8.6-i686-pc-windows-msvc-shared-pgo-20201021T0233.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 6, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.8.6-x86_64-unknown-linux-gnu-pgo-20201020T0627.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 6, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.8.6-x86_64-apple-darwin-pgo-20201020T0626.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 6, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.8.6-x86_64-pc-windows-msvc-shared-pgo-20201021T0232.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 5, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20200830/cpython-3.8.5-i686-pc-windows-msvc-shared-pgo-20200830T2311.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 5, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20200822/cpython-3.8.5-x86_64-unknown-linux-gnu-pgo-20200823T0036.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 5, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20200823/cpython-3.8.5-x86_64-apple-darwin-pgo-20200823T2228.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 5, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20200830/cpython-3.8.5-x86_64-pc-windows-msvc-shared-pgo-20200830T2254.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 3, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20200517/cpython-3.8.3-i686-pc-windows-msvc-shared-pgo-20200518T0154.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 3, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20200517/cpython-3.8.3-x86_64-unknown-linux-gnu-pgo-20200518T0040.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 3, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20200530/cpython-3.8.3-x86_64-apple-darwin-pgo-20200530T1845.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 3, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20200517/cpython-3.8.3-x86_64-pc-windows-msvc-shared-pgo-20200517T2207.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 2, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20200418/cpython-3.8.2-i686-pc-windows-msvc-shared-pgo-20200418T2315.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 2, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20200418/cpython-3.8.2-x86_64-unknown-linux-gnu-pgo-20200418T2243.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 2, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20200418/cpython-3.8.2-x86_64-apple-darwin-pgo-20200418T2238.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 8, patch: 2, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20200418/cpython-3.8.2-x86_64-pc-windows-msvc-shared-pgo-20200418T2315.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 9, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20200822/cpython-3.7.9-i686-pc-windows-msvc-shared-pgo-20200823T0159.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 9, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20200822/cpython-3.7.9-x86_64-unknown-linux-gnu-pgo-20200823T0036.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 9, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20200823/cpython-3.7.9-x86_64-apple-darwin-pgo-20200823T2228.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 9, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20200822/cpython-3.7.9-x86_64-pc-windows-msvc-shared-pgo-20200823T0118.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 7, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20200517/cpython-3.7.7-i686-pc-windows-msvc-shared-pgo-20200517T2153.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 7, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20200517/cpython-3.7.7-x86_64-unknown-linux-gnu-pgo-20200518T0040.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 7, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20200530/cpython-3.7.7-x86_64-apple-darwin-pgo-20200530T1845.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 7, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20200517/cpython-3.7.7-x86_64-pc-windows-msvc-shared-pgo-20200517T2128.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 6, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20200216/cpython-3.7.6-windows-x86-shared-pgo-20200217T0110.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 6, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20200216/cpython-3.7.6-linux64-20200216T2303.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 6, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20200216/cpython-3.7.6-macos-20200216T2344.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 6, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20200216/cpython-3.7.6-windows-amd64-shared-pgo-20200217T0022.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 5, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-windows-x86-20191025T0549.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 5, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-linux64-20191025T0506.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 5, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-macos-20191026T0535.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 5, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-windows-amd64-20191025T0540.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 4, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20190816/cpython-3.7.4-windows-x86-20190817T0235.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 4, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20190816/cpython-3.7.4-linux64-20190817T0224.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 4, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20190816/cpython-3.7.4-macos-20190817T0220.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 4, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20190816/cpython-3.7.4-windows-amd64-20190817T0227.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 3, suffix: None }, "x86", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-windows-x86-20190709T0348.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 3, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-linux64-20190618T0324.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 3, suffix: None }, "x86_64", "macos", "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-macos-20190618T0523.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 3, suffix: None }, "x86_64", "windows", "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-windows-amd64-20190618T0516.tar.zst", None), - (PythonVersion { kind: Cow::Borrowed("cpython"), major: 3, minor: 7, patch: 1, suffix: None }, "x86_64", "linux", "https://github.com/indygreg/python-build-standalone/releases/download/20181218/cpython-3.7.1-linux64-20181218T1905.tar.zst", None), +pub const PYTHON_VERSIONS: &[(PythonVersion, &str, Option<&str>)] = &[ + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 12, suffix: None }, "https://downloads.python.org/pypy/pypy3.10-v7.3.12-aarch64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 12, suffix: None }, "https://downloads.python.org/pypy/pypy3.10-v7.3.12-macos_arm64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 12, suffix: None }, "https://downloads.python.org/pypy/pypy3.10-v7.3.12-linux64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 12, suffix: None }, "https://downloads.python.org/pypy/pypy3.10-v7.3.12-macos_x86_64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 12, suffix: None }, "https://downloads.python.org/pypy/pypy3.10-v7.3.12-win64.zip", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 16, suffix: None }, "https://downloads.python.org/pypy/pypy3.9-v7.3.11-aarch64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 16, suffix: None }, "https://downloads.python.org/pypy/pypy3.9-v7.3.11-macos_arm64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 16, suffix: None }, "https://downloads.python.org/pypy/pypy3.9-v7.3.11-linux64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 16, suffix: None }, "https://downloads.python.org/pypy/pypy3.9-v7.3.11-macos_x86_64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 16, suffix: None }, "https://downloads.python.org/pypy/pypy3.9-v7.3.11-win64.zip", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 16, suffix: None }, "https://downloads.python.org/pypy/pypy3.8-v7.3.11-aarch64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 16, suffix: None }, "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_arm64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 16, suffix: None }, "https://downloads.python.org/pypy/pypy3.8-v7.3.11-linux64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 16, suffix: None }, "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_x86_64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 16, suffix: None }, "https://downloads.python.org/pypy/pypy3.8-v7.3.11-win64.zip", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 13, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.9-aarch64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 13, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.9-linux64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 7, patch: 13, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.9-osx64.tar.bz2", None), + (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 13, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.9-win64.zip", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("cf131546383f0d9b81eca17c3fcb80508e01b11d9ca956d790c41baefb859d7d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("7bee180b764722a73c2599fbe2c3a6121cf6bbcb08cb3082851e93c43fe130e7")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("e156b972b72ae2703c13da3335b16ce5db9f1f33bac27cb0c444a59d04d918fc")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("c9ffe9c2c88685ce3064f734cbdfede0a07de7d826fada58f8045f3bd8f81a9d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("556d7d46c2af6f9744da03cac5304975f60de1cd5846a109814dd5c396fe9042")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e43d70a49919641ca2939a5a9107b13d5fef8c13af0f511a33a94bb6af2044f0")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("6e4d20e6d498f9edeb3c28cb9541ad20f675f16da350b078e40a9dcfd93cdc3d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("46982228f02dc6d8a1227289de479f938567ec8acaa361909a998a0196823809")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("988d476c806f71a3233ff4266eda166a5d28cf83ba306ac88b4220554fc83e8c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("1bf5ba6806abbe70770e8e00b2902cbbb75dd4ff0c6e992de85e6752a9998e1a")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("0d22f43c5bb3f27ff2f9e8c60b0d7abd391bb2cac1790b0960970ff5580f6e9a")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("b48061173c763971a28669585b47fa26cde98497eee6ebd8057849547b7282ee")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("6d9765785316c7f1c07def71b413c92c84302f798b30ee09e2e0b5da28353a51")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.11.4%2B20230726-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("1692d795d6199b2261161ae54250009ffad0317929302903f6f2c773befd4d76")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("8b8e4c58070f8ff372cf89080f24ecb9154ccfcc7674a8a46d67bdb766a1ee95")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("cd296d628ceebf55a78c7f6a7aed379eba9dbd72045d002e1c2c85af0d6f5049")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("58734b66ee8d2762911f32c6bf59f36928990dc637e494f9ac8ebdd589d64547")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("877c90ef778a526aa25ab417034f5e70728ac14e5eb1fa5cfd741f531203a3fc")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("b9e2e889a5797b181f086c175a03a0e011277a708199b2b20270bacfca72fb91")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("2fbb31a8bc6663e2d31d3054319b51a29b1915c03222a94b9d563233e11d1bef")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.11.3%2B20230507-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("9d27e607fb1cb2d766e17f27853013d8c0f0b09ac53127aaff03ec89ab13370d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), 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-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("cd3b910dce032f0ec9b414156b391878010940368b5ea27c33b998016e9c1cb8")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), 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-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("da187194cc351d827232b1d2d85b2855d7e25a4ada3e47bc34b4f87b1d989be5")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), 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-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("cce57c5fbd3ff10b91d86978b7ad15b9e02f57447d4f429c0bd4e00aa676d389")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), 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-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("b062ac2c72a85510fb9300675bd5c716baede21e9482ef6335247b4aa006584c")), + (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: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("7e730a215112ad93d89a8ad091977bc88c15ce06e29f89ccd2c9fe0abf01b832")), + (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/20230826/cpython-3.10.13%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("1e1afee7561ac92a00f06d5531b6bdca8e5f886f24a94dc0dd923cd067ef7dc0")), + (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")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("7a0cd41f7e0f462a184cd0a10357650a890b683d582687252adb52f415b9e21b")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), 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-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("da67df5bb26e4097f4747d486a35051f05264a6ab721775e6dfe7e456f6af52a")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("4ac32857e8b04b235b0be6e70ddb1e61b1d24712e1641f2db16a1507c7d7e4eb")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("01d120d6b49ee0a3fa05a1cf0ef172d07d9e8dac118647d7c3de8d33938c11c2")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("bb5fa1d4ad202afc8ee4330f313c093760c9fb1af5be204dc0c6ba50c7610fea")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a7d0cadbe867cc53dd47d7327244154157a7cca02edb88cf3bb760a4f91d4e44")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("159124ac71c86d8617eae17db6ed9b98f01078cc9bd76073261901826f2d940d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("0743b9976f20b06d9cf12de9d1b2dfe06b13f76978275e9dac73a275624bde2c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("79fe684338fa26e1af64de583cca77a3fd501d899420de398177952d5182d202")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("f1fa448384dd48033825e56ee6b5afc76c5dd67dcf2b73b61d2b252ae2e87bca")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("cb6e7c84d9e369a0ee76c9ea73d415a113ba9982db58f44e6bab5414838d35f3")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("2e304c39d8af27f9abf1cf44653f5e34e7d05b665cb68e5a5474559c145e7b33")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("da9c8a3cd04485fd397387ea2fa56f3cac71827aafb51d8438b2868f86eb345b")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("f55942f89c54c90af53dba603a86f90956eec87c7fb91f5dc2ae543373224ccd")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("60e76e136ab23b891ed1212e58bd11a73a19cd9fd884ec1c5653ca1c159d674e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("38931a156ed020f5c579af37b771871b99f31e74c34fa7e093e97eb1b2d4f978")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e84c12aa0285235eed365971ceedf040f4d8014f5342d371e138a4da9e4e9b7c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11%2B20230507-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("9b4dc4a335b6122ce783bc80f5015b683e3ab1a56054751c5df494db0521da67")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("3d20f40654e4356bd42c4e70ec28f4b8d8dd559884467a4e1745c08729fb740a")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("2508b8d4b725bb45c3e03d2ddd2b8441f1a74677cb6bd6076e692c0923135ded")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("ae0745620168e65df44ae60b21622d488c9dd6ca83566083c565765256315283")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("3d79cfd229ec12b678bbfd79c30fb4cbad9950d6bfb29741d2315b11839998b4")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("c5f7ad956c8870573763ed58b59d7f145830a93378234b815c068c893c0d5c1e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("1153b4d3b03cf1e1d8ec93c098160586f665fcc2d162c0812140a716a688df58")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230116/cpython-3.10.9%2B20230116-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("4cfa6299a78a3959102c461d126e4869616f0a49c60b44220c000fc9aecddd78")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("5710521ca6958dd2e50f30f2b1591eb7f6a4c55a64c9b66d3196f8257f40bc96")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("f8ba5f87153a17717e900ff7bba20e2eefe8a53a5bd3c78f9f6922d6d910912d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("0ab3156bbdc87db8a9b938662a76bb405522b408b1f94d8eb20759f277f96cd8")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("7547ea172f7fa3d7619855f28780da9feb615b6cb52c5c64d34f65b542799fee")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("59630be21c77f87b4378f0cf887cbeb6bec64c988c93f3dc795afee782a3322e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a18f81ecc7da0779be960ad35c561a834866c0e6d1310a4f742fddfd6163753f")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.10.8%2B20221106-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("ab40f9584be896c697c5fca351ab82d7b55f01b8eb0494f0a15a67562e49161a")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("f92fb53661f2ceddeb7b15ae1f165671acf4e4d4f9519a87e033981b93ee33b8")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("9f44cf63441a90f4ec99a032a2bda43971ae7964822daa0ee730a9cba15d50da")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("c379f2ef58c8d83f1607357ad75e860770d748232a4eec4263564cbfa6a3efbb")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("323532701cb468199d6f14031b991f945d4bbf986ca818185e17e132d3763bdf")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("22e59fa43657dc3487392a44a33a815d507cdd244b6609b6ad08f2661c34169c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e03e28dc9fe55ea5ca06fece8f2f2a16646b217d28c0cd09ebcd512f444fdc90")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.10.7%2B20221002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("5363974e6ee6c91dbd6bc3533e38b02a26abc2ff1c9a095912f237b916be22d3")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("6606be4283ebcfe2d83b49b05f6d06b958fe120a4d96c1eeeb072369db06b827")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("159230851a69cf5cab80318bce48674244d7c6304de81f44c22ff0abdf895cfa")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("213374fd9845df5c1d3f1d2f5ac2610fe70ddba094aee0cbc2e91fd2dc808de2")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("8d9a259e15d5a1be48ef13cd5627d7f6c15eadf41a3539e99ed1deee668c075e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("8072f01279e05bad7c8d1076715db243489d1c2598f7b7d0457d0cac44fcb8b2")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("9405499573a7aa8b67d070d096ded4f3e571f18c2b34762606ecc8025290b122")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.10.6%2B20220802-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("01dc349721594b1bb5b582651f81479a24352f718fdf6279101caa0f377b160a")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("6e5e1050549c1aa629924b1b6a3080655d9e110f88dfa734d9b1c98af924cc7d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("f68d25dbe9daa96187fa9e05dd8969f46685547fecf1861a99af898f96a5379e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("dea116554852261e4a9e79c8926a0e4ac483f9e624084ded73b30705e221b62d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("e201192f0aa73904bc5a5f43d1ce4c9fb243dfe02138e690676713fe02c7d662")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("2a71e32ef8e1bbffbbfcd1825620d6a8944f97e76851bf1a14dc4fa48b626db8")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("5e372e6738a733532aa985730d9a47ee4c77b7c706e91ef61d37aacbb2e54845")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5%2B20220630-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("cff35feefe423d4282e9a3e1bb756d0acbb2f776b1ada82c44c71ac3e1491448")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("5d2ccef5a45d2287d73a6ff63a466b21a197beb373792e644b8881bce3b6aa55")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("c404f226195d79933b1e0a3ec88f0b79d35c873de592e223e11008f3a37f83d6")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("b28224a798dea965cb090f831d31aa531c6b9a14028344be6df53ab426497bb4")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("c37a47e46de93473916f700a790cb43515f00745fba6790004e2731ec934f4d3")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("15f961b087c6145f326fee30041db4af3ce0a8d24bbdefbd8d24973825728a0e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e447f00fe53168d18cbfe110645dbf33982a17580b9e4424a411f9245d99cd21")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220528/cpython-3.10.4%2B20220528-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("d636dc1bcca74dd9c6e3b26f7c081b3e229336e8378fe554bf8ba65fe780a2ac")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("88d2bfc8b714b9e36e95e68129799527077827dd752357934f9d3d0ce756871e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("b1abefd0fc66922cf9749e4d5ceb97df4d3cfad0cd9cdc4bd04262a68d565698")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("ea82b0b12e03fdc461c2337e59cb901ecc763194588db5a97372d26f242f4951")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("fbc0924a138937fe435fcdb20b0c6241290558e07f158e5578bd91cc8acef469")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("ee2251d5e59045c6fa1d4431c8a5cd0ed18923a785e7e0f47aa9d32ae0ca344e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("bc5d6f284b506104ff6b4e36cec84cbdb4602dfed4c6fe19971a808eb8c439ec")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.10.3%2B20220318-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("72b91d26f54321ba90a86a3bbc711fa1ac31e0704fec352b36e70b0251ffb13c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("fb714771145a49482a113f532e4cbc21d601cf0dee4186a57fbc66ddd8d85aef")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("1ef939fd471a9d346a7bc43d2c16fb483ddc4f98af6dad7f08a009e299977a1a")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("817cc2720c9c67cf87e5c0e41e44111098ceb6372d8140c8adbdd2f0397f1e02")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("698b09b1b8321a4dc43d62f6230b62adcd0df018b2bcf5f1b4a7ce53dcf23bcc")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("65d2a31c3181ab15342e60a2ef92d6a0df6945200191115d0303d6e77428521c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("bacf720c13ab67685a384f1417e9c2420972d88f29c8b7c26e72874177f2d120")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.10.2%2B20220227-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("7397e78a4fbe429144adc1f33af942bdd5175184e082ac88f3023b3a740dd1a0")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), 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-aarch64-unknown-linux-gnu-lto-20211017T1616.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), 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-aarch64-apple-darwin-pgo%2Blto-20211017T1616.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), 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-i686-unknown-linux-gnu-pgo%2Blto-20211017T1616.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), 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-i686-pc-windows-msvc-shared-pgo-20211017T1616.tar.zst", None), + (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: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("d646a366b7f0003b1fb943ccf66bacf43cde47e3cc18915fb50b7082d8d2a337")), + (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/20230826/cpython-3.9.18%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a1d1bdc69abcb05850ef7e3af8721b768a3eb88cd7d0e02fc47c1a319b26cc5a")), + (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")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("333ace34d9695ebc87efb0525a5216e6f4990487046d958b06032f2ba97b5065")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), 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-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("d8e75f7c4ca2b08f1b24852b628d167ae1529d96762cde1526193af6f9b050c5")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("8ba6bfc1d97a6e86ae30b075e083544fd3569046197b15b8299fdeb44758d3e7")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("33930b7d0db71e229b61cfa0d25ea89ce426b37a7410a47a318aeaf4fd7e260d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("de2eab48ca487550258db38b38cb9372143283f757b3cf9ec522eb657e41a035")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("2902e2a0add6d584999fa27896b721a359f7308404e936e80b01b07aa06e8f5e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("9984f59284048608f6734b032ff76e6bc3cb208e2235fdb511b0e478158fdb2b")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("ffac27bfb8bdf615d0fc6cbbe0becaa65b6ae73feec417919601497fce2be0ab")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("cec2385699c047e77d32b93442417ab7d49c3e78c946cf586380dfe0b12a36dd")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("ba04f9813b78b61d60a27857949403a1b1dd8ac053e1f1aff72fe2689c238d3c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("209983b8227e4755197dfed4f6887e45b6a133f61e7eb913c0a934b0d0c3e00f")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("6c516ed541e7f84ba8b322aa15006082701456bba7c57e68e7263d702927a76d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("c86ed2bf3ff290af10f96183c53e2b29e954abb520806fbe01d3ef2f9d809a75")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("4df4cae277ba3ff8de7a16ef3b38f7214c2b0e4cc992f09505b859b0c94f2fd8")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("d7994b5febb375bb131d028f98f4902ba308913c77095457ccd159b521e20c52")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("9fc89e1f3e1c03b4f5cd3c289f52e53a7c5fc8779113c2af5a10b19b2e8a2c2f")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("5809626ca7907c8ea397341f3d5eafb280ed5b19cc5622e57b14d9b4362eba50")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.9.16%2B20230507-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("199c821505e287c004c3796ba9ac4bd129d7793e1d833e9a7672ed03bdb397d4")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("4012279410b28c2688b4acfbc9189cdc8c81ef4c4f83c5e4532c39cb8685530e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("1799b97619572ad595cd6d309bbcc57606138a57f4e90af04e04ee31d187e22f")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("7c5d8e6a4255115e96c4b987b76c203ae9c7e6655b2d52c880680f13d2f1af36")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("a5ad2a6ace97d458ad7b2857fba519c5c332362442d88e2b23ed818f243b8a78")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("b6860b9872f361af78021dd2e1fe7edfe821963deab91b9a813d12d706288d3d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("50fd795eac55c4485e2fefbb8e7b365461817733c45becb50a7480a243e6000e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15%2B20221106-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("d0f3ce1748a51779eedf155aea617c39426e3f7bfd93b4876cb172576b6e8bda")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("b099375504383b3a30af02dcf3a9ce01b0e6fecba5b3a8729b4a0a374fee7984")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("6b9d2ff724aff88a4d0790c86f2e5d17037736f35a796e71732624191ddd6e38")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("612031ffd5b6dee7f4fe205afeee62a996bbd8df338ae7d0f3731a825aee04fb")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("fae990eb312314102408cb0c0453dae670f0eb468f4cbf3e72327ceaa1276b46")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("7f88ff09b2b57c19f4262026b0919aca59558971838093c63b68dfce7834e84d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("186155e19b63da3248347415f888fbcf982c7587f6f927922ca243ae3f23ed2f")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.9.14%2B20221002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("49f27a3a18b4c2d765b0656c6529378a20b3e37fdb0aca9490576ff7a67243a9")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("e27d88c3c3424a3694f9f111dc4e881c3925aa5d9ec60ec8395a82da2d7c2f31")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("8612e9328663c0747d1eae36b218d11c2fbc53c39ec7512c7ad6b1b57374a5dc")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("066d4722bcc75fb16000afd745b11fb5c02847471695c67db633918969e3936b")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("3860abee418825c6a33f76fe88773fb05eb4bc724d246f1af063106d9ea3f999")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("e586b6fef3943adff4e74fbc3fe276dfbca12e9d883e273ed0c8d781b24d7d6e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("16d21a6e62c19c574a4a225961e80966449095a8eb2c4150905e30d4e807cf86")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13%2B20220802-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("6ef2b164cae483c61da30fb6d245762b8d6d91346d66cb421989d6d1462e5a48")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("0749e4f8169b45051c440c81c17449549710d0e5821d4fdb5170b704ddd165c4")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("b3d09b3c12295e893ee8f2cb60e8af94d8a21fc5c65016282925220f5270b85b")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("4a32d5f827e9c1fbed68e51974d78f090ccdd8c83f777a2c9f80644a96d53c3f")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("361b8fa66d6b5d5623fd5e64af29cf220a693ba86d031bf7ce2b61e1ea50f568")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("9af4ad8e87d1d24352163d519df44f652efefe018b8c7b48ca57604054950abe")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("825970ae30ae7a30a5b039aa25f1b965e2d1fe046e196e61fa2a3af8fef8c5d9")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220502/cpython-3.9.12%2B20220502-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("c49f8b07e9c4dcfd7a5b55c131e882a4ebdf9f37fef1c7820c3ce9eb23bab8ab")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("e540f92f78cc84a52a77ce621c3da5a427367205884ab4210e763bc7fdaf889c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("6d9f20607a20e2cc5ad1428f7366832dc68403fc15f2e4f195817187e7b6dbbf")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("aeb50fcc54214780244dd64c0d66bf5dec30db075c999cf2c5a58134f8d21c33")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("f06338422e7e3ad25d0cd61864bdb36d565d46440dd363cbb98821d388ed377a")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("49dfa5cb99d4f71657dc651ad68d0fce7cc011beb59499141138ef062bd62b49")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("35e649618e7e602778e72b91c9c50c97d01a0c3509d16225a1f41dd0fd6575f0")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.9.11%2B20220318-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("1fe3c519d43737dc7743aec43f72735e1429c79e06e3901b21bad67b642f1a10")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 10, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("a40dc3f12bbcaeb487d2ece8c5415f94f3856b400f78202b6055cd514c5e9a24")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 10, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("ba1b63600ed8d9f3b8d739657bd8e7f5ca167de29a1a58d04b2cd9940b289464")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 10, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("218a79ef09d599d95a04819311ee27ab0fd34dd80d3722347003fec0139dca7b")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 10, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("7f3ca15f89775f76a32e6ea9b2c9778ebf0cde753c5973d4493959e75dd92488")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 10, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("de0a1b11f56cd6acdbc4b369a023377fd830946726f3abbbce8fc11dcb56cac0")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 10, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("ef2f090ff920708b4b9aa5d6adf0dc930c09a4bf638d71e6883091f9e629193d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 10, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.9.10%2B20220227-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("56b2738599131d03b39b914ea0597862fd9096e5e64816bf19466bf026e74f0c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-aarch64-unknown-linux-gnu-lto-20211017T1616.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-aarch64-apple-darwin-pgo%2Blto-20211017T1616.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-i686-unknown-linux-gnu-pgo%2Blto-20211017T1616.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-i686-pc-windows-msvc-shared-pgo-20211017T1616.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-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: 9, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-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: 9, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-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: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-aarch64-unknown-linux-gnu-lto-20210724T1424.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-aarch64-apple-darwin-pgo%2Blto-20210724T1424.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-i686-unknown-linux-gnu-pgo%2Blto-20210724T1424.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-i686-pc-windows-msvc-shared-pgo-20210724T1424.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-x86_64-unknown-linux-gnu-pgo%2Blto-20210724T1424.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-x86_64-apple-darwin-pgo%2Blto-20210724T1424.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.9.6-x86_64-pc-windows-msvc-shared-pgo-20210724T1424.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.9.5-aarch64-apple-darwin-pgo%2Blto-20210506T0943.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.9.5-i686-unknown-linux-gnu-pgo%2Blto-20210506T0943.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.9.5-i686-pc-windows-msvc-shared-pgo-20210506T0943.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.9.5-x86_64-unknown-linux-gnu-pgo%2Blto-20210506T0943.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.9.5-x86_64-apple-darwin-pgo%2Blto-20210506T0943.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.9.5-x86_64-pc-windows-msvc-shared-pgo-20210506T0943.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.9.4-aarch64-apple-darwin-pgo%2Blto-20210414T1515.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.9.4-i686-unknown-linux-gnu-pgo%2Blto-20210414T1515.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.9.4-i686-pc-windows-msvc-shared-pgo-20210414T1515.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.9.4-x86_64-unknown-linux-gnu-pgo%2Blto-20210414T1515.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.9.4-x86_64-apple-darwin-pgo%2Blto-20210414T1515.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.9.4-x86_64-pc-windows-msvc-shared-pgo-20210414T1515.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210414/cpython-3.9.3-aarch64-apple-darwin-pgo%2Blto-20210413T2055.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210414/cpython-3.9.3-i686-pc-windows-msvc-shared-pgo-20210413T2055.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210414/cpython-3.9.3-x86_64-unknown-linux-gnu-pgo%2Blto-20210413T2055.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210414/cpython-3.9.3-x86_64-apple-darwin-pgo%2Blto-20210413T2055.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210414/cpython-3.9.3-x86_64-pc-windows-msvc-shared-pgo-20210413T2055.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.9.2-aarch64-apple-darwin-pgo%2Blto-20210327T1202.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.9.2-i686-unknown-linux-gnu-pgo%2Blto-20210327T1202.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.9.2-i686-pc-windows-msvc-shared-pgo-20210327T1202.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.9.2-x86_64-unknown-linux-gnu-pgo%2Blto-20210327T1202.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.9.2-x86_64-apple-darwin-pgo%2Blto-20210327T1202.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.9.2-x86_64-pc-windows-msvc-shared-pgo-20210327T1202.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.9.1-i686-pc-windows-msvc-shared-pgo-20210103T1125.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.9.1-x86_64-unknown-linux-gnu-pgo-20210103T1125.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.9.1-x86_64-apple-darwin-pgo-20210103T1125.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.9.1-x86_64-pc-windows-msvc-shared-pgo-20210103T1125.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), 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-i686-pc-windows-msvc-shared-pgo-20201021T0245.tar.zst", None), + (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: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("efdf69695af469da13f86d5be23556fee6c03f417f8810fca55307a63aabf08d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d08a542bed35fc74ac6e8f6884c8aa29a77ff2f4ed04a06dcf91578dea622f9a")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("aaf4b15bdc35674dbe25d4538c9e75e243796a0cc8841fd31d7bbbee6703342a")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("0931d8ca0e060c6ac1dfcf6bb9b6dea0ac3a9d95daf7906a88128045f4464bf8")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("4bfe1055dee03d4357b3dca5b334df3076b8aab066cdd84596199b9712ee3632")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("2c4925f5cf37d498e0d8cfe7b10591cc5f0cd80d2582f566b12006e6f96958b1")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("68c7d03de5283c4812f2706c797b2139999a28cec647bc662d1459a922059318")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("62c3e7b417a9c11fb7d251ee6f763c7dd2ae681017a82686122a8167f1b8c081")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("bfc91d0a1d6d6dfaa5a31c925aa6adae82bd1ae5eb17813a9f0a50bf9d3e6305")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("e8d832f16548e199e7c622eec9e06f746ba9dbbdf562dac8810c4e64e1f5115a")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("5de953621402c11cc7db65ba15d45779e838d7ce78e7aa8d43c7d78fff177f13")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("446a1f600698167a3e70448787f61dd8b1e6fb8f50f50558c901a0f4d3c7a6d6")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("21c0f4a0fa6ee518b9f2f1901c9667e3baf45d9f84235408b7ca50499d19f56d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 16, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.8.16%2B20230726-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("6316713c2dcb30127b38ced249fa9608830a33459580b71275a935aaa8cd5d5f")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("3a4975f1b0c196c98b4867ad41d2f1ba211b52dc6a2965c56acbb00eb7f69aa7")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("fc0f944e6f01ed649f79c873af1c317db61d2136b82081b4d7cbb7755f878035")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("f76c0d13f600e819696035851ec47cf5a233cf053d2de85fbd8e5e12a8146f5f")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("98bb2315c3567316c30b060d613c8d6067b368b64f08ef8fe6196341637c1d78")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("1fd71062d9b7d632af202972c4488fa9c2255d2ef072b80766ab059b37473ea5")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e4fd2fa2255295fbdcfadb8b48014fa80810305eccb246d355880aabb45cbe93")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 15, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.8.15%2B20221106-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("59beac5610e6da0848ebaccd72f91f6aaaeed65ef59606d006af909e9e79beba")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("650821c45386e7727b6e682620007d2532d9ee599b2caf4b4356575bee3c77a0")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d17a3fcc161345efa2ec0b4ab9c9ed6c139d29128f2e34bb636338a484aa7b72")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("adb5a08f8dd700bc2d8260226354137349939e9bc5ccfdb8c16493e97b593a19")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("e43f7a5044eac91e95df59fd08bf96f13245898876fc2afd90a081cfcd847e35")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("5ca1c591ffb019fad3978018f68d69d4b6c73ce629fb7e42bc2c594cd8344d4f")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("62edfea77b42e87ca2d85c482319211cd2dd68d55ba85c99f1834f7b64a60133")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("6986b3e6edf7b37f96ea940b7ccba7b767ed3ea9b3faec2a2a60e5b2c4443314")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("ad2b859fb502491f72f8d74ed3410bfb78a8886f8a1baa6908faea6128d91265")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a204e5f9e1566bdc170b163300a29fc9580d5c65cd6e896caf6500cd64471373")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("9191ac9858eddfc727fa5ebadc654a57a719ac96b9dee4e1e48e6498a27499f4")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("5630739d1c6fcfbf90311d236c5e46314fc4b439364429bee12d0ffc95e134fb")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("31c98d8329746c19739558f164e6374a2cd9c5c93c9e213d2548c993566a593c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("f706a62de8582bf84b8b693c993314cd786f3e78639892cfd9a7283a526696f9")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.8.13%2B20220802-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("c36b703b8b806a047ba71e5e85734ac78d204d3a2b7ebc2efcdc7d4af6f6c263")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.8.12%2B20220227-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("386f667f8d49b6c34aee1910cdc0b5b41883f9406f98e7d59a3753990b1cdbac")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.8.12%2B20220227-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("61024acdfe5aef07ba4246ea07dba9962770ec1f3d137c54835c0e5b6e040149")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.8.12%2B20220227-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("3e2e6c7de78b1924aad37904fed7bfbac6efa2bef05348e9be92180b2f2b1ae1")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.8.12%2B20220227-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("a014cf132a642a5d585f37da0c56f7e6672699811726af18e8905d652b261a3f")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.8.12%2B20220227-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("cf614d96e2001d526061b3ce0569c79057fd0074ace472ff4f5f601262e08cdb")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20220227/cpython-3.8.12%2B20220227-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("33f278416ba8074f2ca6d7f8c17b311b60537c9e6431fd47948784c2a78ea227")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.8.11-i686-unknown-linux-gnu-pgo%2Blto-20210724T1424.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.8.11-i686-pc-windows-msvc-shared-pgo-20210724T1424.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.8.11-x86_64-unknown-linux-gnu-pgo%2Blto-20210724T1424.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.8.11-x86_64-apple-darwin-pgo%2Blto-20210724T1424.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 11, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210724/cpython-3.8.11-x86_64-pc-windows-msvc-shared-pgo-20210724T1424.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 10, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.8.10-i686-unknown-linux-gnu-pgo%2Blto-20210506T0943.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 10, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.8.10-i686-pc-windows-msvc-shared-pgo-20210506T0943.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 10, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.8.10-x86_64-unknown-linux-gnu-pgo%2Blto-20210506T0943.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 10, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.8.10-x86_64-apple-darwin-pgo%2Blto-20210506T0943.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 10, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.8.10-x86_64-pc-windows-msvc-shared-pgo-20210506T0943.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.8.9-i686-unknown-linux-gnu-pgo%2Blto-20210414T1515.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.8.9-i686-pc-windows-msvc-shared-pgo-20210414T1515.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.8.9-x86_64-unknown-linux-gnu-pgo%2Blto-20210414T1515.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.8.9-x86_64-apple-darwin-pgo%2Blto-20210414T1515.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210415/cpython-3.8.9-x86_64-pc-windows-msvc-shared-pgo-20210414T1515.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.8.8-i686-unknown-linux-gnu-pgo%2Blto-20210327T1202.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.8.8-i686-pc-windows-msvc-shared-pgo-20210327T1202.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.8.8-x86_64-unknown-linux-gnu-pgo%2Blto-20210327T1202.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.8.8-x86_64-apple-darwin-pgo%2Blto-20210327T1202.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 8, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210327/cpython-3.8.8-x86_64-pc-windows-msvc-shared-pgo-20210327T1202.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.8.7-i686-pc-windows-msvc-shared-pgo-20210103T1125.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.8.7-x86_64-unknown-linux-gnu-pgo-20210103T1125.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.8.7-x86_64-apple-darwin-pgo-20210103T1125.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20210103/cpython-3.8.7-x86_64-pc-windows-msvc-shared-pgo-20210103T1125.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.8.6-i686-pc-windows-msvc-shared-pgo-20201021T0233.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.8.6-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: 8, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.8.6-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: 8, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20201020/cpython-3.8.6-x86_64-pc-windows-msvc-shared-pgo-20201021T0232.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200830/cpython-3.8.5-i686-pc-windows-msvc-shared-pgo-20200830T2311.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200822/cpython-3.8.5-x86_64-unknown-linux-gnu-pgo-20200823T0036.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200823/cpython-3.8.5-x86_64-apple-darwin-pgo-20200823T2228.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200830/cpython-3.8.5-x86_64-pc-windows-msvc-shared-pgo-20200830T2254.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200517/cpython-3.8.3-i686-pc-windows-msvc-shared-pgo-20200518T0154.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200517/cpython-3.8.3-x86_64-unknown-linux-gnu-pgo-20200518T0040.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200530/cpython-3.8.3-x86_64-apple-darwin-pgo-20200530T1845.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200517/cpython-3.8.3-x86_64-pc-windows-msvc-shared-pgo-20200517T2207.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200418/cpython-3.8.2-i686-pc-windows-msvc-shared-pgo-20200418T2315.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200418/cpython-3.8.2-x86_64-unknown-linux-gnu-pgo-20200418T2243.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200418/cpython-3.8.2-x86_64-apple-darwin-pgo-20200418T2238.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 2, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200418/cpython-3.8.2-x86_64-pc-windows-msvc-shared-pgo-20200418T2315.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200822/cpython-3.7.9-i686-pc-windows-msvc-shared-pgo-20200823T0159.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200822/cpython-3.7.9-x86_64-unknown-linux-gnu-pgo-20200823T0036.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 7, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200823/cpython-3.7.9-x86_64-apple-darwin-pgo-20200823T2228.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 9, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200822/cpython-3.7.9-x86_64-pc-windows-msvc-shared-pgo-20200823T0118.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200517/cpython-3.7.7-i686-pc-windows-msvc-shared-pgo-20200517T2153.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200517/cpython-3.7.7-x86_64-unknown-linux-gnu-pgo-20200518T0040.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 7, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200530/cpython-3.7.7-x86_64-apple-darwin-pgo-20200530T1845.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200517/cpython-3.7.7-x86_64-pc-windows-msvc-shared-pgo-20200517T2128.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200216/cpython-3.7.6-windows-x86-shared-pgo-20200217T0110.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200216/cpython-3.7.6-linux64-20200216T2303.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 7, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200216/cpython-3.7.6-macos-20200216T2344.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20200216/cpython-3.7.6-windows-amd64-shared-pgo-20200217T0022.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-windows-x86-20191025T0549.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-linux64-20191025T0506.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 7, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-macos-20191026T0535.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-windows-amd64-20191025T0540.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20190816/cpython-3.7.4-windows-x86-20190817T0235.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20190816/cpython-3.7.4-linux64-20190817T0224.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 7, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20190816/cpython-3.7.4-macos-20190817T0220.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 4, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20190816/cpython-3.7.4-windows-amd64-20190817T0227.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-windows-x86-20190709T0348.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-linux64-20190618T0324.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 7, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-macos-20190618T0523.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 3, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-windows-amd64-20190618T0516.tar.zst", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20181218/cpython-3.7.1-linux64-20181218T1905.tar.zst", None), ]; diff --git a/rye/src/piptools.rs b/rye/src/piptools.rs index 95a3753188..c6a18e9245 100644 --- a/rye/src/piptools.rs +++ b/rye/src/piptools.rs @@ -14,7 +14,7 @@ const PIP_TOOLS_VERSION: &str = "pip-tools==6.13.0"; fn get_pip_tools_bin(py_ver: &PythonVersion, output: CommandOutput) -> Result { let self_venv = ensure_self_venv(output)?; - let key = format!("{}@{}.{}", py_ver.kind, py_ver.major, py_ver.minor); + let key = format!("{}@{}.{}", py_ver.name, py_ver.major, py_ver.minor); let venv = get_app_dir().join("pip-tools").join(key); let py = get_venv_python_bin(&venv); diff --git a/rye/src/platform.rs b/rye/src/platform.rs index 582b63942e..e0353720ef 100644 --- a/rye/src/platform.rs +++ b/rye/src/platform.rs @@ -229,7 +229,9 @@ pub fn get_python_version_request_from_pyenv_pin(root: &Path) -> Option Result { latest_available_python_version(&PythonVersionRequest { - kind: None, + name: None, + arch: None, + os: None, major: 3, minor: None, patch: None, diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index ceba9b6230..d1d72630c0 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -3,7 +3,6 @@ use core::fmt; use std::borrow::Cow; use std::collections::{HashMap, HashSet}; use std::env; -use std::env::consts::{ARCH, OS}; use std::ffi::OsStr; use std::ffi::OsString; use std::fs; @@ -1044,7 +1043,7 @@ pub fn latest_available_python_version( Vec::new() }; - if let Some((latest, _, _)) = get_download_url(requested_version, OS, ARCH) { + if let Some((latest, _, _)) = get_download_url(requested_version) { all.push(latest); }; diff --git a/rye/src/sources.rs b/rye/src/sources.rs index 77be67b6f2..31b2e33c6b 100644 --- a/rye/src/sources.rs +++ b/rye/src/sources.rs @@ -1,4 +1,5 @@ use std::borrow::Cow; +use std::env::consts::{ARCH, OS}; use std::fmt; use std::str::FromStr; @@ -11,12 +12,14 @@ mod downloads { include!("downloads.inc"); } -const DEFAULT_KIND: &str = "cpython"; +const DEFAULT_NAME: &str = "cpython"; /// Internal descriptor for a python version. #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone)] pub struct PythonVersion { - pub kind: Cow<'static, str>, + pub name: Cow<'static, str>, + pub arch: Cow<'static, str>, + pub os: Cow<'static, str>, pub major: u8, pub minor: u8, pub patch: u8, @@ -48,9 +51,17 @@ impl FromStr for PythonVersion { fn from_str(s: &str) -> Result { let req: PythonVersionRequest = s.parse()?; Ok(PythonVersion { - kind: match req.kind { - None => Cow::Borrowed(DEFAULT_KIND), - Some(other) => other, + name: match req.name() { + DEFAULT_NAME => Cow::Borrowed(DEFAULT_NAME), + other => Cow::Owned(other.to_string()), + }, + arch: match req.arch() { + ARCH => Cow::Borrowed(ARCH), + other => Cow::Owned(other.to_string()), + }, + os: match req.os() { + OS => Cow::Borrowed(OS), + other => Cow::Owned(other.to_string()), }, major: req.major, minor: req.minor.unwrap_or(0), @@ -65,9 +76,17 @@ impl TryFrom for PythonVersion { fn try_from(req: PythonVersionRequest) -> Result { Ok(PythonVersion { - kind: match req.kind { - None => Cow::Borrowed(DEFAULT_KIND), - Some(other) => other, + name: match req.name() { + DEFAULT_NAME => Cow::Borrowed(DEFAULT_NAME), + other => Cow::Owned(other.to_string()), + }, + arch: match req.arch() { + ARCH => Cow::Borrowed(ARCH), + other => Cow::Owned(other.to_string()), + }, + os: match req.os() { + OS => Cow::Borrowed(OS), + other => Cow::Owned(other.to_string()), }, major: req.major, minor: req.minor.ok_or_else(|| anyhow!("missing minor version"))?, @@ -79,11 +98,15 @@ impl TryFrom for PythonVersion { impl fmt::Display for PythonVersion { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!( - f, - "{}@{}.{}.{}", - self.kind, self.major, self.minor, self.patch - )?; + write!(f, "{}", self.name)?; + if self.arch != ARCH || self.os != OS { + write!(f, "-{}", self.arch)?; + if self.os != OS { + write!(f, "-{}", self.os)?; + } + } + write!(f, "@{}.{}.{}", self.major, self.minor, self.patch)?; + if let Some(ref suffix) = self.suffix { write!(f, ".{}", suffix)?; } @@ -128,7 +151,9 @@ impl From for Version { /// Internal descriptor for a python version request. #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone)] pub struct PythonVersionRequest { - pub kind: Option>, + pub name: Option>, + pub arch: Option>, + pub os: Option>, pub major: u8, pub minor: Option, pub patch: Option, @@ -148,12 +173,26 @@ impl PythonVersionRequest { } rv } + + pub fn name(&self) -> &str { + self.name.as_deref().unwrap_or(DEFAULT_NAME) + } + + pub fn arch(&self) -> &str { + self.arch.as_deref().unwrap_or(ARCH) + } + + pub fn os(&self) -> &str { + self.os.as_deref().unwrap_or(OS) + } } impl From for PythonVersionRequest { fn from(value: PythonVersion) -> Self { PythonVersionRequest { - kind: Some(value.kind), + name: Some(value.name), + arch: Some(value.arch), + os: Some(value.os), major: value.major, minor: Some(value.minor), patch: Some(value.patch), @@ -165,7 +204,9 @@ impl From for PythonVersionRequest { impl From for PythonVersionRequest { fn from(value: Version) -> Self { PythonVersionRequest { - kind: None, + name: None, + arch: None, + os: None, major: value.release.first().map(|x| *x as _).unwrap_or(3), minor: value.release.get(1).map(|x| *x as _), patch: value.release.get(2).map(|x| *x as _), @@ -179,8 +220,8 @@ impl FromStr for PythonVersionRequest { fn from_str(s: &str) -> Result { let (kind, version) = match s.split_once('@') { - Some((kind, version)) => (Some(kind), version), - None => (None, s), + Some((kind, version)) => (kind, version), + None => ("", s), }; let mut iter = version.split('.'); let major = iter @@ -194,8 +235,16 @@ impl FromStr for PythonVersionRequest { return Err(anyhow!("unexpected garbage after version")); } + let mut iter = kind.splitn(3, '-'); + Ok(PythonVersionRequest { - kind: kind.map(|x| x.to_string().into()), + name: match iter.next() { + None | Some("") => None, + Some(DEFAULT_NAME) => Some(Cow::Borrowed(DEFAULT_NAME)), + Some(other) => Some(Cow::Owned(other.to_string())), + }, + arch: iter.next().map(|x| x.to_string().into()), + os: iter.next().map(|x| x.to_string().into()), major, minor, patch, @@ -206,8 +255,15 @@ impl FromStr for PythonVersionRequest { impl fmt::Display for PythonVersionRequest { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if let Some(ref kind) = self.kind { - write!(f, "{}@", kind)?; + if let Some(ref name) = self.name { + write!(f, "{}", name)?; + if let Some(ref arch) = self.arch { + write!(f, "-{}", arch)?; + if let Some(ref os) = self.os { + write!(f, "-{}", os)?; + } + } + write!(f, "@")?; } write!(f, "{}", self.major)?; if let Some(ref minor) = self.minor { @@ -221,7 +277,13 @@ impl fmt::Display for PythonVersionRequest { } pub fn matches_version(req: &PythonVersionRequest, v: &PythonVersion) -> bool { - if req.kind.as_deref().unwrap_or(DEFAULT_KIND) != v.kind { + if req.name.as_deref().unwrap_or(DEFAULT_NAME) != v.name { + return false; + } + if req.arch.as_deref().unwrap_or(ARCH) != v.arch { + return false; + } + if req.os.as_deref().unwrap_or(OS) != v.os { return false; } if req.major != v.major { @@ -248,14 +310,9 @@ pub fn matches_version(req: &PythonVersionRequest, v: &PythonVersion) -> bool { /// Given a version, platform and architecture returns the download URL. pub fn get_download_url( requested_version: &PythonVersionRequest, - platform: &str, - arch: &str, ) -> Option<(PythonVersion, &'static str, Option<&'static str>)> { - for (it_version, it_arch, it_platform, it_url, it_sha256) in downloads::PYTHON_VERSIONS { - if platform == *it_platform - && arch == *it_arch - && matches_version(requested_version, it_version) - { + for (it_version, it_url, it_sha256) in downloads::PYTHON_VERSIONS { + if matches_version(requested_version, it_version) { return Some((it_version.clone(), it_url, *it_sha256)); } } @@ -264,13 +321,13 @@ pub fn get_download_url( /// Returns an iterator over downloadable installations. pub fn iter_downloadable<'s>( - platform: &'s str, + os: &'s str, arch: &'s str, ) -> impl Iterator + 's { downloads::PYTHON_VERSIONS .iter() - .filter_map(move |(version, it_arch, it_platform, _, _)| { - if *it_arch == arch && *it_platform == platform { + .filter_map(move |(version, _, _)| { + if version.arch == arch && version.os == os { Some(version.clone()) } else { None @@ -280,10 +337,10 @@ pub fn iter_downloadable<'s>( #[test] fn test_get_download_url() { - let url = get_download_url(&"3.8.14".parse().unwrap(), "macos", "aarch64"); - assert_eq!(url, Some((PythonVersion { kind: "cpython".into(), major: 3, minor: 8, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d17a3fcc161345efa2ec0b4ab9c9ed6c139d29128f2e34bb636338a484aa7b72")))); - let url = get_download_url(&"3.8".parse().unwrap(), "macos", "aarch64"); - assert_eq!(url, Some((PythonVersion { kind: "cpython".into(), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d08a542bed35fc74ac6e8f6884c8aa29a77ff2f4ed04a06dcf91578dea622f9a")))); - let url = get_download_url(&"3".parse().unwrap(), "macos", "aarch64"); - assert_eq!(url, Some((PythonVersion { kind: "cpython".into(), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("7bee180b764722a73c2599fbe2c3a6121cf6bbcb08cb3082851e93c43fe130e7")))); + let url = get_download_url(&"cpython-aarch64-macos@3.8.14".parse().unwrap()); + assert_eq!(url, Some((PythonVersion { name: "cpython".into(), arch: "aarch64".into(), os: "macos".into(), major: 3, minor: 8, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d17a3fcc161345efa2ec0b4ab9c9ed6c139d29128f2e34bb636338a484aa7b72")))); + let url = get_download_url(&"cpython-aarch64-macos@3.8".parse().unwrap()); + assert_eq!(url, Some((PythonVersion { name: "cpython".into(), arch: "aarch64".into(), os: "macos".into(), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d08a542bed35fc74ac6e8f6884c8aa29a77ff2f4ed04a06dcf91578dea622f9a")))); + let url = get_download_url(&"cpython-aarch64-macos@3".parse().unwrap()); + assert_eq!(url, Some((PythonVersion { name: "cpython".into(), arch: "aarch64".into(), os: "macos".into(), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("7bee180b764722a73c2599fbe2c3a6121cf6bbcb08cb3082851e93c43fe130e7")))); } From c6fa0304172f6497e229f18bdbc9f1cba6f85356 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 1 Oct 2023 22:10:47 +0200 Subject: [PATCH 004/166] Link a changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9da4dd6964..a6695b5d9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ _Unreleased_ - The installer now detects `fish` and will spit out additional instructions for configuring the shell. -- Fix the wrong behavior when bump version. +- Fix the wrong behavior when bump version. #454 From 39428bb9e653835bf329343cf4935ecc7febdebd Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 1 Oct 2023 22:25:32 +0200 Subject: [PATCH 005/166] 0.14.0 --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6695b5d9c..154f12d7cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. + + ## 0.14.0 -_Unreleased_ +Released on 2023-10-01 - Add support for fetching alternative CPU architectures. #447 @@ -23,8 +25,6 @@ _Unreleased_ - Fix the wrong behavior when bump version. #454 - - ## 0.13.0 Released on 2023-08-29 From 26931a97776e25ca34aab0c54e5d0ba67d53ee5d Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 1 Oct 2023 22:26:00 +0200 Subject: [PATCH 006/166] 0.15.0 ready for dev --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 154f12d7cc..320517aab1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.15.0 + +_Unreleased_ + ## 0.14.0 diff --git a/Cargo.lock b/Cargo.lock index 5aaf89105b..a02a66d065 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1772,7 +1772,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.14.0" +version = "0.15.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 1bcef43121..e8f81f6550 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.14.0" +version = "0.15.0" edition = "2021" license = "MIT" From b8b6e8591d2eb14c596dfb713e88baf121be6b91 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 3 Oct 2023 14:09:52 +0200 Subject: [PATCH 007/166] Support for Python 3.12 (#462) --- CHANGELOG.md | 2 ++ rye/src/downloads.inc | 42 ++++++++++++++++++++++++++++++------------ rye/src/sources.rs | 4 ---- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 320517aab1..a00ce64fc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ that were not yet released. _Unreleased_ +- Added support for Python 3.12. #462 + ## 0.14.0 diff --git a/rye/src/downloads.inc b/rye/src/downloads.inc index 1f77d9dc3b..3ff30ae97c 100644 --- a/rye/src/downloads.inc +++ b/rye/src/downloads.inc @@ -20,6 +20,18 @@ pub const PYTHON_VERSIONS: &[(PythonVersion, &str, Option<&str>)] = &[ (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 13, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.9-linux64.tar.bz2", None), (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 7, patch: 13, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.9-osx64.tar.bz2", None), (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 13, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.9-win64.zip", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), 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-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("86e16b6defbbd7db0b7f98879b2b381e0e5b0ec07126cb9f5fc0cafe9869dc36")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), 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-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("25fc8cd41e975d18d13bcc8f8beffa096ff8a0b86c4a737e1c6617900092c966")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), 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-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("465e91b6e6d0d1c40c8a4bce3642c4adcb9b75cf03fbd5fd5a33a36358249289")), + (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: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.11.6%2B20231002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("7c621a748a4fd6ae99d8ba7ec2da59173d31475838382a13df6d2b1bf95a7059")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.11.6%2B20231002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("6e9007bcbbf51203e89c34a87ed42561630a35bc4eb04a565c92ba7159fe5826")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.11.6%2B20231002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("2670731428191d4476bf260c8144ccf06f9e5f8ac6f2de1dc444ca96ab627082")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.11.6%2B20231002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("6da291720c9fe2f63c5c55f7acc8b6094a05488453a84cfcc012e92305099ee7")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.11.6%2B20231002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("3685156e4139e89484c071ba1a1b85be0b4e302a786de5a170d3b0713863c2e8")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.11.6%2B20231002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("38d2c2fa2f9effbf486207bef7141d1b5c385ad30729ab0c976e6a852a2a9401")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("cf131546383f0d9b81eca17c3fcb80508e01b11d9ca956d790c41baefb859d7d")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("7bee180b764722a73c2599fbe2c3a6121cf6bbcb08cb3082851e93c43fe130e7")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("e156b972b72ae2703c13da3335b16ce5db9f1f33bac27cb0c444a59d04d918fc")), @@ -48,13 +60,13 @@ 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: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("7e730a215112ad93d89a8ad091977bc88c15ce06e29f89ccd2c9fe0abf01b832")), - (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/20230826/cpython-3.10.13%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("1e1afee7561ac92a00f06d5531b6bdca8e5f886f24a94dc0dd923cd067ef7dc0")), + (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/20231002/cpython-3.10.13%2B20231002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("94378303df7117f80c6832979d21295413148e46cbab5f737a403f8b21b30335")), + (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/20231002/cpython-3.10.13%2B20231002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a2635841454295c5bc2c18740346fd8308f2a8adcce2407b87c9faf261fed29c")), (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")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("7a0cd41f7e0f462a184cd0a10357650a890b683d582687252adb52f415b9e21b")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), 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-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("da67df5bb26e4097f4747d486a35051f05264a6ab721775e6dfe7e456f6af52a")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("4ac32857e8b04b235b0be6e70ddb1e61b1d24712e1641f2db16a1507c7d7e4eb")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.10.13%2B20230826-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("01d120d6b49ee0a3fa05a1cf0ef172d07d9e8dac118647d7c3de8d33938c11c2")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.10.13%2B20231002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("1c015e64732d3a18951fcea30d364c80fb83322363fec1a2c85c70840fb75a92")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.10.13%2B20231002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("a28cc6d21373a41256cd176bd2f77a3190eb12f132602d344afc3dba6fa454c9")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.10.13%2B20231002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e7db06af69f8a51b05f9f82032957d08c07cf75a06a3db6973aa0d4a05d2a95c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.10.13%2B20231002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("f1960211258ba78abc1b7bf7cd7cfcf2c656f4de22cf197e485c64e722248169")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("bb5fa1d4ad202afc8ee4330f313c093760c9fb1af5be204dc0c6ba50c7610fea")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a7d0cadbe867cc53dd47d7327244154157a7cca02edb88cf3bb760a4f91d4e44")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("159124ac71c86d8617eae17db6ed9b98f01078cc9bd76073261901826f2d940d")), @@ -132,13 +144,13 @@ 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: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("d646a366b7f0003b1fb943ccf66bacf43cde47e3cc18915fb50b7082d8d2a337")), - (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/20230826/cpython-3.9.18%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a1d1bdc69abcb05850ef7e3af8721b768a3eb88cd7d0e02fc47c1a319b26cc5a")), + (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/20231002/cpython-3.9.18%2B20231002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("4cd4240b08e82e0b279152cd2afad556a0c8cd9ee3d285fe3a5770b5a934fe26")), + (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/20231002/cpython-3.9.18%2B20231002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("bdf883f6a6ba9ea1bd72029670737232bfbd9a07708d85dd2bf6a3deb2aa3a5d")), (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")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("333ace34d9695ebc87efb0525a5216e6f4990487046d958b06032f2ba97b5065")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), 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-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("d8e75f7c4ca2b08f1b24852b628d167ae1529d96762cde1526193af6f9b050c5")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("8ba6bfc1d97a6e86ae30b075e083544fd3569046197b15b8299fdeb44758d3e7")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.9.18%2B20230826-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("33930b7d0db71e229b61cfa0d25ea89ce426b37a7410a47a318aeaf4fd7e260d")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.9.18%2B20231002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("014361988b6f0eb91f87bdb6712e633cadfbf26d5cd12f2d188b865ca6f0e1b3")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.9.18%2B20231002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("02f5c6bf29f173fe1653965409b891691ab413e579766d3e5bccdc74634b9bde")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.9.18%2B20231002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("0ee342ed3d6051a41e7702bec98db463c5ffe4dcb634e10cae464e42adb2fb3e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.9.18%2B20231002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("4303f69c1fbec2c933ff7ac6f2195fc66844223f66341c819fee69a12cb816f7")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("de2eab48ca487550258db38b38cb9372143283f757b3cf9ec522eb657e41a035")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("2902e2a0add6d584999fa27896b721a359f7308404e936e80b01b07aa06e8f5e")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("9984f59284048608f6734b032ff76e6bc3cb208e2235fdb511b0e478158fdb2b")), @@ -240,6 +252,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: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.8.18%2B20231002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("92ebfe81d78d4e28d8a02a29f540e4db785a5e9b51559d85013f57ffe3a6f985")), + (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/20231002/cpython-3.8.18%2B20231002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("10abf67384ea0728fff82782408f8e398bc17ef55985d6ebef2aaae319a7df31")), + (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/20231002/cpython-3.8.18%2B20231002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("6ca00494d1e169b736d09b43d1b700b48d8ecdb9fabfcff8e1c6748f6446ee3c")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.8.18%2B20231002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("286910aea21d8c7a5b0ecda6214eec6c197122b7b738fdfd6ed59f7c0ba9f65f")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.8.18%2B20231002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("b89799abf243739a4ef5b71e7373e45e56e097aec0853b813aa31d1dcb68799e")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.8.18%2B20231002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("1ccf8abb4f8ba2d8fe8c172d66901ea339d7b6b825fc6094603764954a68071b")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("efdf69695af469da13f86d5be23556fee6c03f417f8810fca55307a63aabf08d")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d08a542bed35fc74ac6e8f6884c8aa29a77ff2f4ed04a06dcf91578dea622f9a")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("aaf4b15bdc35674dbe25d4538c9e75e243796a0cc8841fd31d7bbbee6703342a")), diff --git a/rye/src/sources.rs b/rye/src/sources.rs index 31b2e33c6b..1bd8374af8 100644 --- a/rye/src/sources.rs +++ b/rye/src/sources.rs @@ -339,8 +339,4 @@ pub fn iter_downloadable<'s>( fn test_get_download_url() { let url = get_download_url(&"cpython-aarch64-macos@3.8.14".parse().unwrap()); assert_eq!(url, Some((PythonVersion { name: "cpython".into(), arch: "aarch64".into(), os: "macos".into(), major: 3, minor: 8, patch: 14, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20221002/cpython-3.8.14%2B20221002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d17a3fcc161345efa2ec0b4ab9c9ed6c139d29128f2e34bb636338a484aa7b72")))); - let url = get_download_url(&"cpython-aarch64-macos@3.8".parse().unwrap()); - assert_eq!(url, Some((PythonVersion { name: "cpython".into(), arch: "aarch64".into(), os: "macos".into(), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d08a542bed35fc74ac6e8f6884c8aa29a77ff2f4ed04a06dcf91578dea622f9a")))); - let url = get_download_url(&"cpython-aarch64-macos@3".parse().unwrap()); - assert_eq!(url, Some((PythonVersion { name: "cpython".into(), arch: "aarch64".into(), os: "macos".into(), major: 3, minor: 11, patch: 5, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.11.5%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("7bee180b764722a73c2599fbe2c3a6121cf6bbcb08cb3082851e93c43fe130e7")))); } From a0383d24e4589322b35bdfdcaade16fb4b16d942 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 3 Oct 2023 14:13:06 +0200 Subject: [PATCH 008/166] 0.15.0 --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a00ce64fc7..167535b6aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,14 +3,14 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. + + ## 0.15.0 -_Unreleased_ +Released on 2023-10-03 - Added support for Python 3.12. #462 - - ## 0.14.0 Released on 2023-10-01 From 6e425ef5576e0ef707c973a3c7118499d373d35c Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 3 Oct 2023 14:47:06 +0200 Subject: [PATCH 009/166] 0.16.0 ready for dev --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 167535b6aa..4c964d758f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.16.0 + +_Unreleased_ + ## 0.15.0 diff --git a/Cargo.lock b/Cargo.lock index a02a66d065..2786a8a475 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1772,7 +1772,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.15.0" +version = "0.16.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index e8f81f6550..a58160e7ee 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.15.0" +version = "0.16.0" edition = "2021" license = "MIT" From 33a944a3fca17ea76c4d7d2e350e9c46bb6aa38f Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 3 Oct 2023 14:54:26 +0200 Subject: [PATCH 010/166] Fix python3 shim not being updated correctly Fixes #464 --- rye/src/bootstrap.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index ef58585a34..74a88c6c3d 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -224,6 +224,7 @@ pub fn update_core_shims(shims: &Path, this: &Path) -> Result<(), Error> { } else { fs::remove_file(shims.join("python")).ok(); symlink_file(this, shims.join("python")).context("tried to symlink python shim")?; + fs::remove_file(shims.join("python3")).ok(); symlink_file(this, shims.join("python3")).context("tried to symlink python3 shim")?; } } From 3fa5bfaa59004b272706e50f6d5ad1beb1d00ade Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 3 Oct 2023 14:55:13 +0200 Subject: [PATCH 011/166] 0.15.1 --- CHANGELOG.md | 6 ++++-- Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c964d758f..63dddfdc5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. -## 0.16.0 +## 0.15.1 -_Unreleased_ +Released on 2023-10-03 + +- Fixed the updater not replacing the python3 shim correctly. diff --git a/Cargo.lock b/Cargo.lock index 2786a8a475..7db67da524 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1772,7 +1772,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.16.0" +version = "0.15.1" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index a58160e7ee..b905ba560a 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.16.0" +version = "0.15.1" edition = "2021" license = "MIT" From 78d1a2a874ded2e8beb93f68a3fcf8e609dc67f7 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 3 Oct 2023 14:56:47 +0200 Subject: [PATCH 012/166] 0.16 ready for dev --- CHANGELOG.md | 8 ++++++-- Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63dddfdc5b..9b70f40e0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,14 +3,18 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.16.0 + +_Unreleased_ + + + ## 0.15.1 Released on 2023-10-03 - Fixed the updater not replacing the python3 shim correctly. - - ## 0.15.0 Released on 2023-10-03 diff --git a/Cargo.lock b/Cargo.lock index 7db67da524..2786a8a475 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1772,7 +1772,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.15.1" +version = "0.16.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index b905ba560a..a58160e7ee 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.15.1" +version = "0.16.0" edition = "2021" license = "MIT" From e2beb3a90bc86ed8a23a750d5d9f36e0b5d394fa Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 4 Oct 2023 11:38:23 +0200 Subject: [PATCH 013/166] Fix bootstrapper on Linux --- CHANGELOG.md | 8 +++++--- Cargo.lock | 2 +- rye/Cargo.toml | 2 +- rye/src/bootstrap.rs | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b70f40e0a..23011aaa70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,11 +3,13 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. -## 0.16.0 + -_Unreleased_ +## 0.15.2 - +Released on 2023-10-04 + +- Fixed the updater not replacing the python shim correctly on Linux. ## 0.15.1 diff --git a/Cargo.lock b/Cargo.lock index 2786a8a475..892612190b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1772,7 +1772,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.16.0" +version = "0.15.2" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index a58160e7ee..283d1b687b 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.16.0" +version = "0.15.2" edition = "2021" license = "MIT" diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index 74a88c6c3d..3c9ae4c56f 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -212,6 +212,7 @@ pub fn update_core_shims(shims: &Path, this: &Path) -> Result<(), Error> { // for instance is needed when the rye executable is placed on a different volume // than ~/.rye/shims if cfg!(target_os = "linux") { + fs::remove_file(shims.join("python")).ok(); if fs::hard_link(this, shims.join("python")).is_err() { fs::copy(this, shims.join("python")).context("tried to copy python shim")?; } From 1945cbd4ba9f08bf8d25fec439a7d583416a473b Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 5 Oct 2023 10:32:10 +0200 Subject: [PATCH 014/166] Always expand installation instructions --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index cf0efe0abb..e62661bd20 100644 --- a/docs/index.md +++ b/docs/index.md @@ -21,7 +21,7 @@ but feedback and suggestions are greatly appreciated. Sponsor

-??? abstract "Installation Instructions" +!!! abstract "Installation Instructions" {% include-markdown ".includes/quick-install.md" %} From 952581aa18a2a8947f3b6e847261d4b452806108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 5 Oct 2023 15:39:20 -0500 Subject: [PATCH 015/166] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20micro-typo?= =?UTF-8?q?=20in`=20docs/philosophy.m`=20(#465)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ✏️ Fix micro-typo in` docs/philosophy.m` * ✏️ Fix a couple of typos --- docs/philosophy.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/philosophy.md b/docs/philosophy.md index 4f7bebbecc..262c3b92fc 100644 --- a/docs/philosophy.md +++ b/docs/philosophy.md @@ -113,7 +113,7 @@ what a potential tool like rye could be. It might as well be that one of the ma tools that exist today, turn into that very tool that is described here. My sentiment is that unless "the one tool" can emerge in the Python world, the -introduction of yet another tool might be a neg-negative to the ecosystem. Plenty of +introduction of yet another tool might be a net-negative to the ecosystem. Plenty of tools have been created over the years, and unfortunately it hasn't been able to rally the majority of the Python community behind any tool. I do however believe it is possible. @@ -148,7 +148,7 @@ the existing ones. Here is what I believe a resolver needs to be able to accomp * **Allow resolving across markers:** most resolvers in the Python ecosystem today can only resolve for the current interpreter and platform (eg: pip, pip-tools). This means it cannot - create a resolution that is equally valid for a different platform. In parts this is + create a resolution that is equally valid for a different platform. In part this is a problem because of how environment markers in Python are defined. They allow a level of expressiveness that cannot be reflected by most tools, however a subset could be supported. @@ -283,7 +283,7 @@ invalid dependency references. If no valid reference remains, the package will #### Every Project in a Virtualenv -While virtualenv is not by favorite tool, it's the closest we have to a standard. I proposed +While virtualenv is not my favorite tool, it's the closest we have to a standard. I proposed that there is always one path for a virtualenv `.venv` and when Rye manages it, users should not interact with it manually. It's at that point rye's responsibility to manage it, and it shall manage it as if it was a throw-away, always re-creatable scratch-pad for dependencies. From 6c20deb0d83ba21101b0f3489356495d06e8e15a Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 9 Oct 2023 16:17:25 +0200 Subject: [PATCH 016/166] Update curl --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 892612190b..3f9826b530 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -463,9 +463,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.61+curl-8.0.1" +version = "0.4.67+curl-8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d05c10f541ae6f3bc5b3d923c20001f47db7d5f0b2bc6ad16490133842db79" +checksum = "3cc35d066510b197a0f72de863736641539957628c8a42e70e27c66849e77c34" dependencies = [ "cc", "libc", @@ -473,7 +473,7 @@ dependencies = [ "openssl-sys", "pkg-config", "vcpkg", - "winapi", + "windows-sys 0.48.0", ] [[package]] From 068a9acaa3e3aacec93f82c7dde9a10c052175d6 Mon Sep 17 00:00:00 2001 From: Sakti Dwi Cahyono Date: Wed, 25 Oct 2023 16:13:20 +0700 Subject: [PATCH 017/166] Update rust.md (#479) Fix change directory when creating a new project using `maturin` build system --- docs/guide/rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/rust.md b/docs/guide/rust.md index 503bccd4f7..b0b13a5846 100644 --- a/docs/guide/rust.md +++ b/docs/guide/rust.md @@ -8,7 +8,7 @@ with `rye init`. ``` rye init my-project --build-system maturin -cd maturin +cd my-project ``` The following structure will be created: From 2bd4a8bbff713c335cbf37a39110ad611d3aa28b Mon Sep 17 00:00:00 2001 From: Chaojie Date: Wed, 25 Oct 2023 17:13:34 +0800 Subject: [PATCH 018/166] Fix the error when build with --clean (#476) --- rye/src/cli/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rye/src/cli/build.rs b/rye/src/cli/build.rs index 30a2d76ac1..22bafe229f 100644 --- a/rye/src/cli/build.rs +++ b/rye/src/cli/build.rs @@ -52,7 +52,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { None => project.workspace_path().join("dist"), }; - if cmd.clean { + if out.exists() && cmd.clean { for entry in fs::read_dir(&out)? { let path = entry?.path(); if path.is_file() { From 6ac3f5119f02b25a9befcc9d05f7648d71700c49 Mon Sep 17 00:00:00 2001 From: xzmeng Date: Fri, 27 Oct 2023 04:07:53 +0800 Subject: [PATCH 019/166] Document how to configure shell completion (#478) --- docs/guide/installation.md | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 85a938cc84..3c5ab8915d 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -107,6 +107,54 @@ interpreter. There is a quite a bit to shims and their behavior. Make sure to [read up on shims](shims.md) to learn more. +## Shell Completion + +Rye supports generating completion scripts for Bash, Zsh, Fish or Powershell. Here are some common locations for each shell: + +=== "Bash" + + ```bash + mkdir -p ~/.local/share/bash-completion/completions + rye self completion > ~/.local/share/bash-completion/completions/rye.bash + ``` + +=== "Zsh" + + ```bash + # Make sure ~/.zfunc is added to fpath, before compinit. + rye self completion -s zsh > ~/.zfunc/_rye + ``` + + Oh-My-Zsh: + + ```bash + mkdir $ZSH_CUSTOM/plugins/rye + rye self completion -s zsh > $ZSH_CUSTOM/plugins/rye/_rye + ``` + + Then make sure rye plugin is enabled in ~/.zshrc + +=== "Fish" + + ```bash + rye self completion -s fish > ~/.config/fish/completions/rye.fish + ``` + +=== "Powershell" + + ```ps1 + # Create a directory to store completion scripts + mkdir $PROFILE\..\Completions + echo @' + Get-ChildItem "$PROFILE\..\Completions\" | ForEach-Object { + . $_.FullName + } + '@ | Out-File -Append -Encoding utf8 $PROFILE + # Generate script + Set-ExecutionPolicy Unrestricted -Scope CurrentUser + rye self completion -s powershell | Out-File -Encoding utf8 $PROFILE\..\Completions\rye_completion.ps1 + ``` + ## Updating Rye To update rye to the latest version you can use `rye` itself: From 4e4d5679af9284d4854c3814724f08f3373189ec Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 26 Oct 2023 22:20:24 +0200 Subject: [PATCH 020/166] Detect windows python shim (#486) --- CHANGELOG.md | 7 +++ rye/src/cli/shim.rs | 119 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 116 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23011aaa70..e2a9387c25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.16.0 + +_Unreleased_ + +- Rye now detects the dummy Python shim that starts the windows store and + refuses to consider it. #486 + ## 0.15.2 diff --git a/rye/src/cli/shim.rs b/rye/src/cli/shim.rs index 3002467e33..c2276b3c19 100644 --- a/rye/src/cli/shim.rs +++ b/rye/src/cli/shim.rs @@ -6,7 +6,6 @@ use std::str::FromStr; use anyhow::{anyhow, bail, Context, Error}; use same_file::is_same_file; use std::process::Command; -use which::which_in_global; use crate::bootstrap::{ensure_self_venv, get_pip_runner}; use crate::config::Config; @@ -75,28 +74,121 @@ fn get_pip_shim( /// placed in the virtualenv. fn find_shadowed_target(target: &str, args: &[OsString]) -> Result>, Error> { let exe = env::current_exe()?; + for bin in which::which_all(target)? { if is_same_file(&bin, &exe).unwrap_or(false) { continue; } + + // on windows we also want to filter out the windows store python + #[cfg(windows)] + { + if is_pointless_windows_store_applink(&bin) { + continue; + } + } + let mut args = args.to_vec(); args[0] = bin.into(); return Ok(Some(args)); } + Ok(None) } +/// On windows we might encounter the windows store proxy shim. This requires +/// quite a bit of custom logic to figure out what this thing does. +/// +/// This is a pretty dumb way. We know how to parse this reparse point, but Microsoft +/// does not want us to do this as the format is unstable. So this is a best effort way. +/// we just hope that the reparse point has the python redirector in it, when it's not +/// pointing to a valid Python. +#[cfg(windows)] +fn is_pointless_windows_store_applink(path: &std::path::Path) -> bool { + use std::os::windows::fs::MetadataExt; + use std::os::windows::prelude::OsStrExt; + use winapi::um::fileapi::{CreateFileW, OPEN_EXISTING}; + use winapi::um::handleapi::{CloseHandle, INVALID_HANDLE_VALUE}; + use winapi::um::ioapiset::DeviceIoControl; + use winapi::um::winbase::{FILE_FLAG_BACKUP_SEMANTICS, FILE_FLAG_OPEN_REPARSE_POINT}; + use winapi::um::winioctl::FSCTL_GET_REPARSE_POINT; + use winapi::um::winnt::{FILE_ATTRIBUTE_REPARSE_POINT, MAXIMUM_REPARSE_DATA_BUFFER_SIZE}; + + // only if we are in the special WindowsApps folder and we are called + // python, we can be a relevant store proxy + if !path.as_os_str().to_str().map_or(false, |x| { + x.contains("Local\\Microsoft\\WindowsApps\\python") + }) { + return false; + } + + // only if the file is a reparse point, is it relevant. + let md = match std::fs::symlink_metadata(path) { + Ok(md) => md, + Err(_) => return false, + }; + if md.file_attributes() & FILE_ATTRIBUTE_REPARSE_POINT == 0 { + return false; + } + + let mut path_encoded = path.as_os_str().encode_wide().collect::>(); + let reparse_handle = unsafe { + CreateFileW( + path_encoded.as_mut_ptr(), + 0, + 0, + std::ptr::null_mut(), + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, + std::ptr::null_mut(), + ) + }; + + if reparse_handle == INVALID_HANDLE_VALUE { + return false; + } + + let mut buf = [0u16; MAXIMUM_REPARSE_DATA_BUFFER_SIZE as usize]; + let mut bytes_returned = 0; + let success = unsafe { + DeviceIoControl( + reparse_handle, + FSCTL_GET_REPARSE_POINT, + std::ptr::null_mut(), + 0, + buf.as_mut_ptr() as *mut _, + buf.len() as u32 * 2, + &mut bytes_returned, + std::ptr::null_mut(), + ) != 0 + }; + + unsafe { + CloseHandle(reparse_handle); + } + + success && String::from_utf16_lossy(&buf).contains("\\AppInstallerPythonRedirector.exe") +} + +fn is_python_shim(target: &str) -> bool { + matches_shim(target, "python") || matches_shim(target, "python3") +} + /// Figures out where a shim should point to. -fn get_shim_target(target: &str, args: &[OsString]) -> Result>, Error> { +fn get_shim_target( + target: &str, + args: &[OsString], + pyproject: Option<&PyProject>, +) -> Result>, Error> { // if we can find a project, we always look for a local virtualenv first for shims. - if let Ok(pyproject) = PyProject::discover() { + if let Some(pyproject) = pyproject { // However we only allow automatic synching, 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")?; } - if (matches_shim(target, "python") || matches_shim(target, "python3")) + if is_python_shim(target) && args .get(1) .and_then(|x| x.as_os_str().to_str()) @@ -107,7 +199,7 @@ fn get_shim_target(target: &str, args: &[OsString]) -> Result Result Result bool { /// executable is invoked as a shim executable. pub fn execute_shim(args: &[OsString]) -> Result<(), Error> { if let Some(shim_name) = detect_shim(args) { - if let Some(args) = get_shim_target(&shim_name, args)? { + let pyproject = PyProject::discover().ok(); + if let Some(args) = get_shim_target(&shim_name, args, pyproject.as_ref())? { match spawn_shim(args)? {} + } else if is_python_shim(&shim_name) { + if pyproject.is_some() { + bail!("target python binary '{}' not found in project. Most likely running 'rye sync' will resolve this.", shim_name); + } else { + bail!("target python binary '{}' not found. You're outside of a project, consider enabling global shims: https://rye-up.com/guide/shims/#global-shims", shim_name); + } } else { - bail!("target shim binary not found"); + bail!("target shim binary '{}' not found", shim_name); } } Ok(()) From e8d6f9f8fa2bf812e0c6ddba7de6382c96e7cd0c Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 28 Oct 2023 11:45:05 +0200 Subject: [PATCH 021/166] Dump my unstructured notes on what a meta server might be --- notes/README.md | 5 ++ notes/metasrv.md | 123 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 notes/README.md create mode 100644 notes/metasrv.md diff --git a/notes/README.md b/notes/README.md new file mode 100644 index 0000000000..950ccb84ef --- /dev/null +++ b/notes/README.md @@ -0,0 +1,5 @@ +# Notes + +This folder contains various thoughts and notes about Python packaging. + +* [Meta Server](metasrv.md): why a meta data server should exist. \ No newline at end of file diff --git a/notes/metasrv.md b/notes/metasrv.md new file mode 100644 index 0000000000..d25eb402ae --- /dev/null +++ b/notes/metasrv.md @@ -0,0 +1,123 @@ +# Meta Server + +*This document collects my notes on what a meta server might look like. That's not a fully fleshed +out proposal in itself.* + +Today Python installers install packages from package repositories. Typically this is `PyPI` but +really it can be almost anything that contains directory listing in HTML formats as the "simple" +index is basically defined to be some HTML structure that the installers parse. + +The more I spent on Python packaging the more I think that this system has value, but really needs +an auxiliary system to function properly. This document describes this system (referred to as +"Meta Server" or "metasrv"), why it should exist and how it could behave. + +## Targeting + +Today when installing packages, one configures an index. For instance `https://pypi.org/simple/`. +If you have ever hit that URL you will have realized that it's an enormous HTML with every single +package very uploaded to PyPI. Yet this is still in some sense the canonical way to install +packages. If you for instance use `Rye` today you configure the index by pointing to that URL. + +With the use of a **meta server**, one would instead point it to a meta server instead. So for instance +the meta server for `pypi.org` could be hosted at a different URL, say `https://meta.pypi.org/`. +That meta server URL fully replaces the existing index URL. Each meta server is supposed to target +a single index only. A package manager _only_ interfaces with the meta server and it's the meta +server's responsibility to surfaces packages from the index it manages. The index server is in this +proposal referred to as **source repository**. + +## Purpose + +The purpose of the meta server is manyfold: + +* Expose an efficient index of all packages and versions hosted by the source repository. +* Cache original meta-data information from source archives and wheels +* Expose patched meta data information for resolvers (see note below) +* Accept "writes" from trusted parties to augment meta data entries (see note below) +* Maintain a list of well known marker values + +The meta server can be self hosted, or it's hosted on behalf of a package management index. It +by definition targets a single source repository. For a company internal package index it for +instance would be possible to host the packages on an S3 bucket and to have a running meta server +fronting it. + +### Efficient Index + +It should be possible to replicate the index locally or to efficiently browse it partially via +a RESTful API. The main lookup forms are: + +1. Finding the canonical name of a package "foo" -> "Foo" if that's the registered name +2. Discovering all published versions of a package +3. Discovering the resolver relevant metadata + +Note that the resolver relevant metadata might undergood patching. That is to say that the +metadata is both exposed as stored in the wheel, but primarily exposed with manipulations +performed above. + +The goal here is to also expose meta data from packages built from source so that a resolver does +not need to build source packages as part of resolving. + +### Patched Meta Data + +An installer and resolver is only useful if it's capable of installing the current state of the +Python world. In practice there are packages that can be installed and combined with other +packages despite of their stated version ranges. In particular upper bounds cause challenges +for packages today. The goal for a meta server would be to accept patches to override these +dependencies after the publishing of a package. As these overrides are unlikely to be shared +across the entire ecosystem, an idea is that these patches are local to an "understanding" +(see next section). + +### Trusted Writes + +For patched meta data the question comes up how such updates should be received. In my mind the +source repository behind it represents the truth at the package publish time, whereas the meta +server reporesents the evolving understanding at a certain point in time from that point onwards. + +There are three almost natural ways in which this changing understanding can evolve over time: + +- ecosystems might develop a better understanding of dependency compatibility: for instance the + pallets ecosystem might have a better understanding of which packages are in practice compatible + with each other. In a more complex world FastAPI and Pydantic might consider themselves a shared + ecosystem and might develop a shared understanding of compatibility. +- there are people that might consider themselves auditors and might want to "notarize" packages + before the even become available for installing. They might want to add a layer of trust where + they independently [audit packages](https://lucumr.pocoo.org/2016/3/24/open-source-trust-scaling/). + As part of that auditing that might not just make packages available, they might also want to + override meta data for better compatibility. +- the community as a hole might discover that some dependency bounds are too narrowly defined and + express a desire to override it. + +What all of these have in common are the following two aspects: + +- there might not be consensus +- the understanding might change over time + +I'm not sure what the right way is to approach this, but maybe the reality is that a meta server +might just have to roll with it and serve up different "understandings". Maybe the most trivial +way would be that the meta server proxies more than one git repository that acts as the truth of +these patched mata data infos and users opt-into these via their installers. Over time maybe some +understanding emerges which overrides are more appropriate. + +So workflow wise the meta server might not directly accept writes, but it might become an arbiter +of where the writes should go. So the "writes" here are really just virtual in the sense that +a tool might want to publish overwrites, but receives the information from the meta server where +these writes go (eg: which git repo) for a specific "understanding" they want to publish to. + +An "understanding" in that sense is a freely defined thing that gets registered once with the +meta server. For instance the meta server for `meta.pypy.org` could register the "pallets" +understanding. A hypothetical `tool upload-override --package Flask --version 2.0 --file metadata.json --understanding pallets` +would receive from the meta server the location of a git repository where that metadata file +should be placed. The user when installing would opt into one or multiple understandings which +are reified locally. + +### Known Marker Values + +In addition to good meta data, a resolver in Python also needs a better understanding of which +markers exist and are worth supporting. To understand the motivation here: lock files ideally +contain enough information to not just install for your local machine, but also other versions +of Python or windows versions. However actually doing so requires knowledge of what else is out +there. + +There might be blessed sets of marker values that can be discovered via the meta server. As an +example there might be a set of marker values called `linux_macos_windows-36m` which holds all +marker values for linux, macos and windows for supported Python versions that cover the last 36 +months. From 0b8099ea3108cb2146303163785bdb2f279b8948 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 28 Oct 2023 20:52:53 +0200 Subject: [PATCH 022/166] Fix typo --- notes/metasrv.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes/metasrv.md b/notes/metasrv.md index d25eb402ae..2a05aae99e 100644 --- a/notes/metasrv.md +++ b/notes/metasrv.md @@ -94,7 +94,7 @@ What all of these have in common are the following two aspects: I'm not sure what the right way is to approach this, but maybe the reality is that a meta server might just have to roll with it and serve up different "understandings". Maybe the most trivial way would be that the meta server proxies more than one git repository that acts as the truth of -these patched mata data infos and users opt-into these via their installers. Over time maybe some +these patched meta data infos and users opt-into these via their installers. Over time maybe some understanding emerges which overrides are more appropriate. So workflow wise the meta server might not directly accept writes, but it might become an arbiter From 14b4cbb3fe983a7832b9c51ac6c66d7e5e904717 Mon Sep 17 00:00:00 2001 From: acethical Date: Sat, 4 Nov 2023 09:38:42 +0000 Subject: [PATCH 023/166] fix typo (#488) Co-authored-by: cat --- docs/guide/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 3c5ab8915d..2bf1b0b7ef 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -73,7 +73,7 @@ interpreter. === "Fish" - Since fish does not support `env`` files, you instead need to add + Since fish does not support `env` files, you instead need to add the shims directly. This can be accomplished by running this command once: From 6219f4e3d22ccea9931d58857020db028fb2c9ca Mon Sep 17 00:00:00 2001 From: Ned Western Date: Sat, 4 Nov 2023 20:38:56 +1100 Subject: [PATCH 024/166] Update index.md (#490) --- docs/guide/toolchains/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/guide/toolchains/index.md b/docs/guide/toolchains/index.md index a8635408dd..96a1cbb0b9 100644 --- a/docs/guide/toolchains/index.md +++ b/docs/guide/toolchains/index.md @@ -1,6 +1,6 @@ # Toolchain Management -Rye is unique in that it does not use system Python installations. Instead if downloads +Rye is unique in that it does not use system Python installations. Instead it downloads and manages Python installations itself (called toolchains). Today there are three types of toolchains supported by Rye and they require some understanding: @@ -9,7 +9,7 @@ three types of toolchains supported by Rye and they require some understanding: [indygreg/python-build-standalone](https://github.com/indygreg/python-build-standalone) * [**Official PyPy Builds**](pypy.md): PyPy is supported from the official release builds. * [**Custom Local Toolchains**](#registering-toolchains): locally installed Python interpreters can be - registered with Rye. Afterwards they can be used with any Rye managed project. + registered with Rye. Afterwards, they can be used with any Rye managed project. ## Pinning Toolchains @@ -22,7 +22,7 @@ rye pin cpython@3.11.4 ``` Pinning a downloadable version means that Rye will automatically fetch it when necessary. -By default toolchains are pinned to a precise version. This means that even if you +By default, toolchains are pinned to a precise version. This means that even if you write `rye pin cpython@3.11`, a very specific version of cpython is written into the `.python-version` file. With Rye 0.5.0 onwards it's possible to perform "relaxed" pins: @@ -43,7 +43,7 @@ available compatible version for the virtual environment. Support for fetching and pinning of non-native architectures was added. -By default the pin is for the architecture of the running machine. This means that +By default, the pin is for the architecture of the running machine. This means that if you pin `cpython@3.11` on a mac with aarch64 architecture, you will use a cpython interpreter of that CPU architecture. A different architecture can be selected by adding `-{arch}` to the python family name. So for instance to force a `x86_64` version @@ -89,7 +89,7 @@ Toolchains are fetched from two sources: ## Registering Toolchains -Additionally it's possible to register an external toolchain with the `rye toolchain register` +Additionally, it's possible to register an external toolchain with the `rye toolchain register` command. ``` From 14a8c7cde7b8007ff16cac81e3e6ef38ee593e9a Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 4 Nov 2023 12:47:07 +0100 Subject: [PATCH 025/166] Added marker notes --- notes/markers.md | 130 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 notes/markers.md diff --git a/notes/markers.md b/notes/markers.md new file mode 100644 index 0000000000..dcbd047ac8 --- /dev/null +++ b/notes/markers.md @@ -0,0 +1,130 @@ +# Markers or Locking + +*This document collects my notes on locking. That's not a fully fleshed out proposal in itself.* + +One of the largest challenges with creating lock files is that there is a desire to make lock files +that are portable. Portable means that the lock file should incorporate enough information that it +can be taken from one computer to the next one, and the lock file can be re-used even if the Python +version changed or the operating system is a different one. + +## General Challenges + +There are a handful of basic challenges with portable lock files. These are largely independent of +the "marker problem" that this document describes, but they are important to understand nontheless + +* source distributions can have unstable dependencies. This means that for instance running `setup.py` + on one machine might produce dramatically different version dependencies than running this on another + machine. They are in that sense in some cases **not using markers**. +* wheels might have conflicting version dependencies. This can be a result of the previous bullet, or + as a deliberate choice. That means that even for the same package version there are wheels which have + different dependencies for different platforms. +* Python has no general understanding of compatibility of packages on the version level. Unlike for + instance the node or rust ecosystem semver is not encoded into version numbers which means that the + resolver cannot leverage this. This also means that the ecosystem uses a lot of upper bounds. + +## Known Marker Values + +Environment markers exist in all kinds of flavors. They describe under which circumstances a dependency +must be used. This can be done in quite extreme manners. For instance the following is a valid +dependency declaration: + +```toml +[project] +dependencies = [ + 'more-itertools>=4.0.0,<6.0.0;python_version<="2.7"', + 'more-itertools>=4.0.0;python_version>"2.7"', +] +``` + +And pip lets you have requirements files like this: + +``` +"awesome_package @ https://example.com/awesome_package-cp39-cp39-linux_x86_64.whl ; sys_platform == 'linux' and python_version == '3.9'", +"awesome_package @ https://example.com/awesome_package-cp310-cp310-linux_x86_64.whl ; sys_platform == 'linux' and python_version == '3.10'", +"awesome_package @ https://example.com/python/awesome_package-cp39-cp39-macosx_12_0_x86_64.whl ; sys_platform == 'darwin' and python_version == '3.9'", +"awesome_package @ https://example.com/python/awesome_package-cp310-cp310-macosx_12_0_x86_64.whl ; sys_platform == 'darwin' and python_version == '3.10'", +``` + +It looks innocent but it basically "splits" the space in half about which packages need to be considered +for which Python version. In a sense observing markers "expands" the space of potential solutions that +need to be considered. If one only encounters a dependency without anything other than a lower bound +and no extra marker, the problem stays quite contained. But then one might encounter for the first time +a `python_version` marker and all the sudden the solutions would need to be found for ever possible +Python version that exists. Likewise the first time you come across a platform marker for +`sys_platform == 'darwin'` one would have to start going down that route as well. + +The most obvious solution would be to observe ever marker value that comes by, and to add it to the +final result set. That however potentially means that the total set of dependencies to consider is +excessive. It might also require one going down the path of evaluating a bunch of `sdist` distributions +that require building in hope of encountering more metadata. + +I believe the way PDM restricts the search space is by requiring the set of `python_version`\s that +should be considered to be configured. There are however quite a few potential complications still. +For instance it's acceptable to have something like `python_version<="3.8.1"` (eg: minor versions). +PDM also [collapses some markers together](https://github.com/pdm-project/pdm/issues/46) resolving in +incorrect lockfiles. + +### Goal Setting + +I believe that markers need to be supported, but they probably should be restricted for the following +three goals: + +1. fast resolving: reduce the total set of versions to be considered early +2. common cases: support common marker configurations that actually happen +3. finding a solution: the resolver should result in a solution, even if that solution might be a "bit" wrong. + +The third point probably requires a bit of explanation: today many packages are only installable by +lying about version constraints somewhere. In parts that's because packages define upper bounds of +dependencies in anticipation of future incompatiblity that might not even exist. + +### Reducing The Problem Space + +In some sense a potential option is to just have a fully exploded set of permutations of markers and then +create resolutions for all those. At least for the combination of Python version and operating system +that might even work, if Python versions are limited to major versions (or a specific minor version +is targeted). + +An appealing option would be to just only use Python version ranges (which are likely to be required +anyways by the root package) and to disregard all platform markers for the resolution. Only at an +installation time would the platform markers come into play. I believe this model to work somewhat, +but there are definitely challenges. First of all this model would need to take disjoint markers into +account where different platforms might demand different packages. This not only has an effect on that +package, but on the total set of packages to consider for resolution as each of those packages can +pull in further dependencies. In a sense, the resolver would "fork" whenever it encounters conflicting +constraints on dependencies. This can quickly explode in complexity and that's an issue that poetry +is frequently running into in scientific Python ecosystem (see +[Multiple constraints on same package cause O(exp(N)) checks](https://github.com/python-poetry/poetry/issues/5121)). + +I believe the only real solution is to dramatically reduce the total number of permutations that can +be considered. This reduction in permutations I think can only come from dramatically merging versions +eagerly. + +As an extreme example this is what `opencv-python` likes to declare with markers: + +``` +numpy >=1.13.3 ; python_version < "3.7" +numpy >=1.21.0 ; python_version <= "3.9" and platform_system == "Darwin" and platform_machine == "arm64" +numpy >=1.21.2 ; python_version >= "3.10" +numpy >=1.21.4 ; python_version >= "3.10" and platform_system == "Darwin" +numpy >=1.23.5 ; python_version >= "3.11" +numpy >=1.19.3 ; python_version >= "3.6" and platform_system == "Linux" and platform_machine == "aarch64" +numpy >=1.17.0 ; python_version >= "3.7" +numpy >=1.17.3 ; python_version >= "3.8" +numpy >=1.19.3 ; python_version >= "3.9" +``` + +Even reducing the total space of supported Python versions is still a lot. Maybe a user just does not +care about macOS, in which case it's not helpful considering those constraints. Likewise there is a not +insignificant chance that the root application is untested/does not support arm64. What's also worth +pointing out here is that `platform_machine` doesn't have consistent values. For instance an aarch64 CPU +can be identified by `arm64` on macOS but `aarch64` on Linux. + +The easiest way to reduce the space would be to be strict about pruning part of the resolved space that +is irrelevant in general, or at least irrelevant to the project. So any version constraint lower than +what is the lower bound of the root library can be removed entirely. Likewise during resolution it might +be possible to make a pass over the absolute lowest versions supported of a dependency to reduce the +search space. + +Instead of asking a user to manually restrict the problem space, it might be reasonable to work +with known ecosystem markers. Eg: this project targets mac + linux + windows of release versions +of libraries in the last 12 months. See also some notes in [`metasrv`](metasrv.md). From c4531df8f99addb6d7bb2157ba836bd2555ca026 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 13 Nov 2023 10:37:37 +0100 Subject: [PATCH 026/166] More PEP 508 notes --- notes/pep508.md | 151 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 notes/pep508.md diff --git a/notes/pep508.md b/notes/pep508.md new file mode 100644 index 0000000000..85135f85c9 --- /dev/null +++ b/notes/pep508.md @@ -0,0 +1,151 @@ +# PEP 508 Limitations + +*This document collects my notes on PEP 508.* + +A package manager for Python is naturally constrained by the metadata format that the +community embraces. While a package manager can in theory add a custom metadata format +like poetry did, it limits the ability to publish such packages and prevents inter-tool +compatibility. + +The metadata format in the Python ecosystem is the `pyproject.toml` and the most significant +limitation is the dependency specification from [PEP 508](https://peps.python.org/pep-0508/). + +## Dependency Array Limitations + +For a package manager the most important piece of information are dependencies. In Python +there are two dependency sections, both are very limited in that they are lists of strings. + +For instance `project.dependencies` is an array where each item is a PEP 508 string. This +means that within that array, only information can be carried that PEP 508 supports. If a +package manager requires additional information (temporary or permanently) it does not find +place in the array for it. + +Example: + +```toml +[project] +dependencies = [ + 'Flask>=2.0', + 'more-itertools>=4.0.0,<6.0.0;python_version<="2.7"', + 'more-itertools>=4.0.0;python_version>"2.7"', +] +``` + +If additional information wants to be stored with either one of those dependencies, the only +reasonable correlation today would be to either duplicate it elsewhere, or to index by number. + +```toml +[tool.rye.dependencies_meta.0] +extra_information = 42 +``` + +No matter how, this is always a challenge. In `Cargo.toml` the information is both kept as +array of objects, but additionally "merging" sections are provided. This means that platform +and target specific dependencies are merged in at a higher level. Additionally if a dependency +is contained more than once, it can be renamed. For Python the `Cargo.toml` format does not make +too much sense, but some alternatives might work: + +```toml +[project.dependencies] +Flask = { version = ">=2.0" } + +[project.dependencies.more-itertools] +match = [ + { version=">=4.0.0,<6.0.0", python_version = "<=2.7" }, + { version=">=4.0.0", python_version = ">2.7" } +] +``` + +In that case at all times an object is placed in the format where extra keys could be added: + +```toml +[project.dependencies] +Flask = { version = ">=2.0", extra_information = 42 } +``` + +That however would be a significant departure from where the format is today. A pragmatic +alternative could be to utilize the URL portion of the dependency to funnel additional +information into the package. Unfortunately PyPI will refuse to accept any PEP 508 marker +that contains a URL. Additionally URLs also have restrictions in that they cannot be +combined with version markers. The former issue might not be an issue as such a +dependency could be rewritten before publishing into an automated format. +`cargo` does something like this today already with `Cargo.toml` which is rewritten for +publishing. + +Given that PEP 508 cannot really be amended without causing a massive rift in the +ecosystem the solution has to come down to encoding it into something that is already +part of the structure. My current thinking is that the format should permit objects +where the strings are today and to re-write on publish. So this format might become +possible: + +```toml +[project] +dependencies = [ + { version = 'Flask@>=2.0', extra_information = 42 }, + 'more-itertools>=4.0.0,<6.0.0;python_version<="2.7"', + 'more-itertools>=4.0.0;python_version>"2.7"', +] + +# turns into + +[project] +dependencies = [ + 'Flask@>=2.0', + 'more-itertools>=4.0.0,<6.0.0;python_version<="2.7"', + 'more-itertools>=4.0.0;python_version>"2.7"', +] + +[project.dependencies_meta.0] +exta_information = 42 +``` + +Unfortunately that would still cause issues for tools that locally interpret `pyproject.toml` +files. + +Alternatively a correlation marker could be added. This could be done by inventing a new +marker (requires double quoting): + +```toml +[project] +dependencies = [ + 'Flask@>=2.0 ; "id" == "x"', + 'more-itertools>=4.0.0,<6.0.0;python_version<="2.7"', + 'more-itertools>=4.0.0;python_version>"2.7"', +] + +[project.dependencies_meta.x] +extra_information = 42 +``` + +If the correlation marker is missing, the package name would be assumed (in this case `Flask`). + +## Local Dependencies + +In a very similar mannor local dependencies do not really work in that world yet. Personally +I believe this is similar to the issue above as we have no reasonable way to encode both the +version and the path location into one place. Contrast this to `Cargo.toml`: + +```toml +[dependencies] +foo = { version = "1.0", path = "../crates" } +``` + +Upon publishing, `cargo` removes the `path` marker. Before publishing, the `path` takes +precedence over the lookup from the index. + +If one were to be able to encode a correlation marker maybe this format could work: + + +```toml +[project] +dependencies = [ + 'Flask@>=2.0 ; "id" == "flask"', + 'more-itertools>=4.0.0,<6.0.0;python_version<="2.7"', + 'more-itertools>=4.0.0;python_version>"2.7"', +] + +[project.dependencies_meta.flask] +path = "../packages/flask" +``` + +(Again, if there is no marker, the package name could be directly used). From cb664d16f48871245320e596d7ebb84cc877abbf Mon Sep 17 00:00:00 2001 From: Chaojie Date: Tue, 21 Nov 2023 20:45:36 +0800 Subject: [PATCH 027/166] Fix the wrong spell (#501) --- notes/markers.md | 4 ++-- notes/pep508.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/notes/markers.md b/notes/markers.md index dcbd047ac8..b12fad9782 100644 --- a/notes/markers.md +++ b/notes/markers.md @@ -10,7 +10,7 @@ version changed or the operating system is a different one. ## General Challenges There are a handful of basic challenges with portable lock files. These are largely independent of -the "marker problem" that this document describes, but they are important to understand nontheless +the "marker problem" that this document describes, but they are important to understand nonetheless * source distributions can have unstable dependencies. This means that for instance running `setup.py` on one machine might produce dramatically different version dependencies than running this on another @@ -75,7 +75,7 @@ three goals: The third point probably requires a bit of explanation: today many packages are only installable by lying about version constraints somewhere. In parts that's because packages define upper bounds of -dependencies in anticipation of future incompatiblity that might not even exist. +dependencies in anticipation of future incompatibility that might not even exist. ### Reducing The Problem Space diff --git a/notes/pep508.md b/notes/pep508.md index 85135f85c9..f2cf2b1ede 100644 --- a/notes/pep508.md +++ b/notes/pep508.md @@ -121,7 +121,7 @@ If the correlation marker is missing, the package name would be assumed (in this ## Local Dependencies -In a very similar mannor local dependencies do not really work in that world yet. Personally +In a very similar manner local dependencies do not really work in that world yet. Personally I believe this is similar to the issue above as we have no reasonable way to encode both the version and the path location into one place. Contrast this to `Cargo.toml`: From 92b571bfd42e5748d2e535174d78fc7311a889a3 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Mon, 4 Dec 2023 22:36:20 +0000 Subject: [PATCH 028/166] Fix release.yml dry run (#510) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Whilst adapting your workflow for my own nefarious purposes, I found this was broken 😄 --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a21304366e..38993719dc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -164,7 +164,7 @@ jobs: fi - name: Upload release archive - if: ${{ needs.create-release.outputs.rye_dry_run }} != 'yes' + if: ${{ needs.create-release.outputs.rye_dry_run != 'yes' }} env: GH_TOKEN: ${{ github.token }} run: | @@ -193,7 +193,7 @@ jobs: uses: actions/checkout@v3 - name: Upload Release Meta - if: ${{ needs.create-release.outputs.rye_dry_run }} != 'yes' + if: ${{ needs.create-release.outputs.rye_dry_run != 'yes' }} shell: bash env: GH_TOKEN: ${{ github.token }} From 0ef18c40cee2b4b5546bf56e6c8ef26982c7a8ec Mon Sep 17 00:00:00 2001 From: ZihanType <47711605+ZihanType@users.noreply.github.com> Date: Sun, 17 Dec 2023 06:15:44 +0800 Subject: [PATCH 029/166] Fix config key (#520) --- docs/guide/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/config.md b/docs/guide/config.md index 8096b27984..62797a5195 100644 --- a/docs/guide/config.md +++ b/docs/guide/config.md @@ -97,7 +97,7 @@ keys are in dotted notation. `--get` reads a key, `--set`, `--set-int`, ```bash rye config --set proxy.http=http://127.0.0.1:4000 -rye config --set-bool behavior.rye-force-managed=true +rye config --set-bool behavior.force-rye-managed=true rye config --get default.requires-python ``` From c740185233532fdf01028652233f00f4ecbd1537 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 16 Dec 2023 23:42:49 +0100 Subject: [PATCH 030/166] Fix bad project setup for hatch (#521) --- CHANGELOG.md | 3 +++ pyproject.toml | 7 ++++--- rye/src/cli/init.rs | 3 +++ rye/src/pyproject.rs | 2 +- rye/src/sync.rs | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2a9387c25..51972cd0e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ that were not yet released. _Unreleased_ +- Rye now configures hatchling better in `rye init` so that it works with + hatchling 1.19 and later. #521 + - Rye now detects the dummy Python shim that starts the windows store and refuses to consider it. #486 diff --git a/pyproject.toml b/pyproject.toml index 23fa4799c8..c9d82164c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,9 +2,7 @@ name = "rye-dev" version = "0.1.0" description = "Workspace for rye development" -authors = [ - { name = "Armin Ronacher", email = "armin.ronacher@active-4.com" } -] +authors = [{ name = "Armin Ronacher", email = "armin.ronacher@active-4.com" }] dependencies = [ "mkdocs~=1.4.3", "mkdocs-material~=9.1.12", @@ -21,6 +19,9 @@ requires-python = ">= 3.8" requires = ["hatchling"] build-backend = "hatchling.build" +[tool.hatch.build.targets.wheel] +packages = ["dummy"] + [tool.rye] managed = true diff --git a/rye/src/cli/init.rs b/rye/src/cli/init.rs index 6141162957..ffbc027139 100644 --- a/rye/src/cli/init.rs +++ b/rye/src/cli/init.rs @@ -142,6 +142,9 @@ dev-dependencies = [] [tool.hatch.metadata] allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = [{{ "src/" ~ name_safe }}] {%- elif build_system == "maturin" %} [tool.maturin] diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index d1d72630c0..c8de09aa95 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -818,7 +818,7 @@ impl PyProject { Some(tbl) => tbl.iter().map(|x| x.0.to_string()).collect(), None => HashSet::new(), }; - for entry in fs::read_dir(&self.venv_bin_path()) + for entry in fs::read_dir(self.venv_bin_path()) .ok() .into_iter() .flatten() diff --git a/rye/src/sync.rs b/rye/src/sync.rs index 3444991f67..dbf97f9495 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -386,7 +386,7 @@ fn inject_tcl_config(venv: &Path, py_bin: &Path) -> Result<(), Error> { // There is only one folder in the venv/lib folder. But in practice, only pypy will use this method in linux #[cfg(unix)] fn get_site_packages(lib_dir: PathBuf) -> Result, Error> { - let entries = fs::read_dir(&lib_dir).context("read venv/lib/ path is fail")?; + let entries = fs::read_dir(lib_dir).context("read venv/lib/ path is fail")?; for entry in entries { let entry = entry?; From da48eef5685741f36f6ad01408c52a3ab3ae8cea Mon Sep 17 00:00:00 2001 From: Stephan Noel <34415120+stephan-noel@users.noreply.github.com> Date: Sat, 16 Dec 2023 19:43:04 -0300 Subject: [PATCH 031/166] Update installation.md (#517) Very small change, unneeded trailing "yet" --- docs/guide/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 2bf1b0b7ef..5cfa98ffe3 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -1,7 +1,7 @@ # Installation Rye is built in Rust. It can either be manually compiled and installed or it can -be installed from a binary distribution yet. It has support for Linux, macOS and +be installed from a binary distribution. It has support for Linux, macOS and Windows. ## Installing Rye From 1c886a446921e67e99834a939d2a0cf62a27971d Mon Sep 17 00:00:00 2001 From: Stephan Noel <34415120+stephan-noel@users.noreply.github.com> Date: Sat, 16 Dec 2023 19:44:48 -0300 Subject: [PATCH 032/166] Add default script in pyproject.toml for init (#519) --- CHANGELOG.md | 2 ++ rye/src/cli/init.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51972cd0e4..b082e5934a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ that were not yet released. _Unreleased_ +- By default a script with the name of the project is now also configured. #519 + - Rye now configures hatchling better in `rye init` so that it works with hatchling 1.19 and later. #521 diff --git a/rye/src/cli/init.rs b/rye/src/cli/init.rs index ffbc027139..ec5c1b23f9 100644 --- a/rye/src/cli/init.rs +++ b/rye/src/cli/init.rs @@ -108,6 +108,9 @@ license = { text = {{ license }} } classifiers = ["Private :: Do Not Upload"] {%- endif %} +[project.scripts] +hello = {{ name ~ ":hello"}} + [build-system] {%- if build_system == "hatchling" %} requires = ["hatchling"] From 359c66b0a55b889a68a3e219a46b629a12545836 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 17 Dec 2023 00:02:35 +0100 Subject: [PATCH 033/166] 0.16.0 --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b082e5934a..8c46b89bfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. + + ## 0.16.0 -_Unreleased_ +Released on 2023-12-17 - By default a script with the name of the project is now also configured. #519 @@ -15,8 +17,6 @@ _Unreleased_ - Rye now detects the dummy Python shim that starts the windows store and refuses to consider it. #486 - - ## 0.15.2 Released on 2023-10-04 From c003223d5db575276d3ef52d31590580f3b1e97f Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 17 Dec 2023 00:04:25 +0100 Subject: [PATCH 034/166] Set 0.16.0 to Cargo.toml --- Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3f9826b530..a4a5984a04 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1772,7 +1772,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.15.2" +version = "0.16.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 283d1b687b..a58160e7ee 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.15.2" +version = "0.16.0" edition = "2021" license = "MIT" From 73086f6b79caf96c3a6bf4debfa3996008e5b084 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 17 Dec 2023 00:05:02 +0100 Subject: [PATCH 035/166] 0.17.0 ready for dev --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c46b89bfd..e352938d81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.17.0 + +_Unreleased_ + ## 0.16.0 diff --git a/Cargo.lock b/Cargo.lock index a4a5984a04..b15cc181f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1772,7 +1772,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.16.0" +version = "0.17.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index a58160e7ee..7777aced05 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.16.0" +version = "0.17.0" edition = "2021" license = "MIT" From 73e639eae83ebb48d9c8748ea79096f96ae52cf9 Mon Sep 17 00:00:00 2001 From: Chaojie Date: Sun, 17 Dec 2023 07:19:37 +0800 Subject: [PATCH 036/166] Add badges (#500) --- README.md | 26 ++++++++++++++++++++++++++ artwork/badge.json | 8 ++++++++ 2 files changed, 34 insertions(+) create mode 100644 artwork/badge.json diff --git a/README.md b/README.md index 58525541ca..f5ca7fec32 100644 --- a/README.md +++ b/README.md @@ -158,4 +158,30 @@ $ pycowsay Wow To uninstall run `rye uninstall pycowsay` again. + +## Badges + +If you're using Rye, consider adding the Rye badge to project's `README.md`: + +```md +[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/mitsuhiko/rye/main/artwork/badge.json)](https://rye-up.com) +``` + +...or `README.rst`: + +```rst +.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/mitsuhiko/rye/main/artwork/badge.json + :target: https://rye-up.com + :alt: Rye +``` + +...or, as HTML: + +```html +Rye +``` + +[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/mitsuhiko/rye/main/artwork/badge.json)](https://rye-up.com) + + License: MIT diff --git a/artwork/badge.json b/artwork/badge.json new file mode 100644 index 0000000000..146f74fb11 --- /dev/null +++ b/artwork/badge.json @@ -0,0 +1,8 @@ +{ + "label": "", + "message": "Rye", + "logoSvg": "", + "logoWidth": 12, + "labelColor": "grey", + "color": "#261230" +} \ No newline at end of file From e8404f1c77123be47c95d199426813e2cabaafe7 Mon Sep 17 00:00:00 2001 From: yokomotod Date: Thu, 28 Dec 2023 16:58:05 +0900 Subject: [PATCH 037/166] fix: default script with name_safe (#527) --- rye/src/cli/init.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rye/src/cli/init.rs b/rye/src/cli/init.rs index ec5c1b23f9..d162d18e77 100644 --- a/rye/src/cli/init.rs +++ b/rye/src/cli/init.rs @@ -109,7 +109,7 @@ classifiers = ["Private :: Do Not Upload"] {%- endif %} [project.scripts] -hello = {{ name ~ ":hello"}} +hello = {{ name_safe ~ ":hello"}} [build-system] {%- if build_system == "hatchling" %} From 65daae9a8d964c28cb586221ad72d0265177cc85 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 28 Dec 2023 08:58:33 +0100 Subject: [PATCH 038/166] Added changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e352938d81..62342fad90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ that were not yet released. _Unreleased_ +- Fixed default generated script reference. #527 + ## 0.16.0 From de7c69f8b490716bfa8633a124788e39ea89cad6 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 15 Jan 2024 22:43:47 +0100 Subject: [PATCH 039/166] Correctly fall back to home folder if HOME is unset (#533) --- CHANGELOG.md | 2 ++ rye/src/platform.rs | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62342fad90..419bea1a40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ _Unreleased_ - Fixed default generated script reference. #527 +- Correctly fall back to home folder if HOME is unset. #533 + ## 0.16.0 diff --git a/rye/src/platform.rs b/rye/src/platform.rs index e0353720ef..88c79bd68e 100644 --- a/rye/src/platform.rs +++ b/rye/src/platform.rs @@ -15,9 +15,22 @@ pub fn init() -> Result<(), Error> { let home = if let Some(rye_home) = env::var_os("RYE_HOME") { PathBuf::from(rye_home) } else { - simple_home_dir::home_dir() - .map(|x| x.join(".rye")) - .ok_or_else(|| anyhow!("could not determine home folder"))? + { + // ironically the deprecated home dir implementation is + // still the only one that falls back to getpwuid. + // Fixes https://github.com/mitsuhiko/rye/issues/532 + #[cfg(unix)] + { + #[allow(deprecated)] + std::env::home_dir() + } + #[cfg(not(unix))] + { + simple_home_dir::home_dir() + } + } + .map(|x| x.join(".rye")) + .ok_or_else(|| anyhow!("could not determine home folder"))? }; *APP_DIR.lock().unwrap() = Some(Box::leak(Box::new(home))); Ok(()) From 500d8c4e6695ee924639fa249f417f59389eb203 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 15 Jan 2024 22:45:10 +0100 Subject: [PATCH 040/166] 0.17.0 --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 419bea1a40..e52ad89350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,16 +3,16 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. + + ## 0.17.0 -_Unreleased_ +Released on 2024-01-15 - Fixed default generated script reference. #527 - Correctly fall back to home folder if HOME is unset. #533 - - ## 0.16.0 Released on 2023-12-17 From 55940c2d56216da5eb49419206b89702a7bfb5f3 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 15 Jan 2024 22:45:55 +0100 Subject: [PATCH 041/166] 0.18.0 ready for dev --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e52ad89350..f86cdb0211 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.18.0 + +_Unreleased_ + ## 0.17.0 diff --git a/Cargo.lock b/Cargo.lock index b15cc181f4..cdc55855f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1772,7 +1772,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.17.0" +version = "0.18.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 7777aced05..208deecc2a 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.17.0" +version = "0.18.0" edition = "2021" license = "MIT" From b96314c90c6d5e08c5b2b2b87c82eaf5fbe14eb0 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Geslin Date: Tue, 16 Jan 2024 09:44:19 +0100 Subject: [PATCH 042/166] Use `home` cargo crate instead of `simple-home-dir` (#534) Signed-off-by: Jean-Pierre Geslin --- Cargo.lock | 86 +++++++++++++++++++++++++++++++++++++++------ rye/Cargo.toml | 2 +- rye/src/platform.rs | 19 ++-------- 3 files changed, 80 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cdc55855f5..41a6e31df1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -905,6 +905,15 @@ dependencies = [ "digest 0.10.6", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "i18n-config" version = "0.4.3" @@ -1788,6 +1797,7 @@ dependencies = [ "git-testament", "globset", "hex", + "home", "indicatif", "junction", "license", @@ -1807,7 +1817,6 @@ dependencies = [ "serde_json", "sha2", "shlex", - "simple-home-dir", "slug", "sysinfo", "tar", @@ -1962,15 +1971,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" -[[package]] -name = "simple-home-dir" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8cad354eef35a6c6020953afda6d4391d9fd41d6234d7bcd2f1d7c9f6f8105d" -dependencies = [ - "windows-sys 0.48.0", -] - [[package]] name = "slug" version = "0.1.4" @@ -2465,6 +2465,15 @@ dependencies = [ "windows-targets 0.48.0", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -2495,6 +2504,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.0", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -2507,6 +2531,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -2519,6 +2549,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -2531,6 +2567,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -2543,6 +2585,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -2555,6 +2603,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -2567,6 +2621,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -2579,6 +2639,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" version = "0.4.6" diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 208deecc2a..78599e37b2 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -39,7 +39,6 @@ same-file = "1.0.6" serde = { version = "1.0.160", features = ["derive"] } serde_json = "1.0.94" shlex = "1.1.0" -simple-home-dir = "0.1.2" slug = "0.1.4" tar = "0.4.38" tempfile = "3.5.0" @@ -59,6 +58,7 @@ configparser = "3.0.2" monotrail-utils = { git = "https://github.com/konstin/poc-monotrail", version = "0.0.1" } python-pkginfo = { version = "0.5.6", features = ["serde"] } sysinfo = { version = "0.29.4", default-features = false, features = [] } +home = "0.5.9" [target."cfg(unix)".dependencies] whattheshell = "1.0.1" diff --git a/rye/src/platform.rs b/rye/src/platform.rs index 88c79bd68e..21b8c436ce 100644 --- a/rye/src/platform.rs +++ b/rye/src/platform.rs @@ -15,22 +15,9 @@ pub fn init() -> Result<(), Error> { let home = if let Some(rye_home) = env::var_os("RYE_HOME") { PathBuf::from(rye_home) } else { - { - // ironically the deprecated home dir implementation is - // still the only one that falls back to getpwuid. - // Fixes https://github.com/mitsuhiko/rye/issues/532 - #[cfg(unix)] - { - #[allow(deprecated)] - std::env::home_dir() - } - #[cfg(not(unix))] - { - simple_home_dir::home_dir() - } - } - .map(|x| x.join(".rye")) - .ok_or_else(|| anyhow!("could not determine home folder"))? + home::home_dir() + .map(|x| x.join(".rye")) + .ok_or_else(|| anyhow!("could not determine home folder"))? }; *APP_DIR.lock().unwrap() = Some(Box::leak(Box::new(home))); Ok(()) From e715678f267d22e72cb171cba1bca170d58ab6db Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 16 Jan 2024 10:02:00 +0100 Subject: [PATCH 043/166] Incorporate new Python builds (#535) --- CHANGELOG.md | 2 ++ rye/src/downloads.inc | 48 +++++++++++++++++++++++++++---------------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f86cdb0211..e22d81c95f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ that were not yet released. _Unreleased_ +- Incorporate new Python builds. #535 + ## 0.17.0 diff --git a/rye/src/downloads.inc b/rye/src/downloads.inc index 3ff30ae97c..0f88451aea 100644 --- a/rye/src/downloads.inc +++ b/rye/src/downloads.inc @@ -20,12 +20,24 @@ pub const PYTHON_VERSIONS: &[(PythonVersion, &str, Option<&str>)] = &[ (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 7, patch: 13, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.9-linux64.tar.bz2", None), (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 7, patch: 13, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.9-osx64.tar.bz2", None), (PythonVersion { name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 7, patch: 13, suffix: None }, "https://downloads.python.org/pypy/pypy3.7-v7.3.9-win64.zip", None), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 12, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.12.1%2B20240107-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("3621be2cd8b5686e10a022f04869911cad9197a3ef77b30879fe25e792d7c249")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 12, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.12.1%2B20240107-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("61e51e3490537b800fcefad718157cf775de41044e95aa538b63ab599f66f3a9")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 12, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.12.1%2B20240107-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("22866d35fdf58e90e75d6ba9aa78c288b452ea7041fa9bc5549eca9daa431883")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 12, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.12.1%2B20240107-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("f267489a041daf4e523c03d32639de04ee59ca925dff49a8c3ce2f28a9f70a3b")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 12, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.12.1%2B20240107-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("bf2b176b0426d7b4d4909c1b19bbb25b4893f9ebdc61e32df144df2b10dcc800")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 12, patch: 1, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.12.1%2B20240107-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("d9bc1b566250bf51818976bf98bf50e1f4c59b2503b50d29250cac5ab5ef6b38")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), 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-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("86e16b6defbbd7db0b7f98879b2b381e0e5b0ec07126cb9f5fc0cafe9869dc36")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), 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-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("25fc8cd41e975d18d13bcc8f8beffa096ff8a0b86c4a737e1c6617900092c966")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), 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-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("465e91b6e6d0d1c40c8a4bce3642c4adcb9b75cf03fbd5fd5a33a36358249289")), (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: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7%2B20240107-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("e066d3fb69162e401d2bb1f3c20798fde7c2fffcba0912d792e46d569b591ab3")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7%2B20240107-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("c1f3dd13825906a5eae23ed8de9b653edb620568b2e0226eef3784eb1cce7eed")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7%2B20240107-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("6613f1f9238d19969d8a2827deec84611cb772503207056cc9f0deb89bea48cd")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7%2B20240107-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("b7e19b262c19dfb82107e092ba3959b2da9b8bc53aafeb86727996afdb577221")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7%2B20240107-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("3f8caf73f2bfe22efa9666974c119727e163716e88af8ed3caa1e0ae5493de61")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 7, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7%2B20240107-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("89d1d8f080e5494ea57918fc5ecf3d483ffef943cd5a336e64da150cd44b4aa0")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 11, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.11.6%2B20231002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("7c621a748a4fd6ae99d8ba7ec2da59173d31475838382a13df6d2b1bf95a7059")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 11, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.11.6%2B20231002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("6e9007bcbbf51203e89c34a87ed42561630a35bc4eb04a565c92ba7159fe5826")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 11, patch: 6, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.11.6%2B20231002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("2670731428191d4476bf260c8144ccf06f9e5f8ac6f2de1dc444ca96ab627082")), @@ -60,13 +72,13 @@ 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: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.10.13%2B20231002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("94378303df7117f80c6832979d21295413148e46cbab5f737a403f8b21b30335")), - (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/20231002/cpython-3.10.13%2B20231002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a2635841454295c5bc2c18740346fd8308f2a8adcce2407b87c9faf261fed29c")), + (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/20240107/cpython-3.10.13%2B20240107-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("4e9fcb141a0c9af986f0819ab7a64c62ceb7b68f33df75753e669fc3d23a3412")), + (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/20240107/cpython-3.10.13%2B20240107-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d1a777a0688bafd2a62050c680508769d9b6c14779f64fee591f4e135c11e711")), (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")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.10.13%2B20231002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("1c015e64732d3a18951fcea30d364c80fb83322363fec1a2c85c70840fb75a92")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.10.13%2B20231002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("a28cc6d21373a41256cd176bd2f77a3190eb12f132602d344afc3dba6fa454c9")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.10.13%2B20231002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("e7db06af69f8a51b05f9f82032957d08c07cf75a06a3db6973aa0d4a05d2a95c")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.10.13%2B20231002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("f1960211258ba78abc1b7bf7cd7cfcf2c656f4de22cf197e485c64e722248169")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.10.13%2B20240107-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("0e2e96365d06411a78bc1e1b19cc5a148034743fe6ecf5a5c8e890985fcadbb4")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.10.13%2B20240107-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("60e7ca89d37dd8a630a5525bda6143a66a3949c4f03c8319295ddb1d1023b425")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.10.13%2B20240107-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("b61f6f9cf0c35fd6df90b424e757a3bc1b483e8f8d8fadfa6c1ddd1a0c39c003")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 10, patch: 13, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.10.13%2B20240107-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("8271db063eea7a32f327121b4d828bd10b9ecd1447d01fcfe8c7518e587ede63")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("bb5fa1d4ad202afc8ee4330f313c093760c9fb1af5be204dc0c6ba50c7610fea")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("a7d0cadbe867cc53dd47d7327244154157a7cca02edb88cf3bb760a4f91d4e44")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 10, patch: 12, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.10.12%2B20230726-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("159124ac71c86d8617eae17db6ed9b98f01078cc9bd76073261901826f2d940d")), @@ -144,13 +156,13 @@ 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: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.9.18%2B20231002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("4cd4240b08e82e0b279152cd2afad556a0c8cd9ee3d285fe3a5770b5a934fe26")), - (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/20231002/cpython-3.9.18%2B20231002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("bdf883f6a6ba9ea1bd72029670737232bfbd9a07708d85dd2bf6a3deb2aa3a5d")), + (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/20240107/cpython-3.9.18%2B20240107-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("e8938f26837a5654a4ceec1e5385d49f4c56af7fa86255fede416980bd28a34f")), + (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/20240107/cpython-3.9.18%2B20240107-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("b7d31a15f7af359c59b01ed9c8accb4b6bdd1237b910699e6b2d14df8e2c1cdc")), (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")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.9.18%2B20231002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("014361988b6f0eb91f87bdb6712e633cadfbf26d5cd12f2d188b865ca6f0e1b3")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.9.18%2B20231002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("02f5c6bf29f173fe1653965409b891691ab413e579766d3e5bccdc74634b9bde")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.9.18%2B20231002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("0ee342ed3d6051a41e7702bec98db463c5ffe4dcb634e10cae464e42adb2fb3e")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.9.18%2B20231002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("4303f69c1fbec2c933ff7ac6f2195fc66844223f66341c819fee69a12cb816f7")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.9.18%2B20240107-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("063c531d3c65f49212c9644ab0f00360a65d7c45bc1e6f78174685e2c165b260")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.9.18%2B20240107-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("2cc59d95934240859e2c67fce02018d00882deb860cabbc3162501f7adfdf16f")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.9.18%2B20240107-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("aa2e549186ab9f831169ccc32965c81ba0fa62e471129f51988f40eaa9552309")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 9, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.9.18%2B20240107-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("3b9c7d6ed94260b83ed8f44ee9a7b8fce392259ce6591e538601f7353061a884")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("de2eab48ca487550258db38b38cb9372143283f757b3cf9ec522eb657e41a035")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("2902e2a0add6d584999fa27896b721a359f7308404e936e80b01b07aa06e8f5e")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 9, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230726/cpython-3.9.17%2B20230726-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("9984f59284048608f6734b032ff76e6bc3cb208e2235fdb511b0e478158fdb2b")), @@ -252,12 +264,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: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.8.18%2B20231002-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("92ebfe81d78d4e28d8a02a29f540e4db785a5e9b51559d85013f57ffe3a6f985")), - (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/20231002/cpython-3.8.18%2B20231002-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("10abf67384ea0728fff82782408f8e398bc17ef55985d6ebef2aaae319a7df31")), - (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/20231002/cpython-3.8.18%2B20231002-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("6ca00494d1e169b736d09b43d1b700b48d8ecdb9fabfcff8e1c6748f6446ee3c")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.8.18%2B20231002-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("286910aea21d8c7a5b0ecda6214eec6c197122b7b738fdfd6ed59f7c0ba9f65f")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.8.18%2B20231002-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("b89799abf243739a4ef5b71e7373e45e56e097aec0853b813aa31d1dcb68799e")), - (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.8.18%2B20231002-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("1ccf8abb4f8ba2d8fe8c172d66901ea339d7b6b825fc6094603764954a68071b")), + (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/20240107/cpython-3.8.18%2B20240107-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("a3d6f2dcaf43b7549e6c0965debdc8ccb958e662b4a3d95b506816dc99624e68")), + (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/20240107/cpython-3.8.18%2B20240107-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("f426349265897fb3715f19f474f45e17406d77701eb1b60953f9b32e51c779b9")), + (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/20240107/cpython-3.8.18%2B20240107-i686-pc-windows-msvc-shared-pgo-full.tar.zst", Some("875983fccf91310805164528150adfde1ac63564d0c3967d48086c6fdb9f568b")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.8.18%2B20240107-x86_64-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("954b52b1d93a1f4f016b5e5f1f9683617f7de112ff0cf53ca3002dcd45eff4ef")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.8.18%2B20240107-x86_64-apple-darwin-pgo%2Blto-full.tar.zst", Some("bfcd4a61998e105a78dbac2b68f1f264cd7bedc5ef11f89ec10911f23b445616")), + (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86_64"), os: Cow::Borrowed("windows"), major: 3, minor: 8, patch: 18, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.8.18%2B20240107-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst", Some("0675bf51ad66c149c311e8da4a358b0e0fc28801770163d8053d9aadf6bdb556")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-aarch64-unknown-linux-gnu-lto-full.tar.zst", Some("efdf69695af469da13f86d5be23556fee6c03f417f8810fca55307a63aabf08d")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("aarch64"), os: Cow::Borrowed("macos"), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-aarch64-apple-darwin-pgo%2Blto-full.tar.zst", Some("d08a542bed35fc74ac6e8f6884c8aa29a77ff2f4ed04a06dcf91578dea622f9a")), (PythonVersion { name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("x86"), os: Cow::Borrowed("linux"), major: 3, minor: 8, patch: 17, suffix: None }, "https://github.com/indygreg/python-build-standalone/releases/download/20230826/cpython-3.8.17%2B20230826-i686-unknown-linux-gnu-pgo%2Blto-full.tar.zst", Some("aaf4b15bdc35674dbe25d4538c9e75e243796a0cc8841fd31d7bbbee6703342a")), From 910a4f6245377581fe30be025d05cfaa8cbc644e Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 17 Jan 2024 15:37:54 +0100 Subject: [PATCH 044/166] Disable revocation checks in downloader on windows (#537) --- CHANGELOG.md | 2 ++ rye/src/bootstrap.rs | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e22d81c95f..3d1e46927a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ _Unreleased_ - Incorporate new Python builds. #535 +- Disable revocation checks on windows to support corporate MITM proxies. #537 + ## 0.17.0 diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index 3c9ae4c56f..ddf65f164c 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -410,6 +410,14 @@ pub fn download_url_ignore_404(url: &str, output: CommandOutput) -> Result Date: Thu, 18 Jan 2024 13:22:13 +0100 Subject: [PATCH 045/166] Detect relocated virtualenv (#538) --- CHANGELOG.md | 2 ++ rye/src/pyproject.rs | 9 ++++++--- rye/src/sync.rs | 25 +++++++++++++++++++++---- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d1e46927a..112a4d0b7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ _Unreleased_ - Disable revocation checks on windows to support corporate MITM proxies. #537 +- Detect when a virtualenv relocates and automatically re-create it on sync. #538 + ## 0.17.0 diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index c8de09aa95..9f51ccf71e 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -1015,11 +1015,14 @@ fn remove_dependency(deps: &mut Array, req: &Requirement) -> Option } } -pub fn get_current_venv_python_version(venv_path: &Path) -> Option { +pub fn read_venv_marker(venv_path: &Path) -> Option { let marker_file = venv_path.join("rye-venv.json"); let contents = fs::read(marker_file).ok()?; - let marker: VenvMarker = serde_json::from_slice(&contents).ok()?; - Some(marker.python) + serde_json::from_slice(&contents).ok() +} + +pub fn get_current_venv_python_version(venv_path: &Path) -> Option { + read_venv_marker(venv_path).map(|x| x.python) } /// Give a given python version request, returns the latest available version. diff --git a/rye/src/sync.rs b/rye/src/sync.rs index dbf97f9495..1f35e4822f 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -4,6 +4,7 @@ use std::{env, fs}; use anyhow::{bail, Context, Error}; use console::style; +use same_file::is_same_file; use serde::{Deserialize, Serialize}; use tempfile::tempdir; @@ -15,7 +16,7 @@ use crate::lock::{ }; use crate::piptools::get_pip_sync; use crate::platform::get_toolchain_python_bin; -use crate::pyproject::{get_current_venv_python_version, ExpandedSources, PyProject}; +use crate::pyproject::{read_venv_marker, ExpandedSources, PyProject}; use crate::sources::PythonVersion; use crate::utils::{get_venv_python_bin, set_proxy_variables, symlink_dir, CommandOutput}; @@ -71,6 +72,7 @@ impl SyncOptions { #[derive(Serialize, Deserialize, Debug)] pub struct VenvMarker { pub python: PythonVersion, + pub venv_path: Option, } /// Synchronizes a project's virtualenv. @@ -95,16 +97,30 @@ pub fn sync(cmd: SyncOptions) -> Result<(), Error> { let mut recreate = cmd.mode == SyncMode::Full; if venv.is_dir() { - if let Some(marker_python) = get_current_venv_python_version(&venv) { - if marker_python != py_ver { + if let Some(marker) = read_venv_marker(&venv) { + if marker.python != py_ver { if cmd.output != CommandOutput::Quiet { echo!( "Python version mismatch (found {}, expect {}), recreating.", - marker_python, + marker.python, py_ver ); } recreate = true; + } else if let Some(ref venv_path) = marker.venv_path { + // for virtualenvs that have a location identifier, check if we need to + // recreate it. On IO error we know that one of the paths is gone, so + // something needs recreation. + if !is_same_file(&venv, venv_path).unwrap_or(false) { + if cmd.output != CommandOutput::Quiet { + echo!( + "Detected relocated virtualenv ({} => {}), recreating.", + venv_path.display(), + venv.display(), + ); + } + recreate = true; + } } } else if cmd.force { if cmd.output != CommandOutput::Quiet { @@ -150,6 +166,7 @@ pub fn sync(cmd: SyncOptions) -> Result<(), Error> { venv.join("rye-venv.json"), serde_json::to_string_pretty(&VenvMarker { python: py_ver.clone(), + venv_path: Some(venv.clone().into()), })?, ) .context("failed writing venv marker file")?; From cf274b2fa57a7175e0e88febec527d0e652f2450 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 20 Jan 2024 15:11:15 +0100 Subject: [PATCH 046/166] Adds support for locking with source references (#540) --- CHANGELOG.md | 4 ++++ docs/guide/pyproject.md | 14 ++++++++++++ docs/guide/sources.md | 2 +- docs/guide/sync.md | 17 +++++++++++++++ rye/src/cli/lock.rs | 4 ++++ rye/src/cli/sync.rs | 4 ++++ rye/src/lock.rs | 16 +++++++++++--- rye/src/pyproject.rs | 47 +++++++++++++++++++++++++++++++++++++---- rye/src/sync.rs | 16 ++++++-------- 9 files changed, 106 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 112a4d0b7f..429320ea0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ _Unreleased_ - Detect when a virtualenv relocates and automatically re-create it on sync. #538 +- Added `lock --with-sources`, `sync --with-sources` and the new `rye.tool.lock-with-sources` + config. Passing this will ensure that source references are included in the + lock files. #540 + ## 0.17.0 diff --git a/docs/guide/pyproject.md b/docs/guide/pyproject.md index 7740bc40f2..581eb9547c 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.lock-with-sources` + ++++ 0.18.0 + +When this flag is enabled all `lock` and `sync` operations in the project or workspace +operate as if `--with-sources` is passed. This means that all lock files contain the +full source references. Note that this can create lock files that contain credentials +if the sources have credentials included in the URL. + +```toml +[tool.rye] +lock-with-sources = true +``` + ## `tool.rye.managed` +++ 0.3.0 diff --git a/docs/guide/sources.md b/docs/guide/sources.md index 907876ec88..bab56b10f2 100644 --- a/docs/guide/sources.md +++ b/docs/guide/sources.md @@ -114,4 +114,4 @@ can be supplied with environment variables. [[sources]] name = "company-internal" url = "https://${INDEX_USERNAME}:${INDEX_PASSWORD}@company.internal/simple/" - ``` \ No newline at end of file + ``` diff --git a/docs/guide/sync.md b/docs/guide/sync.md index 3cabdbc9aa..74d5fb7db5 100644 --- a/docs/guide/sync.md +++ b/docs/guide/sync.md @@ -55,6 +55,23 @@ do want to include those, pass `--pre` rye lock Flask --pre ``` +### `--with-sources` + ++++ 0.18.0 + +By default (unless the `tool.rye.lock-with-sources` config key is set to `true` in the +`pyproject.toml`) lock files are not generated with source references. This means that +if custom sources are used the lock file cannot be installed via `pip` unless also +`--find-links` and other parameters are manually passed. This can be particularly useful +when the lock file is used for docker image builds. + +When this flag is passed then the lock file is generated with references to `--index-url`, +`--extra-index-url` or `--find-links`. + +``` +rye lock --with-sources +``` + ## Sync Syncing takes the same parameters as `lock` and then some. Sync will usually first do what diff --git a/rye/src/cli/lock.rs b/rye/src/cli/lock.rs index 307b55492b..aa63432de2 100644 --- a/rye/src/cli/lock.rs +++ b/rye/src/cli/lock.rs @@ -31,6 +31,9 @@ pub struct Args { /// Enables all features. #[arg(long)] all_features: bool, + /// Set to true to lock with sources in the lockfile. + #[arg(long)] + with_sources: bool, /// Use this pyproject.toml file #[arg(long, value_name = "PYPROJECT_TOML")] pyproject: Option, @@ -47,6 +50,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { pre: cmd.pre, features: cmd.features, all_features: cmd.all_features, + with_sources: cmd.with_sources, }, pyproject: cmd.pyproject, ..SyncOptions::default() diff --git a/rye/src/cli/sync.rs b/rye/src/cli/sync.rs index e9a799600d..17f5a06970 100644 --- a/rye/src/cli/sync.rs +++ b/rye/src/cli/sync.rs @@ -40,6 +40,9 @@ pub struct Args { /// Enables all features. #[arg(long)] all_features: bool, + /// Set to true to lock with sources in the lockfile. + #[arg(long)] + with_sources: bool, /// Use this pyproject.toml file #[arg(long, value_name = "PYPROJECT_TOML")] pyproject: Option, @@ -63,6 +66,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { pre: cmd.pre, features: cmd.features, all_features: cmd.all_features, + with_sources: cmd.with_sources, }, pyproject: cmd.pyproject, })?; diff --git a/rye/src/lock.rs b/rye/src/lock.rs index 3b8700421e..6b6ec32643 100644 --- a/rye/src/lock.rs +++ b/rye/src/lock.rs @@ -30,6 +30,7 @@ static REQUIREMENTS_HEADER: &str = r#"# generated by rye # pre: {{ lock_options.pre }} # features: {{ lock_options.features }} # all-features: {{ lock_options.all_features }} +# with-sources: {{ lock_options.with_sources }} "#; @@ -65,6 +66,8 @@ pub struct LockOptions { pub features: Vec, /// Enable all features in the workspace. pub all_features: bool, + /// Should locking happen with sources? + pub with_sources: bool, } /// Creates lockfiles for all projects in the workspace. @@ -360,6 +363,7 @@ fn generate_lockfile( lockfile, workspace_path, exclusions, + sources, lock_options, )?; @@ -371,14 +375,20 @@ fn finalize_lockfile( out: &Path, workspace_root: &Path, exclusions: &HashSet, + sources: &ExpandedSources, lock_options: &LockOptions, ) -> Result<(), Error> { let mut rv = BufWriter::new(fs::File::create(out)?); writeln!(rv, "{}", render!(REQUIREMENTS_HEADER, lock_options))?; + + // only if we are asked to include sources we do that. + if lock_options.with_sources { + sources.add_to_lockfile(&mut rv)?; + writeln!(rv)?; + } + for line in fs::read_to_string(generated)?.lines() { - // we do not want to persist these pieces of information as we always - // provide it explicitly on the command line. This is particularly - // important as we might include auth info here. + // we deal with this explicitly. if line.trim().is_empty() || line.starts_with("--index-url ") || line.starts_with("--extra-index-url ") diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index 9f51ccf71e..cfe1d0086b 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -494,6 +494,11 @@ impl Workspace { pub fn rye_managed(&self) -> bool { is_rye_managed(&self.doc) } + + /// Should requirements.txt based locking include a find-links reference? + pub fn lock_with_sources(&self) -> bool { + lock_with_sources(&self.doc) + } } /// Check if recurse should be skipped into directory with this name @@ -947,6 +952,14 @@ impl PyProject { } } + /// 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(), + None => lock_with_sources(&self.doc), + } + } + /// Save back changes pub fn save(&self) -> Result<(), Error> { fs::write(self.toml_path(), self.doc.to_string()).with_context(|| { @@ -1194,6 +1207,14 @@ fn is_rye_managed(doc: &Document) -> bool { .unwrap_or(false) } +fn lock_with_sources(doc: &Document) -> bool { + doc.get("tool") + .and_then(|x| x.get("rye")) + .and_then(|x| x.get("lock-with-sources")) + .and_then(|x| x.as_bool()) + .unwrap_or(false) +} + fn get_project_metadata(path: &Path) -> Result { let self_venv = ensure_self_venv(CommandOutput::Normal)?; let mut metadata = Command::new(self_venv.join(VENV_BIN).join("python")); @@ -1208,7 +1229,7 @@ fn get_project_metadata(path: &Path) -> Result { /// Represents expanded sources. #[derive(Debug, Clone, Serialize)] pub struct ExpandedSources { - pub index_urls: Vec, + pub index_urls: Vec<(Url, bool)>, pub find_links: Vec, pub trusted_hosts: HashSet, } @@ -1228,7 +1249,7 @@ impl ExpandedSources { } } match source.ty { - SourceRefType::Index => index_urls.push(url), + SourceRefType::Index => index_urls.push((url, source.name == "default")), SourceRefType::FindLinks => find_links.push(url), } } @@ -1242,8 +1263,8 @@ impl ExpandedSources { /// Attach common pip args to a command. pub fn add_as_pip_args(&self, cmd: &mut Command) { - for (idx, url) in self.index_urls.iter().enumerate() { - if idx == 0 { + for (url, default) in self.index_urls.iter() { + if *default { cmd.arg("--index-url"); } else { cmd.arg("--extra-index-url"); @@ -1259,6 +1280,24 @@ impl ExpandedSources { cmd.arg(host); } } + + /// Write the sources to a lockfile. + pub fn add_to_lockfile(&self, out: &mut dyn std::io::Write) -> std::io::Result<()> { + for (url, default) in self.index_urls.iter() { + if *default { + writeln!(out, "--index-url {}", url)?; + } else { + writeln!(out, "--extra-index-url {}", url)?; + } + } + for link in &self.find_links { + writeln!(out, "--find-links {}", link)?; + } + for host in &self.trusted_hosts { + writeln!(out, "--trusted-host {}", host)?; + } + Ok(()) + } } #[derive(ValueEnum, Copy, Clone, Serialize, Debug, PartialEq)] diff --git a/rye/src/sync.rs b/rye/src/sync.rs index 1f35e4822f..d06671feb5 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -76,7 +76,7 @@ pub struct VenvMarker { } /// Synchronizes a project's virtualenv. -pub fn sync(cmd: SyncOptions) -> Result<(), Error> { +pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { let pyproject = PyProject::load_or_discover(cmd.pyproject.as_deref())?; let lockfile = pyproject.workspace_path().join("requirements.lock"); let dev_lockfile = pyproject.workspace_path().join("requirements-dev.lock"); @@ -92,6 +92,11 @@ pub fn sync(cmd: SyncOptions) -> Result<(), Error> { bail!("cannot sync or generate lockfile: package needs 'pyproject.toml'"); } + // Turn on locking with sources if the project demands it. + if pyproject.lock_with_sources() { + cmd.lock_options.with_sources = true; + } + // ensure we are bootstrapped let self_venv = ensure_self_venv(output).context("could not sync because bootstrap failed")?; @@ -261,15 +266,6 @@ pub fn sync(cmd: SyncOptions) -> Result<(), Error> { sources.add_as_pip_args(&mut pip_sync_cmd); - for (idx, url) in sources.index_urls.iter().enumerate() { - if idx == 0 { - pip_sync_cmd.arg("--index-url"); - } else { - pip_sync_cmd.arg("--extra-index-url"); - } - pip_sync_cmd.arg(&url.to_string()); - } - if cmd.dev && dev_lockfile.is_file() { pip_sync_cmd.arg(&dev_lockfile); } else { From 0060a175f3b6d0f3ba3f2d2218cdfdeca1a71d2e Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 20 Jan 2024 15:37:34 +0100 Subject: [PATCH 047/166] Fix an issue where global python shims did not honor .python-version (#541) --- CHANGELOG.md | 3 +++ rye/src/cli/shim.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 429320ea0f..1a7d209dbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ _Unreleased_ config. Passing this will ensure that source references are included in the lock files. #540 +- When using global python shims, the `.python-version` file is now correctly + picked up in all cases. #541 + ## 0.17.0 diff --git a/rye/src/cli/shim.rs b/rye/src/cli/shim.rs index c2276b3c19..112fedba94 100644 --- a/rye/src/cli/shim.rs +++ b/rye/src/cli/shim.rs @@ -236,7 +236,7 @@ fn get_shim_target( PythonVersionRequest::from_str(rest) .context("invalid python version requested from command line")? } else if config.global_python() { - match get_python_version_request_from_pyenv_pin(&std::env::current_exe()?) { + match get_python_version_request_from_pyenv_pin(&std::env::current_dir()?) { Some(version_request) => version_request, None => config.default_toolchain()?, } From eb18e67215c13b57c5dd897b3ca85cd772c67c0e Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 20 Jan 2024 20:00:48 +0100 Subject: [PATCH 048/166] Improve documentation on running scripts slightly --- docs/guide/basics.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/guide/basics.md b/docs/guide/basics.md index 542e3bfbf6..e4ff72c65e 100644 --- a/docs/guide/basics.md +++ b/docs/guide/basics.md @@ -97,7 +97,8 @@ rye sync rye run black ``` -To activate the virtualenv, use the standard methods: +If you want to have the commands available directly you will need to activate the +virtualenv like you do normally. To activate the virtualenv, use the standard methods: === "Unix" From 17bb62f86806d1e341f9ecabbbb57ff849a4e231 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 20 Jan 2024 20:02:28 +0100 Subject: [PATCH 049/166] Fix an issue where some packages would attempt to install weird binaries (#542) --- CHANGELOG.md | 4 ++++ rye/src/installer.rs | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a7d209dbd..34762dd43c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ _Unreleased_ - When using global python shims, the `.python-version` file is now correctly picked up in all cases. #541 +- The installer will no longer attempt to symlink targets which are not valid + executables on the platform. This works around some issues with Packages that + would prevent to install such as `changedetection.io`. #542 + ## 0.17.0 diff --git a/rye/src/installer.rs b/rye/src/installer.rs index b889cfe5f1..f7cf233f3f 100644 --- a/rye/src/installer.rs +++ b/rye/src/installer.rs @@ -18,7 +18,9 @@ use crate::platform::get_app_dir; use crate::pyproject::{normalize_package_name, ExpandedSources}; use crate::sources::PythonVersionRequest; use crate::sync::create_virtualenv; -use crate::utils::{get_short_executable_name, get_venv_python_bin, symlink_file, CommandOutput}; +use crate::utils::{ + get_short_executable_name, get_venv_python_bin, is_executable, symlink_file, CommandOutput, +}; const FIND_SCRIPT_SCRIPT: &str = r#" import os @@ -253,6 +255,18 @@ fn install_scripts( let mut rv = Vec::new(); for file in files { if let Ok(rest) = file.strip_prefix(target_venv_bin_path) { + // In some cases we are given paths here which point to sub-folders of the + // script/bin folder. For instance in some cases it has been shown that + // __pycache__/something.pyc shows up there. These are obviously not good + // targets to link as they would never show up via PATH discovery. Skip + // over these. + // + // Also do not try to link things which are not considered executables on + // this operating system. + if !rest.parent().map_or(true, |x| x == Path::new("")) || !is_executable(file) { + continue; + } + let shim_target = shim_dir.join(rest); // on windows we want to fall back to hardlinks. That might be problematic in From 20e605e9d965054bd3f6639c8373dced9c5c3871 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 20 Jan 2024 20:12:26 +0100 Subject: [PATCH 050/166] Add a helpful error message if someone invokes rye list (#543) --- CHANGELOG.md | 5 +++++ docs/guide/basics.md | 14 +++++++++++++- rye/src/cli/mod.rs | 17 ++++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34762dd43c..884a0d69c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,11 @@ _Unreleased_ - When using global python shims, the `.python-version` file is now correctly picked up in all cases. #541 +- Added a helpful message if someone attempts to run the non existing `rye list` + command. At a later point there should be a real listing command that can print + out the dependencies. Today the only option is the `--installed-deps` option on + the `show` command which spits out dependencies in the format of the lockfile. #543 + - The installer will no longer attempt to symlink targets which are not valid executables on the platform. This works around some issues with Packages that would prevent to install such as `changedetection.io`. #542 diff --git a/docs/guide/basics.md b/docs/guide/basics.md index e4ff72c65e..b48b7d8472 100644 --- a/docs/guide/basics.md +++ b/docs/guide/basics.md @@ -116,4 +116,16 @@ To deactivate it again run `deactivate`: ``` deactivate -``` \ No newline at end of file +``` + +## Inspecting the Project + +The `rye show` command can print out information about the project's state. By +just running `rye show` you can see which Python version is used, where the +virtualenv is located and more. You can also invoke `rye show --installed-deps` +to get a dump of all installed dependencies. + +``` +rye show +rye show --installed-deps +``` diff --git a/rye/src/cli/mod.rs b/rye/src/cli/mod.rs index c096e5fe1e..8988ef4efc 100644 --- a/rye/src/cli/mod.rs +++ b/rye/src/cli/mod.rs @@ -1,6 +1,6 @@ use std::env; -use anyhow::Error; +use anyhow::{bail, Error}; use clap::Parser; mod add; @@ -66,6 +66,16 @@ enum Command { Rye(rye::Args), Uninstall(uninstall::Args), Version(version::Args), + #[command(hide = true)] + List(list::Args), +} + +pub mod list { + /// There is no real list command yet. + /// + /// Use rye show --installed-deps instead + #[derive(clap::Parser, Debug)] + pub struct Args {} } pub fn execute() -> Result<(), Error> { @@ -113,6 +123,11 @@ pub fn execute() -> Result<(), Error> { Command::Rye(cmd) => rye::execute(cmd), Command::Uninstall(cmd) => uninstall::execute(cmd), Command::Version(cmd) => version::execute(cmd), + Command::List(..) => { + // until we have a proper list command, make it error with what the + // user should be using instead. + bail!("unknown command. Maybe you mean rye show --installed-deps"); + } } } From e6717de3aaa3f4258d57a672c0b56f8881c3760d Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 20 Jan 2024 20:26:11 +0100 Subject: [PATCH 051/166] Document custom toolchain installation for alpine/musl --- docs/guide/faq.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/guide/faq.md b/docs/guide/faq.md index 1f8e063a44..ba119a7f25 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -93,6 +93,16 @@ folder that contains a non Rye managed project. As such the answer is a clear **yes!** +## Musl/Alpine Support + +When bootstrapping it can happen that you are running into a confusing error like +"No such file or directory (os error 2)". This can happen on MUSL based Linux +systems like Alpine. The reason for this is that Rye downloads distribution +independent Python interpreters which are not compatible with Linux systems that +do not use glibc. The solution today is to install Python via other means and +to install Rye with a custom `RYE_TOOLCHAIN`. For more information see +[Customized Installation](/guide/installation/#customized-installation) + ## Wheels Appear to be Missing Files You might be encountering missing files in wheels when running `rye build` and you From e6512f6e1f9bdda961ed0e3c49342baece2b1a9a Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 20 Jan 2024 20:30:38 +0100 Subject: [PATCH 052/166] Improve the error message for invalid Pythons. Refs #30 --- docs/guide/installation.md | 3 ++- rye/src/bootstrap.rs | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 5cfa98ffe3..fbc624e14a 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -19,7 +19,8 @@ a specific version download a binary directly ## Customized Installation On some platforms there is some limited support for customizing the installation -experience. +experience. This for instance can be necessary on certain Linux environments such +as Alpine where the Rye provided Python interpreter is not supported. === "Linux" diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index ddf65f164c..c28b5f03c2 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -122,9 +122,14 @@ pub fn ensure_self_venv(output: CommandOutput) -> Result { venv_cmd.arg(&venv_dir); set_proxy_variables(&mut venv_cmd); - let status = venv_cmd - .status() - .with_context(|| format!("unable to create self venv using {}", py_bin.display()))?; + let status = venv_cmd.status().with_context(|| { + 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/", + py_bin.display() + ) + })?; if !status.success() { bail!("failed to initialize virtualenv in {}", venv_dir.display()); } From 285d99a4b610cf05e199e068cc62bf17e7bff164 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 20 Jan 2024 20:34:11 +0100 Subject: [PATCH 053/166] 0.18.0 --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 884a0d69c9..7070b6d9ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. + + ## 0.18.0 -_Unreleased_ +Released on 2024-01-20 - Incorporate new Python builds. #535 @@ -29,8 +31,6 @@ _Unreleased_ executables on the platform. This works around some issues with Packages that would prevent to install such as `changedetection.io`. #542 - - ## 0.17.0 Released on 2024-01-15 From 7a9ce9af29d96bbbf53b1571a339417ac01044fc Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 20 Jan 2024 20:34:34 +0100 Subject: [PATCH 054/166] 0.19.0 ready for dev --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7070b6d9ec..3e255eca27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.19.0 + +_Unreleased_ + ## 0.18.0 diff --git a/Cargo.lock b/Cargo.lock index 41a6e31df1..ffa0c44961 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1781,7 +1781,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.18.0" +version = "0.19.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 78599e37b2..a796717dec 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.18.0" +version = "0.19.0" edition = "2021" license = "MIT" From 95ba033e007f431126aef5aa41a862b72184d6da Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 Jan 2024 00:30:29 +0100 Subject: [PATCH 055/166] Add simplified rye fetch (#545) --- CHANGELOG.md | 7 +++++++ docs/guide/toolchains/index.md | 8 ++++++++ rye/src/cli/fetch.rs | 25 ++++++++++++++++++++++--- rye/src/cli/init.rs | 8 ++++++-- rye/src/cli/shim.rs | 30 +++++++++++++++++++++--------- 5 files changed, 64 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e255eca27..b7e9e7b4ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ that were not yet released. _Unreleased_ +- Improved the behavior of `rye fetch`. When invoked without arguments it will now try to + fetch the version of the requested Python interpreter. Specifically this combining + `pin` and `fetch` work in a much simplified manner. #545 + +- Fixed an issue where `rye init` would pin a much too specific version in the `.python-version` + file that is generated. #545 + ## 0.18.0 diff --git a/docs/guide/toolchains/index.md b/docs/guide/toolchains/index.md index 96a1cbb0b9..9281cd0cf9 100644 --- a/docs/guide/toolchains/index.md +++ b/docs/guide/toolchains/index.md @@ -82,6 +82,14 @@ with `rye toolchain fetch` (also aliased to `rye fetch`): rye toolchain fetch cpython@3.8.5 ``` +Starting with Rye 0.19.0 the argument to `fetch` is inferred from the current pin. This means +you can also fetch as follows: + +``` +rye pin 3.10 +rye fetch +``` + Toolchains are fetched from two sources: * [Indygreg's Portable Python Builds](https://github.com/indygreg/python-build-standalone) for CPython diff --git a/rye/src/cli/fetch.rs b/rye/src/cli/fetch.rs index 3a406d6ef9..7c468106bb 100644 --- a/rye/src/cli/fetch.rs +++ b/rye/src/cli/fetch.rs @@ -1,14 +1,19 @@ -use anyhow::{Context, Error}; +use anyhow::{anyhow, Context, Error}; use clap::Parser; use crate::bootstrap::fetch; +use crate::platform::get_python_version_request_from_pyenv_pin; +use crate::pyproject::PyProject; +use crate::sources::PythonVersionRequest; use crate::utils::CommandOutput; /// Fetches a Python interpreter for the local machine. #[derive(Parser, Debug)] pub struct Args { /// The version of Python to fetch. - version: String, + /// + /// If no version is provided, the requested version will be fetched. + version: Option, /// Overrides the architecture to fetch. /// /// When a non native architecture is fetched, the toolchain is @@ -24,6 +29,20 @@ pub struct Args { pub fn execute(cmd: Args) -> Result<(), Error> { let output = CommandOutput::from_quiet_and_verbose(cmd.quiet, cmd.verbose); - fetch(&cmd.version.parse()?, output).context("error while fetching python installation")?; + + let version: PythonVersionRequest = match cmd.version { + Some(version) => version.parse()?, + None => { + if let Ok(pyproject) = PyProject::discover() { + pyproject.venv_python_version()?.into() + } else { + get_python_version_request_from_pyenv_pin(&std::env::current_dir()?).ok_or_else( + || anyhow!("not sure what to fetch, please provide an explicit version"), + )? + } + } + }; + + fetch(&version, output).context("error while fetching python installation")?; Ok(()) } diff --git a/rye/src/cli/init.rs b/rye/src/cli/init.rs index d162d18e77..9a4cee92ab 100644 --- a/rye/src/cli/init.rs +++ b/rye/src/cli/init.rs @@ -19,7 +19,7 @@ use tempfile::tempdir; use crate::bootstrap::ensure_self_venv; use crate::config::Config; use crate::platform::{ - get_default_author_with_fallback, get_latest_cpython_version, + get_default_author_with_fallback, get_latest_cpython_version, get_pinnable_version, get_python_version_request_from_pyenv_pin, }; use crate::pyproject::BuildSystem; @@ -370,7 +370,11 @@ pub fn execute(cmd: Args) -> Result<(), Error> { // write .python-version if !cmd.no_pin && !python_version_file.is_file() { - fs::write(python_version_file, format!("{}\n", py)) + // get_pinnable_version ideally doesn't fail, but if it does we fall back to + // the full version request. This has the disadvantage that we might end up + // pinning to an architecture specific version. + let to_write = get_pinnable_version(&py, false).unwrap_or_else(|| py.to_string()); + fs::write(python_version_file, format!("{}\n", to_write)) .context("could not write .python-version file")?; } diff --git a/rye/src/cli/shim.rs b/rye/src/cli/shim.rs index 112fedba94..cc35942cdb 100644 --- a/rye/src/cli/shim.rs +++ b/rye/src/cli/shim.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::convert::Infallible; use std::env; use std::ffi::{OsStr, OsString}; @@ -227,19 +228,25 @@ fn get_shim_target( let config = Config::current(); let mut remove1 = false; - let version_request = if let Some(rest) = args + let (version_request, implicit_request) = if let Some(rest) = args .get(1) .and_then(|x| x.as_os_str().to_str()) .and_then(|x| x.strip_prefix('+')) { remove1 = true; - PythonVersionRequest::from_str(rest) - .context("invalid python version requested from command line")? + ( + PythonVersionRequest::from_str(rest) + .context("invalid python version requested from command line")?, + false, + ) } else if config.global_python() { - match get_python_version_request_from_pyenv_pin(&std::env::current_dir()?) { - Some(version_request) => version_request, - None => config.default_toolchain()?, - } + ( + match get_python_version_request_from_pyenv_pin(&std::env::current_dir()?) { + Some(version_request) => version_request, + None => config.default_toolchain()?, + }, + true, + ) } else { // if neither requested explicitly, nor global-python is enabled, we fall // back to the next shadowed target @@ -253,10 +260,15 @@ fn get_shim_target( }; let py = get_toolchain_python_bin(&py_ver)?; if !py.is_file() { + let hint = if implicit_request { + Cow::Borrowed("rye fetch") + } else { + Cow::Owned(format!("rye fetch {}", py_ver)) + }; bail!( - "Requested Python version ({}) is not installed. Install with `rye fetch {}`", + "Requested Python version ({}) is not installed. Install with `{}`", py_ver, - py_ver + hint ); } From 6cab42d78d121d319ba4bbeac6c8ad46b128c0a6 Mon Sep 17 00:00:00 2001 From: zengqiu Date: Sun, 21 Jan 2024 20:32:26 +0800 Subject: [PATCH 056/166] Add PATH and registry information for adapting winget on Windows (#483) --- .gitignore | 1 + CHANGELOG.md | 3 + Cargo.lock | 11 ++ docs/guide/installation.md | 3 +- rye/Cargo.toml | 1 + rye/src/cli/rye.rs | 22 +-- rye/src/{utils.rs => utils/mod.rs} | 3 + rye/src/utils/windows.rs | 237 +++++++++++++++++++++++++++++ 8 files changed, 271 insertions(+), 10 deletions(-) rename rye/src/{utils.rs => utils/mod.rs} (99%) create mode 100644 rye/src/utils/windows.rs diff --git a/.gitignore b/.gitignore index 65c5db63cb..c3776a0f64 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ target /x site __pycache__ +.idea \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b7e9e7b4ce..340ded21ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ _Unreleased_ - Fixed an issue where `rye init` would pin a much too specific version in the `.python-version` file that is generated. #545 +- On Windows the `PATH` is now automatically adjusted on install and uninstall. This means that + manually adding the rye folder to the search path is no longer necessary. #483 + ## 0.18.0 diff --git a/Cargo.lock b/Cargo.lock index ffa0c44961..414d7d2d41 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1827,6 +1827,7 @@ dependencies = [ "whattheshell", "which", "winapi", + "winreg", "zip", "zstd", ] @@ -2654,6 +2655,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "x25519-dalek" version = "1.1.1" diff --git a/docs/guide/installation.md b/docs/guide/installation.md index fbc624e14a..2c0729276c 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -173,7 +173,8 @@ rye self uninstall ``` Additionally you should delete the remaining `.rye` folder from your home directory and -remove `.rye/shims` from the `PATH` again. Rye itself does not place any data +remove `.rye/shims` from the `PATH` again (usually by removing the code that sources +the `env` file from the installation step). Rye itself does not place any data in other locations. Note though that virtual environments created by rye will no longer function after Rye was uninstalled. diff --git a/rye/Cargo.toml b/rye/Cargo.toml index a796717dec..6f235d6385 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -65,3 +65,4 @@ whattheshell = "1.0.1" [target."cfg(windows)".dependencies] winapi = { version = "0.3.9", default-features = false, features = [] } +winreg = "0.51" diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index 2da2406e41..fe7b1fe620 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -312,16 +312,19 @@ fn uninstall(args: UninstallCommand) -> Result<(), Error> { let rye_home = env::var("RYE_HOME") .map(Cow::Owned) .unwrap_or(Cow::Borrowed(DEFAULT_HOME)); - if cfg!(unix) { + + #[cfg(unix)] + { echo!( "Don't forget to remove the sourcing of {} from your shell config.", - Path::new(&rye_home as &str).join("env").display() + Path::new(&*rye_home).join("env").display() ); - } else { - echo!( - "Don't forget to remove {} from your PATH", - Path::new(&rye_home as &str).join("shims").display() - ) + } + + #[cfg(windows)] + { + crate::utils::windows::remove_from_path(Path::new(&*rye_home))?; + crate::utils::windows::remove_from_programs()?; } Ok(()) @@ -462,8 +465,9 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( } #[cfg(windows)] { - echo!(); - echo!("Note: You need to manually add {DEFAULT_HOME} to your PATH."); + let rye_home = Path::new(&*rye_home); + crate::utils::windows::add_to_programs(rye_home)?; + crate::utils::windows::add_to_path(rye_home)?; } echo!("For more information read https://mitsuhiko.github.io/rye/guide/installation"); diff --git a/rye/src/utils.rs b/rye/src/utils/mod.rs similarity index 99% rename from rye/src/utils.rs rename to rye/src/utils/mod.rs index c6bfe7864f..d78c4520df 100644 --- a/rye/src/utils.rs +++ b/rye/src/utils/mod.rs @@ -22,6 +22,9 @@ pub use std::os::windows::fs::symlink_file; use crate::config::Config; use crate::consts::VENV_BIN; +#[cfg(windows)] +pub(crate) mod windows; + #[cfg(windows)] pub fn symlink_dir(original: P, link: Q) -> Result<(), std::io::Error> where diff --git a/rye/src/utils/windows.rs b/rye/src/utils/windows.rs new file mode 100644 index 0000000000..c260d433ee --- /dev/null +++ b/rye/src/utils/windows.rs @@ -0,0 +1,237 @@ +use std::env; +use std::ffi::OsString; +use std::os::windows::ffi::{OsStrExt, OsStringExt}; +use std::path::{Path, PathBuf}; + +use anyhow::{anyhow, Context, Error}; +use winreg::enums::{RegType, HKEY_CURRENT_USER, KEY_READ, KEY_WRITE}; +use winreg::{RegKey, RegValue}; + +const RYE_UNINSTALL_ENTRY: &str = r"Software\Microsoft\Windows\CurrentVersion\Uninstall\Rye"; + +pub(crate) fn add_to_path(rye_home: &Path) -> Result<(), Error> { + let target_path = reverse_resolve_user_profile(rye_home.join("shims")); + if let Some(old_path) = get_windows_path_var()? { + if let Some(new_path) = + append_entry_to_path(old_path, target_path.as_os_str().encode_wide().collect()) + { + apply_new_path(new_path)?; + } + } + Ok(()) +} + +pub(crate) fn remove_from_path(rye_home: &Path) -> Result<(), Error> { + let target_path = reverse_resolve_user_profile(rye_home.join("shims")); + if let Some(old_path) = get_windows_path_var()? { + if let Some(new_path) = + remove_entry_from_path(old_path, target_path.as_os_str().encode_wide().collect()) + { + apply_new_path(new_path)?; + } + } + Ok(()) +} + +/// If the target path is under the user profile, replace it with %USERPROFILE%. The +/// motivation here is that this was the path we documented originally so someone updating +/// Rye does not end up with two competing paths in the list for no reason. +fn reverse_resolve_user_profile(path: PathBuf) -> PathBuf { + if let Some(user_profile) = env::var_os("USERPROFILE").map(PathBuf::from) { + if let Ok(rest) = path.strip_prefix(&user_profile) { + return Path::new("%USERPROFILE%").join(rest); + } + } + path +} + +fn apply_new_path(new_path: Vec) -> Result<(), Error> { + use std::ptr; + use winapi::shared::minwindef::*; + use winapi::um::winuser::{ + SendMessageTimeoutA, HWND_BROADCAST, SMTO_ABORTIFHUNG, WM_SETTINGCHANGE, + }; + + let root = RegKey::predef(HKEY_CURRENT_USER); + let environment = root.open_subkey_with_flags("Environment", KEY_READ | KEY_WRITE)?; + + if new_path.is_empty() { + environment.delete_value("PATH")?; + } else { + let reg_value = RegValue { + bytes: to_winreg_bytes(new_path), + vtype: RegType::REG_EXPAND_SZ, + }; + environment.set_raw_value("PATH", ®_value)?; + } + + // Tell other processes to update their environment + #[allow(clippy::unnecessary_cast)] + unsafe { + SendMessageTimeoutA( + HWND_BROADCAST, + WM_SETTINGCHANGE, + 0 as WPARAM, + "Environment\0".as_ptr() as LPARAM, + SMTO_ABORTIFHUNG, + 5000, + ptr::null_mut(), + ); + } + + Ok(()) +} + +/// Get the windows PATH variable out of the registry as a String. If +/// this returns None then the PATH variable is not a string and we +/// should not mess with it. +fn get_windows_path_var() -> Result>, Error> { + use std::io; + + let root = RegKey::predef(HKEY_CURRENT_USER); + let environment = root + .open_subkey_with_flags("Environment", KEY_READ | KEY_WRITE) + .context("Failed opening Environment key")?; + + let reg_value = environment.get_raw_value("PATH"); + match reg_value { + Ok(val) => { + if let Some(s) = from_winreg_value(&val) { + Ok(Some(s)) + } else { + warn!( + "the registry key HKEY_CURRENT_USER\\Environment\\PATH is not a string. \ + Not modifying the PATH variable" + ); + Ok(None) + } + } + Err(ref e) if e.kind() == io::ErrorKind::NotFound => Ok(Some(Vec::new())), + Err(e) => Err(e).context("failure during windows path manipulation"), + } +} + +/// Returns None if the existing old_path does not need changing, otherwise +/// prepends the path_str to old_path, handling empty old_path appropriately. +fn append_entry_to_path(old_path: Vec, path_str: Vec) -> Option> { + if old_path.is_empty() { + Some(path_str) + } else if old_path + .windows(path_str.len()) + .any(|path| path == path_str) + { + None + } else { + let mut new_path = path_str; + new_path.push(b';' as u16); + new_path.extend_from_slice(&old_path); + Some(new_path) + } +} + +/// Returns None if the existing old_path does not need changing +fn remove_entry_from_path(old_path: Vec, path_str: Vec) -> Option> { + let idx = old_path + .windows(path_str.len()) + .position(|path| path == path_str)?; + // If there's a trailing semicolon (likely, since we probably added one + // during install), include that in the substring to remove. We don't search + // for that to find the string, because if it's the last string in the path, + // there may not be. + let mut len = path_str.len(); + if old_path.get(idx + path_str.len()) == Some(&(b';' as u16)) { + len += 1; + } + + let mut new_path = old_path[..idx].to_owned(); + new_path.extend_from_slice(&old_path[idx + len..]); + // Don't leave a trailing ; though, we don't want an empty string in the + // path. + if new_path.last() == Some(&(b';' as u16)) { + new_path.pop(); + } + Some(new_path) +} + +/// Registers rye as installed program. +pub(crate) fn add_to_programs(rye_home: &Path) -> Result<(), Error> { + let key = RegKey::predef(HKEY_CURRENT_USER) + .create_subkey(RYE_UNINSTALL_ENTRY) + .context("Failed creating uninstall key")? + .0; + + // Don't overwrite registry if Rye is already installed + let prev = key + .get_raw_value("UninstallString") + .map(|val| from_winreg_value(&val)); + if let Ok(Some(s)) = prev { + let mut path = PathBuf::from(OsString::from_wide(&s)); + path.pop(); + if path.exists() { + return Ok(()); + } + } + + let mut uninstall_cmd = OsString::from("\""); + uninstall_cmd.push(rye_home); + uninstall_cmd.push("\" self uninstall"); + + let reg_value = RegValue { + bytes: to_winreg_bytes(uninstall_cmd.encode_wide().collect()), + vtype: RegType::REG_SZ, + }; + + let current_version: &str = env!("CARGO_PKG_VERSION"); + + key.set_raw_value("UninstallString", ®_value) + .context("Failed to set uninstall string")?; + key.set_value( + "DisplayName", + &"Rye: An Experimental Package Management Solution for Python", + ) + .context("Failed to set display name")?; + key.set_value("DisplayVersion", ¤t_version) + .context("Failed to set display version")?; + key.set_value("Publisher", &"Rye") + .context("Failed to set publisher")?; + + Ok(()) +} + +/// Removes the entry on uninstall from the program list. +pub(crate) fn remove_from_programs() -> Result<(), Error> { + match RegKey::predef(HKEY_CURRENT_USER).delete_subkey_all(RYE_UNINSTALL_ENTRY) { + Ok(()) => Ok(()), + Err(ref e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()), + Err(e) => Err(anyhow!(e)), + } +} + +/// Convert a vector UCS-2 chars to a null-terminated UCS-2 string in bytes +pub(crate) fn to_winreg_bytes(mut v: Vec) -> Vec { + v.push(0); + unsafe { std::slice::from_raw_parts(v.as_ptr().cast::(), v.len() * 2).to_vec() } +} + +/// This is used to decode the value of HKCU\Environment\PATH. If that key is +/// not REG_SZ | REG_EXPAND_SZ then this returns None. The winreg library itself +/// does a lossy unicode conversion. +pub(crate) fn from_winreg_value(val: &winreg::RegValue) -> Option> { + use std::slice; + + match val.vtype { + RegType::REG_SZ | RegType::REG_EXPAND_SZ => { + // Copied from winreg + let mut words = unsafe { + #[allow(clippy::cast_ptr_alignment)] + slice::from_raw_parts(val.bytes.as_ptr().cast::(), val.bytes.len() / 2) + .to_owned() + }; + while words.last() == Some(&0) { + words.pop(); + } + Some(words) + } + _ => None, + } +} From e7d94897dcfdf889b54128c914cada5844c7261b Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 Jan 2024 13:47:57 +0100 Subject: [PATCH 057/166] Fix a regression in the add command (#547) --- CHANGELOG.md | 2 ++ rye/src/bootstrap.rs | 4 ++-- rye/src/cli/add.rs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 340ded21ab..44451156bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ _Unreleased_ - On Windows the `PATH` is now automatically adjusted on install and uninstall. This means that manually adding the rye folder to the search path is no longer necessary. #483 +- Fixed a regression in 0.18 that caused the `add` command to fail. #547 + ## 0.18.0 diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index c28b5f03c2..5c79d47407 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -35,7 +35,7 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques suffix: None, }; -const SELF_VERSION: u64 = 4; +const SELF_VERSION: u64 = 5; const SELF_REQUIREMENTS: &str = r#" build==0.10.0 @@ -52,7 +52,7 @@ pyproject_hooks==1.0.0 requests==2.29.0 tomli==2.0.1 twine==4.0.2 -unearth==0.9.0 +unearth==0.12.1 urllib3==1.26.15 virtualenv==20.22.0 "#; diff --git a/rye/src/cli/add.rs b/rye/src/cli/add.rs index 4ccebc97c3..7ac6c3d745 100644 --- a/rye/src/cli/add.rs +++ b/rye/src/cli/add.rs @@ -29,7 +29,7 @@ sources = json.loads(sys.argv[3]) pre = len(sys.argv) > 4 and sys.argv[4] == "--pre" finder = PackageFinder( - index_urls=sources["index_urls"], + index_urls=[x[0] for x in sources["index_urls"]], find_links=sources["find_links"], trusted_hosts=sources["trusted_hosts"], ) From 676b1bffa19b301b39b455b1bd52e228ca2055e0 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 Jan 2024 13:48:39 +0100 Subject: [PATCH 058/166] 0.19.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44451156bb..8d52908aee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ that were not yet released. ## 0.19.0 -_Unreleased_ +Released on 2024-01-21 - Improved the behavior of `rye fetch`. When invoked without arguments it will now try to fetch the version of the requested Python interpreter. Specifically this combining From 08b4be8ef1688a3ce89c33c19c34478690466f86 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 Jan 2024 13:49:19 +0100 Subject: [PATCH 059/166] 0.20 ready for dev --- CHANGELOG.md | 8 ++++++-- Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d52908aee..3cb08304d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.20.0 + +_Unreleased_ + + + ## 0.19.0 Released on 2024-01-21 @@ -19,8 +25,6 @@ Released on 2024-01-21 - Fixed a regression in 0.18 that caused the `add` command to fail. #547 - - ## 0.18.0 Released on 2024-01-20 diff --git a/Cargo.lock b/Cargo.lock index 414d7d2d41..58d6d3aea0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1781,7 +1781,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.19.0" +version = "0.20.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 6f235d6385..2045ccdd75 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.19.0" +version = "0.20.0" edition = "2021" license = "MIT" From b47390bb588a0fbdcfb26cb8f1696da13736e611 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 Jan 2024 13:55:32 +0100 Subject: [PATCH 060/166] Change documentation to mention automatic path updating on windows --- docs/guide/installation.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 2c0729276c..04d5abcf14 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -92,8 +92,10 @@ interpreter. === "Windows" - To modify the Windows PATH environment variable - + The windows installer normally will automatically register the rye path in the + `PATH` environment variable. If this does not work you will need to manually + perform the following steps: + 1. Press ++windows+r++, enter `sysdm.cpl` and hit ++enter++. 2. In the "System Properties" dialog, click the "Advanced" tab. 3. Click on "Environment Variables". From afdfc72f039040f1e479e255d8031414cf64f1de Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 Jan 2024 16:56:28 +0100 Subject: [PATCH 061/166] Improve error message on failed updates (#550) --- CHANGELOG.md | 3 +++ rye/src/cli/rye.rs | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cb08304d7..40d16fbc14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ that were not yet released. _Unreleased_ +- Improved the error message when an update could not be performed because files + are in use. #550 + ## 0.19.0 diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index fe7b1fe620..5f02ffad9b 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -178,7 +178,7 @@ fn update(args: UpdateCommand) -> Result<(), Error> { .join("bin") .join("rye") .with_extension(EXE_EXTENSION), - )?; + ) } else { let version = args.version.as_deref().unwrap_or("latest"); echo!("Updating to {version}"); @@ -216,8 +216,12 @@ fn update(args: UpdateCommand) -> Result<(), Error> { { fs::write(tmp.path(), bytes)?; } - update_exe_and_shims(tmp.path())?; + update_exe_and_shims(tmp.path()) } + .context( + "Unable to perform update. This can happen because files are in use. \ + Please stop running Python interpreters and retry the update.", + )?; echo!("Updated!"); echo!(); From d2643b6eb4c02f616e929b54e37e70e2e402bda2 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 Jan 2024 18:19:30 +0100 Subject: [PATCH 062/166] Move a more information info into unix only --- rye/src/cli/rye.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index 5f02ffad9b..e04dfa7bc5 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -465,6 +465,7 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( echo!(); } echo!("Note: after adding rye to your path, restart your shell for it to take effect."); + echo!("For more information read https://mitsuhiko.github.io/rye/guide/installation"); } } #[cfg(windows)] @@ -474,8 +475,6 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( crate::utils::windows::add_to_path(rye_home)?; } - echo!("For more information read https://mitsuhiko.github.io/rye/guide/installation"); - echo!(); echo!("{}", style("All done!").green()); From 3d5798f2804ac2a179a2119a1bea95b880b428b7 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 Jan 2024 20:37:08 +0100 Subject: [PATCH 063/166] Added FAQ entry for pytorch --- docs/guide/faq.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/guide/faq.md b/docs/guide/faq.md index ba119a7f25..f3cf5d1f3b 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -3,6 +3,34 @@ This section should cover some commonly asked questions. If you do not find an answer here, consider reaching out to the [community](../community.md). +## How Do I Install PyTorch? + +PyTorch requires setting up manual [sources](../sources) as it's not installed via +PyPI. These sources can be set up in [`pyproject.toml`](../pyproject/) for a +simple project or globally in the [config](../config/). + +* **Option 1:** `pyproject.toml` + + ```toml + [[tool.rye.sources]] + name = "pytorch" + url = "https://download.pytorch.org/whl/cpu" + ``` + +* **Option 2:** `~/.rye/config.toml` + + ```toml + [[sources]] + name = "pytorch" + url = "https://download.pytorch.org/whl/cpu" + ``` + +Afterwards you can add pytorch as you would expect: + +``` +rye add torch torchvision torchaudio +``` + ## Windows Developer Mode Rye does not require symlinks but it works significantly better with them. On Windows From a246b2be63c782db5c8b5c7ed28f1ac9a69990b0 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 Jan 2024 21:31:09 +0100 Subject: [PATCH 064/166] Update internals to newer versions (#553) --- CHANGELOG.md | 2 ++ rye/src/bootstrap.rs | 23 +++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40d16fbc14..7c77cb1381 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ _Unreleased_ - Improved the error message when an update could not be performed because files are in use. #550 +- Update the Python internals (python external dependencies) to new versions. #553 + ## 0.19.0 diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index 5c79d47407..5123e607a4 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -35,26 +35,25 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques suffix: None, }; -const SELF_VERSION: u64 = 5; +const SELF_VERSION: u64 = 6; const SELF_REQUIREMENTS: &str = r#" -build==0.10.0 -certifi==2022.12.7 -charset-normalizer==3.1.0 -click==8.1.3 -distlib==0.3.6 -filelock==3.12.0 +build==1.0.3 +certifi==2023.11.17 +charset-normalizer==3.3.2 +click==8.1.7 +distlib==0.3.8 +filelock==3.12.2 idna==3.4 packaging==23.1 -pip-tools==6.13.0 -platformdirs==3.4.0 +platformdirs==4.0.0 pyproject_hooks==1.0.0 -requests==2.29.0 +requests==2.31.0 tomli==2.0.1 twine==4.0.2 unearth==0.12.1 -urllib3==1.26.15 -virtualenv==20.22.0 +urllib3==2.0.7 +virtualenv==20.25.0 "#; static FORCED_TO_UPDATE: AtomicBool = AtomicBool::new(false); From 05b60660e8cb87c4c12e8d089aa604a718e658ba Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 Jan 2024 22:53:55 +0100 Subject: [PATCH 065/166] Upgrade to newer pip tools (#554) --- CHANGELOG.md | 3 +++ rye/src/bootstrap.rs | 11 +++++++---- rye/src/lock.rs | 18 ++++++++++++------ rye/src/piptools.rs | 42 ++++++++++++++++++++++++++++++++++++++---- rye/src/sync.rs | 14 ++++++-------- 5 files changed, 66 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c77cb1381..e2fee6be34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ _Unreleased_ - Update the Python internals (python external dependencies) to new versions. #553 +- Update to newer versions of pip tools. For Python 3.7 `6.14.0` is used, for + new Python versions `7.3.0` is used. #554 + ## 0.19.0 diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index 5123e607a4..5b00bd4c13 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -14,6 +14,7 @@ use tempfile::NamedTempFile; use crate::config::Config; use crate::consts::VENV_BIN; +use crate::piptools::LATEST_PIP; use crate::platform::{ get_app_dir, get_canonical_py_path, get_toolchain_python_bin, list_known_toolchains, symlinks_supported, @@ -35,7 +36,7 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques suffix: None, }; -const SELF_VERSION: u64 = 6; +const SELF_VERSION: u64 = 7; const SELF_REQUIREMENTS: &str = r#" build==1.0.3 @@ -151,9 +152,11 @@ fn do_update(output: CommandOutput, venv_dir: &Path, app_dir: &Path) -> Result<( pip_install_cmd.arg("-mpip"); pip_install_cmd.arg("install"); pip_install_cmd.arg("--upgrade"); - // pin to a specific pip version to work around a bug with pip-tools. Fix this - // once 7.0.0 is stable. https://github.com/mitsuhiko/rye/issues/368 - pip_install_cmd.arg("pip==23.1"); + + // This pip is only used for shim usage and is known to not support 3.7. pip-tools + // use their own local pip versions that are compatible. + pip_install_cmd.arg(LATEST_PIP); + if output == CommandOutput::Verbose { pip_install_cmd.arg("--verbose"); } else { diff --git a/rye/src/lock.rs b/rye/src/lock.rs index 6b6ec32643..2b682e1793 100644 --- a/rye/src/lock.rs +++ b/rye/src/lock.rs @@ -15,12 +15,12 @@ use serde::Serialize; use tempfile::NamedTempFile; use url::Url; -use crate::piptools::get_pip_compile; +use crate::piptools::{get_pip_compile, get_pip_tools_version, PipToolsVersion}; use crate::pyproject::{ normalize_package_name, DependencyKind, ExpandedSources, PyProject, Workspace, }; use crate::sources::PythonVersion; -use crate::utils::{get_venv_python_bin, set_proxy_variables, CommandOutput}; +use crate::utils::{set_proxy_variables, CommandOutput}; static FILE_EDITABLE_RE: Lazy = Lazy::new(|| Regex::new(r"^-e (file://.*?)\s*$").unwrap()); static REQUIREMENTS_HEADER: &str = r#"# generated by rye @@ -319,15 +319,20 @@ fn generate_lockfile( let pip_compile = get_pip_compile(py_ver, output)?; let mut cmd = Command::new(pip_compile); - cmd.arg("--resolver=backtracking") - .arg("--no-annotate") + + // legacy pip tools requires some extra parameters + if get_pip_tools_version(py_ver) == PipToolsVersion::Legacy { + cmd.arg("--resolver=backtracking"); + } + + cmd.arg("--no-annotate") .arg("--strip-extras") .arg("--allow-unsafe") .arg("--no-header") .arg("--pip-args") .arg(format!( - "--python=\"{}\"", - get_venv_python_bin(&workspace_path.join(".venv")).display() + "--python-version=\"{}.{}\"", + py_ver.major, py_ver.minor )) .arg("-o") .arg(&requirements_file) @@ -335,6 +340,7 @@ fn generate_lockfile( .current_dir(workspace_path) .env("PYTHONWARNINGS", "ignore") .env("PROJECT_ROOT", make_project_root_fragment(workspace_path)); + if output == CommandOutput::Verbose { cmd.arg("--verbose"); } else { diff --git a/rye/src/piptools.rs b/rye/src/piptools.rs index c6a18e9245..e2e64bbe62 100644 --- a/rye/src/piptools.rs +++ b/rye/src/piptools.rs @@ -10,14 +10,34 @@ use crate::sources::PythonVersion; use crate::sync::create_virtualenv; use crate::utils::{get_venv_python_bin, CommandOutput}; -const PIP_TOOLS_VERSION: &str = "pip-tools==6.13.0"; +// When changing these, also update `SELF_VERSION` in bootstrap.rs to ensure +// that the internals are re-created. +pub const LATEST_PIP: &str = "pip==23.3.2"; +const PIP_TOOLS_LATEST_REQ: &[&str] = &[LATEST_PIP, "pip-tools==7.3.0"]; +const PIP_TOOLS_LEGACY_REQ: &[&str] = &["pip==22.2.0", "pip-tools==6.14.0"]; + +#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] +/// Which version of piptools are in use? +pub enum PipToolsVersion { + Latest, + Legacy, +} + +impl PipToolsVersion { + fn requirements(&self) -> &'static [&'static str] { + match *self { + PipToolsVersion::Latest => PIP_TOOLS_LATEST_REQ, + PipToolsVersion::Legacy => PIP_TOOLS_LEGACY_REQ, + } + } +} fn get_pip_tools_bin(py_ver: &PythonVersion, output: CommandOutput) -> Result { let self_venv = ensure_self_venv(output)?; - let key = format!("{}@{}.{}", py_ver.name, py_ver.major, py_ver.minor); - let venv = get_app_dir().join("pip-tools").join(key); + let venv = get_pip_tools_venv(py_ver); let py = get_venv_python_bin(&venv); + let version = get_pip_tools_version(py_ver); if venv.join(&py).is_file() { return Ok(venv); @@ -32,7 +52,8 @@ fn get_pip_tools_bin(py_ver: &PythonVersion, output: CommandOutput) -> Result Result PipToolsVersion { + if py_ver.major == 3 && py_ver.minor == 7 { + PipToolsVersion::Legacy + } else { + PipToolsVersion::Latest + } +} + +pub fn get_pip_tools_venv(py_ver: &PythonVersion) -> PathBuf { + let key = format!("{}@{}.{}", py_ver.name, py_ver.major, py_ver.minor); + get_app_dir().join("pip-tools").join(key) +} + pub fn get_pip_sync(py_ver: &PythonVersion, output: CommandOutput) -> Result { Ok(get_pip_tools_bin(py_ver, output)? .join(VENV_BIN) diff --git a/rye/src/sync.rs b/rye/src/sync.rs index d06671feb5..a3fa32d565 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -14,7 +14,7 @@ use crate::lock::{ make_project_root_fragment, update_single_project_lockfile, update_workspace_lockfile, LockMode, LockOptions, }; -use crate::piptools::get_pip_sync; +use crate::piptools::{get_pip_sync, get_pip_tools_venv}; use crate::platform::get_toolchain_python_bin; use crate::pyproject::{read_venv_marker, ExpandedSources, PyProject}; use crate::sources::PythonVersion; @@ -106,7 +106,7 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { if marker.python != py_ver { if cmd.output != CommandOutput::Quiet { echo!( - "Python version mismatch (found {}, expect {}), recreating.", + "Python version mismatch (found {}, expected {}), recreating.", marker.python, py_ver ); @@ -145,8 +145,8 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { fetch(&py_ver.into(), output).context("failed fetching toolchain ahead of sync")?; // kill the virtualenv if it's there and we need to get rid of it. - if recreate { - fs::remove_dir_all(&venv).ok(); + if recreate && venv.is_dir() { + fs::remove_dir_all(&venv).context("failed to delete existing virtualenv")?; } if venv.is_dir() { @@ -244,7 +244,7 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { } let tempdir = tempdir()?; symlink_dir( - get_pip_module(&self_venv).context("could not locate pip")?, + get_pip_module(&get_pip_tools_venv(&py_ver)).context("could not locate pip")?, tempdir.path().join("pip"), ) .context("failed linking pip module into for pip-sync")?; @@ -260,9 +260,7 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { .arg("--python-executable") .arg(&py_path) .arg("--pip-args") - // note that the double quotes are necessary to properly handle - // spaces in paths - .arg(format!("--python=\"{}\" --no-deps", py_path.display())); + .arg("--no-deps"); sources.add_as_pip_args(&mut pip_sync_cmd); From a0ef3cc29b4cbff000033dc6c93b76a38194238f Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 Jan 2024 22:54:04 +0100 Subject: [PATCH 066/166] Added support for virtual projects (#551) --- CHANGELOG.md | 3 ++ docs/guide/pyproject.md | 27 ++++++++++-- docs/guide/sync.md | 2 +- docs/guide/virtual.md | 32 +++++++++++++++ docs/guide/workspaces.md | 48 ++++++++++++++++++++++ mkdocs.yml | 2 + rye/src/cli/build.rs | 5 +++ rye/src/cli/init.rs | 89 ++++++++++++++++++++++++---------------- rye/src/cli/publish.rs | 4 ++ rye/src/cli/show.rs | 1 + rye/src/lock.rs | 28 +++++++++---- rye/src/pyproject.rs | 10 +++++ 12 files changed, 202 insertions(+), 49 deletions(-) create mode 100644 docs/guide/virtual.md create mode 100644 docs/guide/workspaces.md diff --git a/CHANGELOG.md b/CHANGELOG.md index e2fee6be34..649a8d9d0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ _Unreleased_ - Improved the error message when an update could not be performed because files are in use. #550 +- Rye now supports virtual projects. These are themselves not installed into the + virtualenv but their dependencies are. #551 + - Update the Python internals (python external dependencies) to new versions. #553 - Update to newer versions of pip tools. For Python 3.7 `6.14.0` is used, for diff --git a/docs/guide/pyproject.md b/docs/guide/pyproject.md index 581eb9547c..a5a11762b9 100644 --- a/docs/guide/pyproject.md +++ b/docs/guide/pyproject.md @@ -88,6 +88,23 @@ can be forced enabled in the global config. managed = true ``` +## `tool.rye.virtual` + ++++ 0.20.0 + +If this key is set to `true` the project is declared as a virtual project. This is a special +mode in which the package itself is not installed, but only the dependencies are. This is +for instance useful if you are not creating a Python project, but you are depending on Python +software. As an example you can use this to install software written in Python. This key is +set to true when `rye init` is invoked with the `--virtual` flag. + +```toml +[tool.rye] +virtual = true +``` + +For more information consult the [Virtual Project Guide](../virtual/). + ## `tool.rye.sources` This is an array of tables with sources that should be used for locating dependencies. @@ -174,13 +191,15 @@ hello-world = { call = "builtins:print('Hello World!')" } ## `tool.rye.workspace` -When a table with that key is stored, then a project is declared to be a workspace root. By -default all Python projects discovered in sub folders will then become members of this workspace -and share a virtualenv. Optionally the `members` key (an array) can be used to restrict these -members. In that list globs can be used. The root project itself is always a member. +When a table with that key is stored, then a project is declared to be a +[workspace](../workspaces/) root. By default all Python projects discovered in +sub folders will then become members of this workspace and share a virtualenv. +Optionally the `members` key (an array) can be used to restrict these members. +In that list globs can be used. The root project itself is always a member. ```toml [tool.rye.workspace] members = ["mylib-*"] ``` +For more information consult the [Workspaces Guide](../workspaces/). diff --git a/docs/guide/sync.md b/docs/guide/sync.md index 74d5fb7db5..2e08bace51 100644 --- a/docs/guide/sync.md +++ b/docs/guide/sync.md @@ -33,7 +33,7 @@ rye add --optional=web flask rye lock --features=web ``` -When working with workspaces, the package name needs to be prefixed with a slash: +When working with [workspaces](../workspaces/), the package name needs to be prefixed with a slash: ``` rye lock --features=package-name/feature-name diff --git a/docs/guide/virtual.md b/docs/guide/virtual.md new file mode 100644 index 0000000000..7722183880 --- /dev/null +++ b/docs/guide/virtual.md @@ -0,0 +1,32 @@ +# Virtual Projects + ++++ 0.20.0 + +Virtual projects are projects which are themselves not installable Python +packages, but that will sync their dependencies. They are declared like a +normal python package in a `pyproject.toml`, but they do not create a package. +Instead the `tool.rye.virtual` key is set to `true`. + +For instance this is useful if you want to use a program like `mkdocs` without +declaring a package yourself: + +``` +rye init --virtual +rye add mkdocs +rye sync +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. + +## Behavior Changes + +When synching 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. + +## Workspaces + +If a [workspace](../workspaces/) does not have a toplevel package it's +recommended that it's declared as virtual. diff --git a/docs/guide/workspaces.md b/docs/guide/workspaces.md new file mode 100644 index 0000000000..67a3fd0b2b --- /dev/null +++ b/docs/guide/workspaces.md @@ -0,0 +1,48 @@ +# Workspaces + +Workspaces are a feature that allows you to work with multiple packages that +have dependencies to each other. A workspace is declared by setting the +`tool.rye.workspace` key a `pyproject.toml`. Afterwards all projects within +that workspace share a singular virtualenv. + +## Declaring Workspaces + +A workspace is declared by the "toplevel" `pyproject.toml`. At the very least +the key `tool.rye.workspace` needs to be added. It's recommended that a glob +pattern is also set in the `members` key to prevent accidentally including +unintended folders as projects. + +```toml +[tool.rye.workspace] +members = ["myname-*"] +``` + +This declares a workspace where all folders starting with the name `myname-` +are considered. If the toplevel workspace in itself should not be a project, +then it should be declared as a virtual package: + +```toml +[tool.rye] +virtual = true + +[tool.rye.workspace] +members = ["myname-*"] +``` + +For more information on that see [Virtual Packages](../virtual/). + +## Syncing + +In a workspace it does not matter which project you are working with, the entire +workspace is synchronized at all times. This has some untypical consequences but +simplifies the general development workflow. + +When a package depends on another package it's first located in the workspace locally +before it's attempted to be downloaded from an index. The `--all-features` flag is +automatically applied to all packages, but to turn on the feature of a specific +package the feature name must be prefixed. For instance to enable the `foo` extra feature +of the `myname-bar` package you would need to do this: + +``` +rye sync --features=myname-bar/foo +``` diff --git a/mkdocs.yml b/mkdocs.yml index 491ecb3bcc..ade8290ace 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -19,6 +19,8 @@ nav: - Rust Modules: guide/rust.md - Dependency Sources: guide/sources.md - Dependencies: guide/deps.md + - Workspaces: guide/workspaces.md + - Virtual Projects: guide/virtual.md - Toolchains: - guide/toolchains/index.md - Portable CPython: guide/toolchains/cpython.md diff --git a/rye/src/cli/build.rs b/rye/src/cli/build.rs index 22bafe229f..ebe23db2e9 100644 --- a/rye/src/cli/build.rs +++ b/rye/src/cli/build.rs @@ -96,6 +96,11 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } for project in projects { + // skip over virtual packages on build + if project.is_virtual() { + continue; + } + if output != CommandOutput::Quiet { echo!("building {}", style(project.normalized_name()?).cyan()); } diff --git a/rye/src/cli/init.rs b/rye/src/cli/init.rs index 9a4cee92ab..efcdec07ac 100644 --- a/rye/src/cli/init.rs +++ b/rye/src/cli/init.rs @@ -62,6 +62,12 @@ pub struct Args { /// Don't import from setup.cfg, setup.py, or requirements files. #[arg(long)] no_import: bool, + /// Initialize this as a virtual package. + /// + /// A virtual package can have dependencies but is itself not installed as a + /// Python package. It also cannot be published. + #[arg(long = "virtual")] + is_virtual: bool, /// Requirements files to initialize pyproject.toml with. #[arg(short, long, name = "REQUIREMENTS_FILE", conflicts_with = "no_import")] requirements: Option>, @@ -111,6 +117,8 @@ classifiers = ["Private :: Do Not Upload"] [project.scripts] hello = {{ name_safe ~ ":hello"}} +{%- if not is_virtual %} + [build-system] {%- if build_system == "hatchling" %} requires = ["hatchling"] @@ -128,9 +136,13 @@ build-backend = "pdm.backend" requires = ["maturin>=1.2,<2.0"] build-backend = "maturin" {%- endif %} +{%- endif %} [tool.rye] managed = true +{%- if is_virtual %} +virtual = true +{%- endif %} {%- if dev_dependencies %} dev-dependencies = [ {%- for dependency in dev_dependencies %} @@ -141,6 +153,7 @@ dev-dependencies = [ dev-dependencies = [] {%- endif %} +{%- if not is_virtual %} {%- if build_system == "hatchling" %} [tool.hatch.metadata] @@ -154,7 +167,7 @@ packages = [{{ "src/" ~ name_safe }}] python-source = "python" module-name = {{ name_safe ~ "._lowlevel" }} features = ["pyo3/extension-module"] - +{%- endif %} {%- endif %} "#; @@ -265,6 +278,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { let readme = dir.join("README.md"); let license_file = dir.join("LICENSE.txt"); let python_version_file = dir.join(".python-version"); + let is_virtual = cmd.is_virtual; if toml.is_file() { bail!("pyproject.toml already exists"); @@ -450,6 +464,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { license => metadata.license, dependencies => metadata.dependencies, dev_dependencies => metadata.dev_dependencies, + is_virtual, with_readme, build_system, private, @@ -457,45 +472,49 @@ pub fn execute(cmd: Args) -> Result<(), Error> { )?; fs::write(&toml, rv).context("failed to write pyproject.toml")?; - let src_dir = dir.join("src"); - if !imported_something && !src_dir.is_dir() { - let name = metadata.name.expect("project name"); - if is_rust { - fs::create_dir_all(&src_dir).ok(); - let project_dir = dir.join("python").join(name.replace('-', "_")); - fs::create_dir_all(&project_dir).ok(); - let rv = env.render_named_str("lib.rs", LIB_RS_TEMPLATE, context! { name })?; - fs::write(src_dir.join("lib.rs"), rv).context("failed to write lib.rs")?; - let rv = env.render_named_str( - "Cargo.json", - CARGO_TOML_TEMPLATE, - context! { - name, - name_safe, - }, - )?; - fs::write(dir.join("Cargo.toml"), rv).context("failed to write Cargo.toml")?; - let rv = env.render_named_str( - "__init__.py", - RUST_INIT_PY_TEMPLATE, - context! { - name_safe - }, - )?; - fs::write(project_dir.join("__init__.py"), rv) - .context("failed to write __init__.py")?; - } else { - let project_dir = src_dir.join(name.replace('-', "_")); - fs::create_dir_all(&project_dir).ok(); - let rv = env.render_named_str("__init__.py", INIT_PY_TEMPLATE, context! { name })?; - fs::write(project_dir.join("__init__.py"), rv) - .context("failed to write __init__.py")?; + if !is_virtual { + let src_dir = dir.join("src"); + if !imported_something && !src_dir.is_dir() { + let name = metadata.name.expect("project name"); + if is_rust { + fs::create_dir_all(&src_dir).ok(); + let project_dir = dir.join("python").join(name.replace('-', "_")); + fs::create_dir_all(&project_dir).ok(); + let rv = env.render_named_str("lib.rs", LIB_RS_TEMPLATE, context! { name })?; + fs::write(src_dir.join("lib.rs"), rv).context("failed to write lib.rs")?; + let rv = env.render_named_str( + "Cargo.json", + CARGO_TOML_TEMPLATE, + context! { + name, + name_safe, + }, + )?; + fs::write(dir.join("Cargo.toml"), rv).context("failed to write Cargo.toml")?; + let rv = env.render_named_str( + "__init__.py", + RUST_INIT_PY_TEMPLATE, + context! { + name_safe + }, + )?; + fs::write(project_dir.join("__init__.py"), rv) + .context("failed to write __init__.py")?; + } else { + let project_dir = src_dir.join(name.replace('-', "_")); + fs::create_dir_all(&project_dir).ok(); + let rv = + env.render_named_str("__init__.py", INIT_PY_TEMPLATE, context! { name })?; + fs::write(project_dir.join("__init__.py"), rv) + .context("failed to write __init__.py")?; + } } } echo!( - "{} Initialized project in {}", + "{} Initialized {}project in {}", style("success:").green(), + if is_virtual { "virtual " } else { "" }, dir.display() ); echo!(" Run `rye sync` to get started"); diff --git a/rye/src/cli/publish.rs b/rye/src/cli/publish.rs index 5d8c8292e7..0972e51c52 100644 --- a/rye/src/cli/publish.rs +++ b/rye/src/cli/publish.rs @@ -58,6 +58,10 @@ pub fn execute(cmd: Args) -> Result<(), Error> { let venv = ensure_self_venv(output)?; let project = PyProject::discover()?; + if project.is_virtual() { + bail!("virtual packages cannot be published"); + } + // Get the files to publish. let files = match cmd.dist { Some(paths) => paths, diff --git a/rye/src/cli/show.rs b/rye/src/cli/show.rs index 390af9596e..305575c67f 100644 --- a/rye/src/cli/show.rs +++ b/rye/src/cli/show.rs @@ -46,6 +46,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } } } + echo!("virtual: {}", style(project.is_virtual()).cyan()); if let Some(workspace) = project.workspace() { echo!( diff --git a/rye/src/lock.rs b/rye/src/lock.rs index 2b682e1793..d0f0239cf3 100644 --- a/rye/src/lock.rs +++ b/rye/src/lock.rs @@ -94,7 +94,12 @@ pub fn update_workspace_lockfile( let pyproject = pyproject_result?; let rel_url = make_relative_url(&pyproject.root_path(), &workspace.path())?; let applicable_extras = format_project_extras(features_by_project.as_ref(), &pyproject)?; - writeln!(local_req_file, "-e {}{}", rel_url, applicable_extras)?; + + // virtual packages are not installed + if !pyproject.is_virtual() { + writeln!(local_req_file, "-e {}{}", rel_url, applicable_extras)?; + } + local_projects.insert(pyproject.normalized_name()?, rel_url); projects.push(pyproject); } @@ -263,15 +268,20 @@ pub fn update_single_project_lockfile( echo!("Generating {} lockfile: {}", lock_mode, lockfile.display()); } - let features_by_project = collect_workspace_features(lock_options); - let applicable_extras = format_project_extras(features_by_project.as_ref(), pyproject)?; let mut req_file = NamedTempFile::new()?; - writeln!( - req_file, - "-e {}{}", - make_relative_url(&pyproject.root_path(), &pyproject.workspace_path())?, - applicable_extras - )?; + + // virtual packages are themselves not installed + if !pyproject.is_virtual() { + let features_by_project = collect_workspace_features(lock_options); + let applicable_extras = format_project_extras(features_by_project.as_ref(), pyproject)?; + writeln!( + req_file, + "-e {}{}", + make_relative_url(&pyproject.root_path(), &pyproject.workspace_path())?, + applicable_extras + )?; + } + for dep in pyproject.iter_dependencies(DependencyKind::Normal) { writeln!(req_file, "{}", dep)?; } diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index cfe1d0086b..dab34758a1 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -952,6 +952,16 @@ impl PyProject { } } + /// Is this a virtual package (does not build) + pub fn is_virtual(&self) -> bool { + self.doc + .get("tool") + .and_then(|x| x.get("rye")) + .and_then(|x| x.get("virtual")) + .and_then(|x| x.as_bool()) + .unwrap_or(false) + } + /// Should requirements.txt based locking include a find-links reference? pub fn lock_with_sources(&self) -> bool { match self.workspace { From f7c928898ae5f952fc2f6acffa10a6cd4a54b945 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 Jan 2024 23:28:09 +0100 Subject: [PATCH 067/166] Update readme and move badges to community section --- README.md | 65 +++++++++++++++++------------------------------ docs/community.md | 26 ++++++++++++++++++- docs/index.md | 14 +++++----- 3 files changed, 57 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index f5ca7fec32..e40efc3503 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,20 @@ ----
-[![](https://dcbadge.vercel.app/api/server/drbkcdtSbg)](https://discord.gg/drbkcdtSbg) +[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/mitsuhiko/rye/main/artwork/badge.json)](https://rye-up.com) +[![](https://dcbadge.vercel.app/api/server/drbkcdtSbg?style=flat)](https://discord.gg/drbkcdtSbg)
-Rye is [Armin's](https://github.com/mitsuhiko/) personal one-stop-shop for all -his Python needs. It installs and manages Python installations, manages -`pyproject.toml` files, installs and uninstalls dependencies, manages -virtualenvs behind the scenes. It supports monorepos and global tool -installations. +Rye is a project and package management solution for Python, created by +[Armin](https://github.com/mitsuhiko/). It came out of his desire to create a +one-stop-shop for all Python needs. It installs and manages Python +installations, manages `pyproject.toml` files, installs and uninstalls +dependencies, manages virtualenvs behind the scenes. It supports monorepos and +global tool installations. -It is a wish of what Python was, with no guarantee to work for anyone else. It's -an exploration, and it's far from perfect. Thus also the question: +It is a wish of what Python was, an exploration of what is possible. It's far +from perfect, but always improving. It also asks the question: **[Should it exist?](https://github.com/mitsuhiko/rye/discussions/6)**
@@ -102,12 +104,12 @@ $ rye sync To understand why things are the way they are: -- **Virtualenvs:** while I personally do not like virtualenvs that much, they are - so widespread and have reasonable tooling support, so I chose this over - `__pypackages__`. +- **Virtualenvs:** they are not pefect, but they are widespread. + Because they have reasonable tooling support, the decision was made to + leverage them over `__pypackages__`. - **No Default Dependencies:** the virtualenvs when they come up are completely void - of dependencies. Not even `pip` or `setuptools` are installed into it. Rye + of dependencies. Not even `pip` or `setuptools` are installed into it. Rye manages the virtualenv from outside the virtualenv. - **No Core Non Standard Stuff:** Rye (with the exception of it's own `tool` section @@ -118,9 +120,9 @@ To understand why things are the way they are: - **No Pip:** Rye uses pip, but it does not expose it. It manage dependencies in `pyproject.toml` only. -- **No System Python:** I can't deal with any more linux distribution weird Python - installations or whatever mess there is on macOS. I used to build my own Pythons - that are the same everywhere, now I use [indygreg's Python builds](https://github.com/indygreg/python-build-standalone). +- **No System Python:** To simplify the experience for users across operating systems, + Rye manages Python installations for you, bypassing the system one by default in + favor of [indygreg's Python builds](https://github.com/indygreg/python-build-standalone). Rye will automatically download and manage Python builds from there. No compiling, no divergence. @@ -158,30 +160,11 @@ $ pycowsay Wow To uninstall run `rye uninstall pycowsay` again. +## More -## Badges - -If you're using Rye, consider adding the Rye badge to project's `README.md`: - -```md -[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/mitsuhiko/rye/main/artwork/badge.json)](https://rye-up.com) -``` - -...or `README.rst`: - -```rst -.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/mitsuhiko/rye/main/artwork/badge.json - :target: https://rye-up.com - :alt: Rye -``` - -...or, as HTML: - -```html -Rye -``` - -[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/mitsuhiko/rye/main/artwork/badge.json)](https://rye-up.com) - - -License: MIT +* [Discussion Forum](https://github.com/mitsuhiko/rye/discussions), to discuss the project + on GitHub +* [Discord](https://discord.gg/drbkcdtSbg), for conversations with other developers in text form +* [Issue Tracker](https://github.com/mitsuhiko/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 +* License: MIT diff --git a/docs/community.md b/docs/community.md index 4e2cc96dab..69d086d4f6 100644 --- a/docs/community.md +++ b/docs/community.md @@ -15,4 +15,28 @@ the developer or other members of the community: * [Issue Tracker](https://github.com/mitsuhiko/rye/issues), if you run into bugs or have suggestions You can also reach out [via Twitter](https://twitter.com/mitsuhiko) or -[Bluesky](https://bsky.app/profile/mitsuhiko.at). \ No newline at end of file +[Bluesky](https://bsky.app/profile/mitsuhiko.at). + +## Badges + +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/mitsuhiko/rye/main/artwork/badge.json)](https://rye-up.com) +``` + +... or `README.rst`: + +```rst +.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/mitsuhiko/rye/main/artwork/badge.json + :target: https://rye-up.com + :alt: Rye +``` + +... or, as HTML: + +```html +Rye +``` + +[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/mitsuhiko/rye/main/artwork/badge.json)](https://rye-up.com) diff --git a/docs/index.md b/docs/index.md index e62661bd20..37a177c8fd 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,14 +5,16 @@ hide: # Rye: An Experimental Package Management Solution for Python -Rye is [Armin's](https://github.com/mitsuhiko) personal one-stop-shop for all -his Python needs. It installs and manages Python installations, helps working with -`pyproject.toml` files, installs and uninstalls dependencies, creates and updates -virtualenvs behind the scenes. It supports monorepos and global tool installations. +Rye is a project and package management solution for Python, created by +[Armin](https://github.com/mitsuhiko/). It came out of his desire to create a +one-stop-shop for all Python needs. It installs and manages Python +installations, manages `pyproject.toml` files, installs and uninstalls +dependencies, manages virtualenvs behind the scenes. It supports monorepos and +global tool installations. Rye is an experimental endeavour to build a new type of packaging experience to -Python inspired by `rustup` and `cargo` from Rust. It's **not yet production ready** -but feedback and suggestions are greatly appreciated. +Python inspired by `rustup` and `cargo` from Rust. Please give it a try. +Feedback and suggestions are greatly appreciated.

From 76d1c795b2b0f52cc14d80dea5ec46c936e6bd78 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 22 Jan 2024 12:47:30 +0100 Subject: [PATCH 068/166] Add ruff powered lint and fmt (#555) --- CHANGELOG.md | 3 ++ rye/src/bootstrap.rs | 3 +- rye/src/cli/build.rs | 36 ++------------------- rye/src/cli/fmt.rs | 77 ++++++++++++++++++++++++++++++++++++++++++++ rye/src/cli/lint.rs | 77 ++++++++++++++++++++++++++++++++++++++++++++ rye/src/cli/mod.rs | 8 +++++ rye/src/pyproject.rs | 41 +++++++++++++++++++++++ 7 files changed, 210 insertions(+), 35 deletions(-) create mode 100644 rye/src/cli/fmt.rs create mode 100644 rye/src/cli/lint.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 649a8d9d0a..986afdfe2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ _Unreleased_ - Update to newer versions of pip tools. For Python 3.7 `6.14.0` is used, for new Python versions `7.3.0` is used. #554 +- Added `rye fmt` and `rye lint` commands to format and lint with + the help of Ruff. #555 + ## 0.19.0 diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index 5b00bd4c13..670d25b5e1 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -36,7 +36,7 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques suffix: None, }; -const SELF_VERSION: u64 = 7; +const SELF_VERSION: u64 = 8; const SELF_REQUIREMENTS: &str = r#" build==1.0.3 @@ -55,6 +55,7 @@ twine==4.0.2 unearth==0.12.1 urllib3==2.0.7 virtualenv==20.25.0 +ruff==0.1.14 "#; static FORCED_TO_UPDATE: AtomicBool = AtomicBool::new(false); diff --git a/rye/src/cli/build.rs b/rye/src/cli/build.rs index ebe23db2e9..49191c9b18 100644 --- a/rye/src/cli/build.rs +++ b/rye/src/cli/build.rs @@ -7,7 +7,7 @@ use clap::Parser; use console::style; use crate::bootstrap::ensure_self_venv; -use crate::pyproject::{normalize_package_name, PyProject}; +use crate::pyproject::{locate_projects, PyProject}; use crate::utils::{get_venv_python_bin, CommandOutput}; /// Builds a package for distribution. @@ -61,39 +61,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } } - let mut projects = Vec::new(); - - if cmd.all { - match project.workspace() { - Some(workspace) => { - for project in workspace.iter_projects() { - projects.push(project?); - } - } - None => { - projects.push(project); - } - } - } else if cmd.package.is_empty() { - projects.push(project); - } else { - for package_name in cmd.package { - match project.workspace() { - Some(workspace) => { - if let Some(project) = workspace.get_project(&package_name)? { - projects.push(project); - } else { - bail!("unknown project '{}'", package_name); - } - } - None => { - if project.normalized_name()? != normalize_package_name(&package_name) { - bail!("unknown project '{}'", package_name); - } - } - } - } - } + let projects = locate_projects(project, cmd.all, &cmd.package[..])?; for project in projects { // skip over virtual packages on build diff --git a/rye/src/cli/fmt.rs b/rye/src/cli/fmt.rs new file mode 100644 index 0000000000..7b24f6dbfd --- /dev/null +++ b/rye/src/cli/fmt.rs @@ -0,0 +1,77 @@ +use std::ffi::OsString; +use std::path::PathBuf; +use std::process::Command; + +use anyhow::Error; +use clap::Parser; + +use crate::bootstrap::ensure_self_venv; +use crate::consts::VENV_BIN; +use crate::pyproject::{locate_projects, PyProject}; +use crate::utils::{CommandOutput, QuietExit}; + +/// Run the code formatter on the project. +/// +/// This invokes ruff in format mode. +#[derive(Parser, Debug)] +pub struct Args { + /// Format all packages + #[arg(short, long)] + all: bool, + /// Format a specific package + #[arg(short, long)] + package: Vec, + /// Use this pyproject.toml file + #[arg(long, value_name = "PYPROJECT_TOML")] + pyproject: Option, + /// Run format in check mode + #[arg(long)] + check: bool, + /// Enables verbose diagnostics. + #[arg(short, long)] + verbose: bool, + /// Turns off all output. + #[arg(short, long, conflicts_with = "verbose")] + quiet: bool, + /// Extra arguments to the formatter + #[arg(trailing_var_arg = true)] + extra_args: Vec, +} + +pub fn execute(cmd: Args) -> Result<(), Error> { + let project = PyProject::load_or_discover(cmd.pyproject.as_deref())?; + let output = CommandOutput::from_quiet_and_verbose(cmd.quiet, cmd.verbose); + let venv = ensure_self_venv(output)?; + let ruff = venv.join(VENV_BIN).join("ruff"); + + let mut ruff_cmd = Command::new(ruff); + ruff_cmd.arg("format"); + match output { + CommandOutput::Normal => {} + CommandOutput::Verbose => { + ruff_cmd.arg("--verbose"); + } + CommandOutput::Quiet => { + ruff_cmd.arg("-q"); + } + } + + if cmd.check { + ruff_cmd.arg("--check"); + } + ruff_cmd.args(cmd.extra_args); + + ruff_cmd.arg("--"); + let projects = locate_projects(project, cmd.all, &cmd.package[..])?; + for project in projects { + ruff_cmd.arg(project.root_path().as_os_str()); + } + + let status = ruff_cmd.status()?; + if !status.success() { + let code = status.code().unwrap_or(1); + Err(QuietExit(code).into()) + } else { + Ok(()) + } +} diff --git a/rye/src/cli/lint.rs b/rye/src/cli/lint.rs new file mode 100644 index 0000000000..415b9739d9 --- /dev/null +++ b/rye/src/cli/lint.rs @@ -0,0 +1,77 @@ +use std::ffi::OsString; +use std::path::PathBuf; +use std::process::Command; + +use anyhow::Error; +use clap::Parser; + +use crate::bootstrap::ensure_self_venv; +use crate::consts::VENV_BIN; +use crate::pyproject::{locate_projects, PyProject}; +use crate::utils::{CommandOutput, QuietExit}; + +/// Run the linter on the project. +/// +/// This invokes ruff in lint mode. +#[derive(Parser, Debug)] +pub struct Args { + /// Linter all packages + #[arg(short, long)] + all: bool, + /// Lint a specific package + #[arg(short, long)] + package: Vec, + /// Use this pyproject.toml file + #[arg(long, value_name = "PYPROJECT_TOML")] + pyproject: Option, + /// Apply fixes. + #[arg(long)] + fix: bool, + /// Enables verbose diagnostics. + #[arg(short, long)] + verbose: bool, + /// Turns off all output. + #[arg(short, long, conflicts_with = "verbose")] + quiet: bool, + /// Extra arguments to the linter + #[arg(trailing_var_arg = true)] + extra_args: Vec, +} + +pub fn execute(cmd: Args) -> Result<(), Error> { + let project = PyProject::load_or_discover(cmd.pyproject.as_deref())?; + let output = CommandOutput::from_quiet_and_verbose(cmd.quiet, cmd.verbose); + let venv = ensure_self_venv(output)?; + let ruff = venv.join(VENV_BIN).join("ruff"); + + let mut ruff_cmd = Command::new(ruff); + ruff_cmd.arg("check"); + match output { + CommandOutput::Normal => {} + CommandOutput::Verbose => { + ruff_cmd.arg("--verbose"); + } + CommandOutput::Quiet => { + ruff_cmd.arg("-q"); + } + } + + if cmd.fix { + ruff_cmd.arg("--fix"); + } + ruff_cmd.args(cmd.extra_args); + + ruff_cmd.arg("--"); + let projects = locate_projects(project, cmd.all, &cmd.package[..])?; + for project in projects { + ruff_cmd.arg(project.root_path().as_os_str()); + } + + let status = ruff_cmd.status()?; + if !status.success() { + let code = status.code().unwrap_or(1); + Err(QuietExit(code).into()) + } else { + Ok(()) + } +} diff --git a/rye/src/cli/mod.rs b/rye/src/cli/mod.rs index 8988ef4efc..e428798475 100644 --- a/rye/src/cli/mod.rs +++ b/rye/src/cli/mod.rs @@ -7,8 +7,10 @@ mod add; mod build; mod config; mod fetch; +mod fmt; mod init; mod install; +mod lint; mod lock; mod make_req; mod pin; @@ -49,9 +51,13 @@ enum Command { Build(build::Args), Config(config::Args), Fetch(fetch::Args), + #[command(alias = "format")] + Fmt(fmt::Args), Init(init::Args), Install(install::Args), Lock(lock::Args), + #[command(alias = "check")] + Lint(lint::Args), MakeReq(make_req::Args), Pin(pin::Args), Publish(publish::Args), @@ -107,9 +113,11 @@ pub fn execute() -> Result<(), Error> { Command::Build(cmd) => build::execute(cmd), Command::Config(cmd) => config::execute(cmd), Command::Fetch(cmd) => fetch::execute(cmd), + Command::Fmt(cmd) => fmt::execute(cmd), Command::Init(cmd) => init::execute(cmd), Command::Install(cmd) => install::execute(cmd), Command::Lock(cmd) => lock::execute(cmd), + Command::Lint(cmd) => lint::execute(cmd), Command::MakeReq(cmd) => make_req::execute(cmd), Command::Pin(cmd) => pin::execute(cmd), Command::Publish(cmd) => publish::execute(cmd), diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index dab34758a1..64e0c40607 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -1335,3 +1335,44 @@ impl FromStr for BuildSystem { } } } + +/// Utility to locate projects +pub fn locate_projects( + base_project: PyProject, + all: bool, + packages: &[String], +) -> Result, Error> { + let mut projects = Vec::new(); + if all { + match base_project.workspace() { + Some(workspace) => { + for project in workspace.iter_projects() { + projects.push(project?); + } + } + None => { + projects.push(base_project); + } + } + } else if packages.is_empty() { + projects.push(base_project); + } else { + for package_name in packages { + match base_project.workspace() { + Some(workspace) => { + if let Some(project) = workspace.get_project(package_name)? { + projects.push(project); + } else { + bail!("unknown project '{}'", package_name); + } + } + None => { + if base_project.normalized_name()? != normalize_package_name(package_name) { + bail!("unknown project '{}'", package_name); + } + } + } + } + } + Ok(projects) +} From 639e6c9863e023f49ef0dde06eb36df6dcd35ecb Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 22 Jan 2024 18:10:48 +0100 Subject: [PATCH 069/166] Large update to the documentation (documented most commands) and some fixes --- docs/guide/basics.md | 2 +- docs/guide/commands/add.md | 71 +++++++++++++++++++++ docs/guide/commands/build.md | 57 +++++++++++++++++ docs/guide/commands/config.md | 53 ++++++++++++++++ docs/guide/commands/fetch.md | 23 +++++++ docs/guide/commands/fmt.md | 62 ++++++++++++++++++ docs/guide/commands/index.md | 26 ++++++++ docs/guide/commands/init.md | 56 +++++++++++++++++ docs/guide/commands/install.md | 76 +++++++++++++++++++++++ docs/guide/commands/lint.md | 54 ++++++++++++++++ docs/guide/commands/lock.md | 41 ++++++++++++ docs/guide/commands/make-req.md | 38 ++++++++++++ docs/guide/commands/pin.md | 40 ++++++++++++ docs/guide/commands/publish.md | 49 +++++++++++++++ docs/guide/commands/remove.md | 27 ++++++++ docs/guide/commands/run.md | 37 +++++++++++ docs/guide/commands/self/completion.md | 1 + docs/guide/commands/self/index.md | 9 +++ docs/guide/commands/self/uninstall.md | 1 + docs/guide/commands/self/update.md | 1 + docs/guide/commands/shell.md | 32 ++++++++++ docs/guide/commands/show.md | 44 +++++++++++++ docs/guide/commands/sync.md | 66 ++++++++++++++++++++ docs/guide/commands/toolchain/fetch.md | 1 + docs/guide/commands/toolchain/index.md | 11 ++++ docs/guide/commands/toolchain/list.md | 36 +++++++++++ docs/guide/commands/toolchain/register.md | 28 +++++++++ docs/guide/commands/toolchain/remove.md | 18 ++++++ docs/guide/commands/tools/index.md | 7 +++ docs/guide/commands/tools/install.md | 1 + docs/guide/commands/tools/uninstall.md | 1 + docs/guide/commands/uninstall.md | 25 ++++++++ docs/guide/commands/version.md | 37 +++++++++++ docs/guide/publish.md | 2 +- docs/guide/tools.md | 4 +- mkdocs.yml | 38 +++++++++++- pyproject.toml | 2 +- rye/src/cli/lint.rs | 2 +- rye/src/cli/rye.rs | 4 +- 39 files changed, 1074 insertions(+), 9 deletions(-) create mode 100644 docs/guide/commands/add.md create mode 100644 docs/guide/commands/build.md create mode 100644 docs/guide/commands/config.md create mode 100644 docs/guide/commands/fetch.md create mode 100644 docs/guide/commands/fmt.md create mode 100644 docs/guide/commands/index.md create mode 100644 docs/guide/commands/init.md create mode 100644 docs/guide/commands/install.md create mode 100644 docs/guide/commands/lint.md create mode 100644 docs/guide/commands/lock.md create mode 100644 docs/guide/commands/make-req.md create mode 100644 docs/guide/commands/pin.md create mode 100644 docs/guide/commands/publish.md create mode 100644 docs/guide/commands/remove.md create mode 100644 docs/guide/commands/run.md create mode 120000 docs/guide/commands/self/completion.md create mode 100644 docs/guide/commands/self/index.md create mode 120000 docs/guide/commands/self/uninstall.md create mode 120000 docs/guide/commands/self/update.md create mode 100644 docs/guide/commands/shell.md create mode 100644 docs/guide/commands/show.md create mode 100644 docs/guide/commands/sync.md create mode 120000 docs/guide/commands/toolchain/fetch.md create mode 100644 docs/guide/commands/toolchain/index.md create mode 100644 docs/guide/commands/toolchain/list.md create mode 100644 docs/guide/commands/toolchain/register.md create mode 100644 docs/guide/commands/toolchain/remove.md create mode 100644 docs/guide/commands/tools/index.md create mode 120000 docs/guide/commands/tools/install.md create mode 120000 docs/guide/commands/tools/uninstall.md create mode 100644 docs/guide/commands/uninstall.md create mode 100644 docs/guide/commands/version.md diff --git a/docs/guide/basics.md b/docs/guide/basics.md index b48b7d8472..a635101792 100644 --- a/docs/guide/basics.md +++ b/docs/guide/basics.md @@ -1,7 +1,7 @@ # Basics To use Rye you need to have a `pyproject.toml` based Python project. For this guide you can -create one with `rye init` which will create a new folder with a new project inside: +create one with [`rye init`](commands/init.md) which will create a new folder with a new project inside: ```shell rye init my-project diff --git a/docs/guide/commands/add.md b/docs/guide/commands/add.md new file mode 100644 index 0000000000..23cbb99aa8 --- /dev/null +++ b/docs/guide/commands/add.md @@ -0,0 +1,71 @@ +# `add` + +Adds a Python package to this project. The command takes a PEP 508 requirement string +but provides additional helper arguments to make this process more user friendly. For +instance instead of passing git references within the requiement string, the `--git` +parameter can be used. + +After a dependency is added it's not automatically installed. To do that, you need to +invoke the [`sync`](sync.md) command. To remove a dependency again use the [`remove`](remove.md) +command. + +## Example + +Add the latest version of a dependency that is compatible with the configured Python version: + +``` +$ rye add flask +Added flask>=3.0.1 as regular dependency +``` + +Add a dependency but add an optional extra feature: + +``` +$ rye add flask --features dotenv +Added flask[dotenv]>=3.0.1 as regular dependency +``` + +Add a git dependency: + +``` +$ rye add flask --git https://github.com/pallets/flask +Added flask @ git+https://github.com/pallets/flask as regular dependency +``` + +## Arguments + +* `...`: The package to add as PEP 508 requirement string. e.g. 'flask==2.2.3' + +## Options + +* `--git `: Install the given package from this git repository + +* `--url `: Install the given package from this URL + +* `--path `: Install the given package from this local path + +* `--absolute`: Force non interpolated absolute paths + +* `--tag `: Install a specific tag + +* `--rev `: Update to a specific git rev + +* `--branch `: Update to a specific git branch + +* `--features `: Adds a dependency with a specific feature + +* `--dev`: Add this as dev dependency + +* `--excluded`: Add this as an excluded dependency that will not be installed even if it's a sub dependency + +* `--optional `: Add this to an optional dependency group + +* `--pre`: Include pre-releases when finding a package version + +* `--pin `: Overrides the pin operator [possible values: `equal`, `tilde-equal``, `greater-than-equal``] + +* `-v, --verbose`: Enables verbose diagnostics + +* `-q, --quiet`: Turns off all output + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/build.md b/docs/guide/commands/build.md new file mode 100644 index 0000000000..a8dff8a1d9 --- /dev/null +++ b/docs/guide/commands/build.md @@ -0,0 +1,57 @@ +# `build` + +Builds a package for distribution. + +Under normal circumstances Rye automatically builds packages for +local development. However if you want to publish packages you need +to first build them into source distributions (`sdist`) and +binary/portable distributions (`wheel`). + +For more information see [Building and Publishing](../publish.md). + +## Example + +This builds wheels and source distributions at once: + +``` +$ rye build +building my-project +* Creating virtualenv isolated environment... +* Installing packages in isolated environment... (hatchling) +* Getting build dependencies for sdist... +* Building sdist... +* Building wheel from sdist +* Creating virtualenv isolated environment... +* Installing packages in isolated environment... (hatchling) +* Getting build dependencies for wheel... +* Building wheel... +Successfully built my_project-0.1.0.tar.gz and my_project-0.1.0-py3-none-any.whl +``` + +By default you will find the artifacts in the `dist` folder. + +## Arguments + +*no arguments* + +## Options + +* `--sdist`: Build an sdist + +* `--wheel`: Build a wheel + +* `-a, --all`: Build all packages + +* `-p, --package `: Build a specific package + +* `-o, --out `: An output directory (defaults to `workspace/dist`) + +* `--pyproject `: Use this `pyproject.toml`` file + +* `-c, --clean`: Clean the output directory first + +* `-v, --verbose`: Enables verbose diagnostics + +* `-q, --quiet`: Turns off all output + +* `-h, --help`: Print help \ No newline at end of file diff --git a/docs/guide/commands/config.md b/docs/guide/commands/config.md new file mode 100644 index 0000000000..e9e8115e66 --- /dev/null +++ b/docs/guide/commands/config.md @@ -0,0 +1,53 @@ +# `config` + +Reads or modifies the global `config.toml` file. + +The config file can be read via `--get` and it can be set with one of the set options (`--set`, `--set-int`, +`--set-bool`, or `--unset`). Each of the set operations takes a key=value pair. All of these can be supplied +multiple times. + +## Example + +This command turns on global shims: + +``` +rye config --set-bool behavior.global-python=true +``` + +Reads the currently set config value for global Python shims: + +``` +$ rye config --get behavior.global-python +true +``` + +Show the path to the config: + +``` +$ rye config --show-path +/Users/username/.rye/config.toml +``` + +## Arguments + +*no arguments* + +## Options + +* `--get `: Reads a config key + +* `--set `: Sets a config key to a string + +* `--set-int `: Sets a config key to an integer + +* `--set-bool `: Sets a config key to a bool + +* `--unset `: Remove a config key + +* `--show-path`: Print the path to the config + +* `--format `: Request parseable output format rather than lines + + [possible values: json] + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/fetch.md b/docs/guide/commands/fetch.md new file mode 100644 index 0000000000..ad9bba1cdf --- /dev/null +++ b/docs/guide/commands/fetch.md @@ -0,0 +1,23 @@ +# `uninstall` + +Uninstalls Rye again. + +For more information see [Uninstalling](../install.md#uninstalling) + +## Example + +Uninstall Rye: + +``` +$ rye self uninstall +``` + +## Arguments + +*no arguments* + +## Options + +* `-y, --yes`: Skip safety check + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/fmt.md b/docs/guide/commands/fmt.md new file mode 100644 index 0000000000..e5897b0c11 --- /dev/null +++ b/docs/guide/commands/fmt.md @@ -0,0 +1,62 @@ +# `fmt` + ++++ 0.20.0 + +Run the code formatter on the project. This command is aliased to `format`. + +## Example + +To format the code and write back to the files: + +``` +$ rye fmt +1 file reformatted, 231 files left unchanged +``` + +To just check if the code needs formatting: + +``` +$ rye fmt --check +Would reformat: src/my_project/utils.py +1 file would be reformatted, 231 files already formatted +``` + +To pass extra arguments to the underlying `ruff` formatter use `--`: + +``` +$ rye fmt -- --diff +--- src/my_project/utils.py ++++ src/my_project/utils.py +@@ -2,5 +2,4 @@ + + + def foo(): +- + pass + +1 file would be reformatted, 231 files already formatted +``` + +## Arguments + +* `[EXTRA_ARGS]` Extra arguments to the formatter. + + These arguments are forwarded directly to the underlying formatter (currently + always `ruff`). Note that extra arguments must be separated from other arguments + with the `--` marker. + +## Options + +* `-a, --all`: Format all packages in the workspace + +* `-p, --package `: Format a specific package + +* `--pyproject `: Use this `pyproject.toml` file + +* `--check`: Run format in check mode + +* `-v, --verbose`: Enables verbose diagnostics + +* `-q, --quiet`: Turns off all output + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/index.md b/docs/guide/commands/index.md new file mode 100644 index 0000000000..92897a7fef --- /dev/null +++ b/docs/guide/commands/index.md @@ -0,0 +1,26 @@ +# Commands + +This is a list of all the commands that rye provides: + +* [add](add.md): Adds a Python package to this project +* [build](build.md): Builds a package for distribution +* [config](config.md): Reads or updates the Rye configuration +* [fetch](fetch.md): Fetches a Python interpreter for the local machine (alias) +* [fmt](fmt.md): Run the code formatter on the project +* [init](init.md): Initializes a new project +* [install](install.md): Installs a global tool (alias) +* [lock](lock.md): Updates the lockfiles without installing dependencies +* [lint](lint.md): Run the linter on the project +* [make-req](make-req.md): Builds and prints a PEP 508 requirement string from parts +* [pin](pin.md): Pins a Python version to the project +* [publish](publish.md): Publish packages to a package repository +* [remove](remove.md): Remove a dependency from this project +* [run](run.md): Runs a command installed into this package +* [shell](shell.md): Spawns a shell with the virtualenv activated +* [show](show.md): Prints the current state of the project +* [sync](sync.md): Updates the virtualenv based on the pyproject.toml +* [toolchain](toolchain/index.md): Helper utility to manage Python toolchains +* [tools](tools/index.md): Helper utility to manage global tools. +* [self](self/index.md): Rye self management +* [uninstall](uninstall.md): Uninstalls a global tool (alias) +* [version](version.md): Get or set project version \ No newline at end of file diff --git a/docs/guide/commands/init.md b/docs/guide/commands/init.md new file mode 100644 index 0000000000..bea0e2e880 --- /dev/null +++ b/docs/guide/commands/init.md @@ -0,0 +1,56 @@ +# `init` + +This command initializes a new or existing Python project with Rye. Running it in +a folder with an already existing Python project will attempt to convert it over +and bootstrap Rye right there. Otherwise it can be used to create a completely new +project from scratch. + +For more information see the [Basics Guide](../basics.md). + +## Example + +``` +$ rye init +success: Initialized project in /Users/john/Development/my-project. + Run `rye sync` to get started +``` + +## Arguments + +* `[PATH]`: Where to place the project (defaults to current path) + +## Options + +* `--min-py `: Minimal Python version supported by this project + +* `-p, --py `: Python version to use for the virtualenv + +* `--no-readme`: Do not create a readme + +* `--no-pin`: Do not create .python-version file (requires-python will be used) + +* `--build-system `: Which build system should be used(defaults to hatchling)? + + [possible values: `hatchling`, `setuptools`, `flit`, `pdm`, `maturin`] + +* `--license `: Which license should be used (SPDX identifier)? + +* `--name `: The name of the package + +* `--private`: Set "Private :: Do Not Upload" classifier, used for private projects + +* `--no-import`: Don't import from setup.cfg, setup.py, or requirements files + +* `--virtual`: Initialize this as a virtual package. + + A virtual package can have dependencies but is itself not installed as a Python package. It also cannot be published. + +* `-r, --requirements `: Requirements files to initialize pyproject.toml with + +* `--dev-requirements `: Development requirements files to initialize pyproject.toml with + +* `-v, --verbose`: Enables verbose diagnostics + +* `-q, --quiet`: Turns off all output + +* `-h, --help`: Print help (see a summary with '-h') diff --git a/docs/guide/commands/install.md b/docs/guide/commands/install.md new file mode 100644 index 0000000000..d39f444864 --- /dev/null +++ b/docs/guide/commands/install.md @@ -0,0 +1,76 @@ +# `install` + +Installs a package as global tool. This command has two names +to `rye tools install` and `rye install`. + +This can be used to install useful Python scripts globally into it's own +separated virtualenv. For instance if you want to use the `black` formatter +you can install it once. + +Normally only scripts installed by the top level dependency are installed. In +some cases you might also want to install commands from sub-dependencies. In +that case pass those dependencies with `--include-dep`. + +For more information see [Tools](/guide/tools/). + +## Example + +``` +$ rye tools install pycowsay +Looking in indexes: https://pypi.org/simple/ +Collecting pycowsay + Downloading pycowsay-0.0.0.2-py3-none-any.whl.metadata (965 bytes) +Downloading pycowsay-0.0.0.2-py3-none-any.whl (4.0 kB) +Installing collected packages: pycowsay +Successfully installed pycowsay-0.0.0.2 + +Installed scripts: + - pycowsay + +$ pycowsay "Great Stuff" + + ----------- +< Great Stuff > + ----------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || +``` + +## Arguments + +* `...`: The package to install as PEP 508 requirement string. + +## Options + +* `--git `: Install the given package from this git repository + +* `--url `: Install the given package from this URL + +* `--path `: Install the given package from this local path + +* `--absolute`: Force non interpolated absolute paths + +* `--tag `: Install a specific tag + +* `--rev `: Update to a specific git rev + +* `--branch `: Update to a specific git branch + +* `--features `: Adds a dependency with a specific feature + +* `--include-dep `: Include scripts from a given dependency + +* `--extra-requirement `: Additional dependencies to install that are not declared by the main package + +* `-p, --python `: Optionally the Python version to use + +* `-f, --force`: Force install the package even if it's already there + +* `-v, --verbose`: Enables verbose diagnostics + +* `-q, --quiet`: Turns off all output + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/lint.md b/docs/guide/commands/lint.md new file mode 100644 index 0000000000..db20fb27bd --- /dev/null +++ b/docs/guide/commands/lint.md @@ -0,0 +1,54 @@ +# `lint` + ++++ 0.20.0 + +Run the linter on the project. This command is aliased to `check`. At the moment +this always runs `ruff` in lint mode. + +## Example + +Run the linter: + +``` +$ rye lint +src/myproject/sdk.py:1:8: F401 [*] `sys` imported but unused +Found 1 error. +[*] 1 fixable with the `--fix` option. +``` + +For issues that can be auto fixed pass `--fix`: + +``` +$ rye lint --fix +Found 1 error (1 fixed, 0 remaining). +``` + +To pass extra arguments: + +``` +$ rye lint -- --watch +``` + +## Arguments + +* `[EXTRA_ARGS]` Extra arguments to the linter. + + These arguments are forwarded directly to the underlying linter (currently + always `ruff`). Note that extra arguments must be separated from other arguments + with the `--` marker. + +## Options + +* `-a, --all`: Lint all packages in the workspace + +* `-p, --package `: Format a specific package + +* `--pyproject `: Use this `pyproject.toml` file + +* `--fix`: Automatically fix fixable issues + +* `-v, --verbose`: Enables verbose diagnostics + +* `-q, --quiet`: Turns off all output + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/lock.md b/docs/guide/commands/lock.md new file mode 100644 index 0000000000..374e0744b6 --- /dev/null +++ b/docs/guide/commands/lock.md @@ -0,0 +1,41 @@ +# `lock` + +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). + +## Example + +``` +$ rye lock +Generating production lockfile: /Users/username/my-project/requirements.lock +Generating dev lockfile: /Users/username/my-project/requirements-dev.lock +Done! +``` + +## Arguments + +*no arguments* + +## Options + +* `--update `: Update a specific package + +* `--update-all`: Update all packages to the latest + +* `--pre`: Update to pre-release versions + +* `--features `: Extras/features to enable when locking the workspace + +* `--all-features`: Enables all features + +* `--with-sources`: Set to true to lock with sources in the lockfile + +* `--pyproject `: Use this pyproject.toml file + +* `-v, --verbose`: Enables verbose diagnostics + +* `-q, --quiet`: Turns off all output + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/make-req.md b/docs/guide/commands/make-req.md new file mode 100644 index 0000000000..dee265e2ef --- /dev/null +++ b/docs/guide/commands/make-req.md @@ -0,0 +1,38 @@ +# `make-req` + +Builds and prints a PEP 508 requirement string from parts. This is a utility command +that rarely needs to be used but can help creating requirements strings for pasting into +other tools. It takes the same arguments as [`add`](add.md) but rather than adding the +requirements into the requirements file it just spits out a formatted PEP 508 requirement +string on stdout. + +## Example + +``` +$ rye make-req flask --git https://github.com/pallets/flask --rev 4df377cfbf +flask @ git+https://github.com/pallets/flask@4df377cfbf +``` + +## Arguments + +* `[REQUIREMENTS]...` The package to add as PEP 508 requirement string. e.g. `'flask==2.2.3'` + +## Options + +* `--git `: Install the given package from this git repository + +* `--url `: Install the given package from this URL + +* `--path `: Install the given package from this local path + +* `--absolute`: Force non interpolated absolute paths + +* `--tag `: Install a specific tag + +* `--rev `: Update to a specific git rev + +* `--branch `: Update to a specific git branch + +* `--features `: Adds a dependency with a specific feature + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/pin.md b/docs/guide/commands/pin.md new file mode 100644 index 0000000000..96550d7281 --- /dev/null +++ b/docs/guide/commands/pin.md @@ -0,0 +1,40 @@ +# `pin` + +Pins a Python version to this project. + +This will update the `.python-version` to point to the provided version. +Additionally it will update `requires-python` in the `pyproject.toml` if it's +lower than the current version. This can be disabled by passing +`--no-update-requires-python`. + +## Example + +Pin a specific version of Python: + +``` +$ rye pin 3.9 +pinned 3.9.18 in /Users/username/my-project +``` + +To issue a relaxed and not a specific pin use `--relaxed`: + +``` +$ rye pin 3.9 --relaxed +pinned 3.9 in /Users/username/my-project +``` + +## Arguments + +* ``: The version of Python to pin + + This can be a short version (3.9) or a full one (`cpython@3.9.18`). + +## Options + +* `--relaxed`: Issue a relaxed pin + +* `--no-update-requires-python`: Prevent updating requires-python in the `pyproject.toml` + +* `--pyproject `: Use this `pyproject.toml` file + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/publish.md b/docs/guide/commands/publish.md new file mode 100644 index 0000000000..0baab43003 --- /dev/null +++ b/docs/guide/commands/publish.md @@ -0,0 +1,49 @@ +# `publish` + +Publish packages to a package repository. This publishes the packages which are +produced by the build command. + +For more information see [Building and Publishing](../publish.md). + +## Example + +Build and publish: + +``` +$ rye build +$ rye publish +``` + +Publish a specific artifact: + +``` +$ rye publish dist/example-0.1.0.tar.gz +``` + +## Arguments + +* `[DIST]...`: The distribution files to upload to the repository (defaults to `/dist/*`) + +## Options + +* `-r, --repository `: The repository to publish to [default: `pypi`] + +* `--repository-url `: The repository url to publish to + +* `-u, --username `: The username to authenticate to the repository with + +* `--token `: An access token used for the upload + +* `--sign`: Sign files to upload using GPG + +* `-i, --identity `: GPG identity used to sign files + +* `--cert `: Path to alternate CA bundle + +* `-y, --yes`: Skip prompts + +* `-v, --verbose`: Enables verbose diagnostics + +* `-q, --quiet`: Turns off all output + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/remove.md b/docs/guide/commands/remove.md new file mode 100644 index 0000000000..055f3980e0 --- /dev/null +++ b/docs/guide/commands/remove.md @@ -0,0 +1,27 @@ +# `remove` + +Removes a package from this project. This removes a package from the `pyproject.toml` +dependency list. + +## Example + +``` +$ rye remove flask +Removed flask>=3.0.1 +``` + +## Arguments + +* `...`: The packages to remove from the project + +## Options + +* `--dev`: Remove this from dev dependencies + +* `--optional `: Remove this from the optional dependency group + +* `-v, --verbose`: Enables verbose diagnostics + +* `-q, --quiet`: Turns off all output + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/run.md b/docs/guide/commands/run.md new file mode 100644 index 0000000000..eab03d8d47 --- /dev/null +++ b/docs/guide/commands/run.md @@ -0,0 +1,37 @@ +# `run` + +Runs a command installed into this package. This either runs a script or application +made available in the virtualenv or a Rye specific script. + +For more information see [`rye.tool.scripts`](../pyproject.md#toolryescripts). + +## Example + +Run a tool from the virtualenv: + +``` +$ rye run flask +``` + +Invoke it without arguments to see all available scripts: + +``` +$ rye run +flask +hello +python +python3 +python3.9 +``` + +## Arguments + +* `[COMMAND]`: The name of the command and the arguments to it. + +## Options + +* `-l, --list`: List all commands (implied without arguments) + +* `--pyproject`: Use this `pyproject.toml` file + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/self/completion.md b/docs/guide/commands/self/completion.md new file mode 120000 index 0000000000..fecfb581f0 --- /dev/null +++ b/docs/guide/commands/self/completion.md @@ -0,0 +1 @@ +../fetch.md \ No newline at end of file diff --git a/docs/guide/commands/self/index.md b/docs/guide/commands/self/index.md new file mode 100644 index 0000000000..55592de555 --- /dev/null +++ b/docs/guide/commands/self/index.md @@ -0,0 +1,9 @@ +# `self` + +Command to manage Rye itself. + +* [`completion`](completion.md): Generates a completion script for Rye. + +* [`update`](update.md): Performs an update of Rye. + +* [`uninstall`](uninstall.md): Uninstalls Rye again. diff --git a/docs/guide/commands/self/uninstall.md b/docs/guide/commands/self/uninstall.md new file mode 120000 index 0000000000..fecfb581f0 --- /dev/null +++ b/docs/guide/commands/self/uninstall.md @@ -0,0 +1 @@ +../fetch.md \ No newline at end of file diff --git a/docs/guide/commands/self/update.md b/docs/guide/commands/self/update.md new file mode 120000 index 0000000000..fecfb581f0 --- /dev/null +++ b/docs/guide/commands/self/update.md @@ -0,0 +1 @@ +../fetch.md \ No newline at end of file diff --git a/docs/guide/commands/shell.md b/docs/guide/commands/shell.md new file mode 100644 index 0000000000..418abfe38e --- /dev/null +++ b/docs/guide/commands/shell.md @@ -0,0 +1,32 @@ +# `shell` + +Spawns a shell with the virtualenv activated. + +**Warning:** this feature is inherently buggy as shells do not support portable APIs +to enable this functionality. This command might to away if it cannot be fixed. + +## Example + +Run a tool from the virtualenv: + +``` +$ rye shell +Spawning virtualenv shell from /Users/username/my-project/.venv +Leave shell with 'exit' +``` + +To exit the sub shell run `exit`. + +## Arguments + +*no arguments* + +## Options + +* `--no-banner`: Do not show banner + +* `--allow-nested`: Allow nested invocations + +* `--pyproject`: Use this `pyproject.toml` file + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/show.md b/docs/guide/commands/show.md new file mode 100644 index 0000000000..ffdb61bde4 --- /dev/null +++ b/docs/guide/commands/show.md @@ -0,0 +1,44 @@ +# `show` + +Prints the current state of the project. This can print out information about the +virtualenv, the project or workspace as well as a list of installed dependencies. + +## Example + +Print out the status of a project: + +``` +$ rye show +project: my-project +path: /Users/username/my-project +venv: /Users/username/my-project/.venv +target python: 3.8 +venv python: cpython@3.9.18 +virtual: false +``` + +To print out the list of installed dependencies: + +``` +$ rye show --installed-deps +asgiref==3.7.2 +blinker==1.7.0 +click==8.1.7 +Flask @ git+https://github.com/pallets/flask@4df377cfbfc1d15e962a61c18920b22aebc9aa41 +itsdangerous==2.1.2 +Jinja2==3.1.3 +MarkupSafe==2.1.4 +Werkzeug==3.0.1 +``` + +## Arguments + +*no arguments* + +## Options + +* `--installed-deps`: Print the currently installed dependencies + +* `--pyproject`: Use this `pyproject.toml` file + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/sync.md b/docs/guide/commands/sync.md new file mode 100644 index 0000000000..4ae19ab2f2 --- /dev/null +++ b/docs/guide/commands/sync.md @@ -0,0 +1,66 @@ +# `sync` + +Updates the lockfiles and installs the dependencies into the virtualenv. +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). + +## Example + +Sync the project: + +``` +$ rye sync +Reusing already existing virtualenv +Generating production lockfile: /Users/username/my-project/requirements.lock +Generating dev lockfile: /Users/username/my-project/requirements-dev.lock +Installing dependencies +... +``` + +To sync without updating the lock file use `--no-lock`: + +``` +$ rye sync --no-lock +``` + +If you do not want dev dependencies to be installed use `--no-dev`: + +``` +$ rye sync --no-dev +``` + +To exit the sub shell run `exit`. + +## Arguments + +*no arguments* + +## Options + +* `-f, --force`: Force the virtualenv to be re-created + +* `--no-dev`: Do not install dev dependencies + +* `--no-lock`: Do not update the lockfile. + +* `--update `: Update a specific package + +* `--update-all`: Update all packages to the latest + +* `--pre`: Update to pre-release versions + +* `--features `: Extras/features to enable when locking the workspace + +* `--all-features`: Enables all features + +* `--with-sources`: Set to true to lock with sources in the lockfile + +* `--pyproject `: Use this pyproject.toml file + +* `-v, --verbose`: Enables verbose diagnostics + +* `-q, --quiet`: Turns off all output + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/toolchain/fetch.md b/docs/guide/commands/toolchain/fetch.md new file mode 120000 index 0000000000..fecfb581f0 --- /dev/null +++ b/docs/guide/commands/toolchain/fetch.md @@ -0,0 +1 @@ +../fetch.md \ No newline at end of file diff --git a/docs/guide/commands/toolchain/index.md b/docs/guide/commands/toolchain/index.md new file mode 100644 index 0000000000..fdad073fc1 --- /dev/null +++ b/docs/guide/commands/toolchain/index.md @@ -0,0 +1,11 @@ +# `toolchain` + +Helper utility to manage Python toolchains. The following subcommands exist: + +* [`fetch`](fetch.md): fetches a toolchain + +* [`list`](list.md): lists all registered toolchains + +* [`register`](register.md): register a Python binary as custom toolchain + +* [`remove`](remove.md): removes or uninstalls a toolchain \ No newline at end of file diff --git a/docs/guide/commands/toolchain/list.md b/docs/guide/commands/toolchain/list.md new file mode 100644 index 0000000000..564db7e783 --- /dev/null +++ b/docs/guide/commands/toolchain/list.md @@ -0,0 +1,36 @@ +# `list` + +List all registered toolchains. It can list the toolchains which are installed as +well as toolchains which can be downloaded if `--include-downloadable` is passed. + +## Example + +List installed toolchains: + +``` +$ rye toolchain list +cpython@3.12.1 (/Users/username/.rye/py/cpython@3.12.1/install/bin/python3) +cpython@3.11.6 (/Users/username/.rye/py/cpython@3.11.6/install/bin/python3) +``` + +Lists downloadable toolchains: + +``` +$ rye toolchain list --include-downloadable +cpython@3.12.1 (/Users/mitsuhiko/.rye/py/cpython@3.12.1/install/bin/python3) +cpython-x86_64@3.12.1 (downloadable) +cpython@3.11.7 (downloadable) +... +``` + +## Arguments + +*no arguments* + +## Options + +* `--include-downloadable`: Also include non installed, but downloadable toolchains + +* `--format `: Request parseable output format [possible values: json] + +* `-h, --help`: Print help diff --git a/docs/guide/commands/toolchain/register.md b/docs/guide/commands/toolchain/register.md new file mode 100644 index 0000000000..cb03f1334f --- /dev/null +++ b/docs/guide/commands/toolchain/register.md @@ -0,0 +1,28 @@ +# `register` + +Register a Python binary as custom toolchain. + +Rye by default will automatically download Python releases from the internet. +However it's also possible to register already available local Python +installations. This allows you to use rye with self compiled Pythons. + +The name of the toolchain is auto detected (eg: `cpython`, `pypy` etc.) + +To unregister use the [`remove`](remove.md) command. + +## Example + +``` +$ rye toolchain register /opt/homebrew/Cellar/python@3.10/3.10.6_1/bin/python3.10 +Registered /opt/homebrew/Cellar/python@3.10/3.10.6_1/bin/python3.10 as cpython@3.10.6 +``` + +## Arguments + +* ``: Path to the python binary that should be registered + +## Options + +* `-n, --name `: Name of the toolchain. If not provided a name is auto detected. + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/toolchain/remove.md b/docs/guide/commands/toolchain/remove.md new file mode 100644 index 0000000000..56dca8755c --- /dev/null +++ b/docs/guide/commands/toolchain/remove.md @@ -0,0 +1,18 @@ +# `remove` + +Removes or uninstalls a toolchain. + +## Example + +``` +$ rye toolchain remove 3.9.5 +Removed installed toolchain cpython@3.9.5 +``` + +## Arguments + +* `` The version of Python to remove. + +## Options + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/tools/index.md b/docs/guide/commands/tools/index.md new file mode 100644 index 0000000000..cb8ff88144 --- /dev/null +++ b/docs/guide/commands/tools/index.md @@ -0,0 +1,7 @@ +# `tools` + +Helper utility to manage global tool installations. + +* [`install`](install.md): installs a tool globally. + +* [`uninstall`](uninstall.md): uninstalls a globally installed tool. diff --git a/docs/guide/commands/tools/install.md b/docs/guide/commands/tools/install.md new file mode 120000 index 0000000000..2c6e73458c --- /dev/null +++ b/docs/guide/commands/tools/install.md @@ -0,0 +1 @@ +../install.md \ No newline at end of file diff --git a/docs/guide/commands/tools/uninstall.md b/docs/guide/commands/tools/uninstall.md new file mode 120000 index 0000000000..afc2b2454e --- /dev/null +++ b/docs/guide/commands/tools/uninstall.md @@ -0,0 +1 @@ +../uninstall.md \ No newline at end of file diff --git a/docs/guide/commands/uninstall.md b/docs/guide/commands/uninstall.md new file mode 100644 index 0000000000..c8b734f139 --- /dev/null +++ b/docs/guide/commands/uninstall.md @@ -0,0 +1,25 @@ +# `uninstall` + +Uninstalls an already installed global tool. This command has two names +to `rye tools uninstall` and `rye uninstall`. + +For more information see [Tools](/guide/tools/). + +## Example + +``` +$ rye tools uninstall pycowsay +Uninstalled pycowsay +``` + +## Arguments + +* ``: The package to uninstall. + +## Options + +* `-v, --verbose`: Enables verbose diagnostics + +* `-q, --quiet`: Turns off all output + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/version.md b/docs/guide/commands/version.md new file mode 100644 index 0000000000..4888eca575 --- /dev/null +++ b/docs/guide/commands/version.md @@ -0,0 +1,37 @@ +# `version` + +Get or set project version. Note that this does not refer to the version of Rye +itself but the version that is set in the `pyproject.toml` file. + +## Example + +Get the current version: + +``` +$ rye version +0.1.0 +``` + +Bump the version by minor: + +``` +$ rye version -b minor +version bumped to 0.2.0 +``` + +Set to a specific version: + +``` +$ rye version 1.0.0 +version set to 1.0.0 +``` + +## Arguments + +* `[VERSION]`: the version to set + +## Options + +* `-b, --bump `: automatically bump the version in a specific way (`major`, `minor` or `patch`) + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/publish.md b/docs/guide/publish.md index fda13916d5..f37a23173e 100644 --- a/docs/guide/publish.md +++ b/docs/guide/publish.md @@ -4,7 +4,7 @@ Rye currently uses [build](https://github.com/pypa/build) to build the package a ## Build -By default, `rye` will build the both sdist and wheel target in the `dist` directory. +By default, `rye` will build the both sdist and wheel target in the `dist` directory. The command for this is called [`build`](commands/build.md). ``` rye build diff --git a/docs/guide/tools.md b/docs/guide/tools.md index 421153630c..79f8a3b573 100644 --- a/docs/guide/tools.md +++ b/docs/guide/tools.md @@ -5,8 +5,8 @@ tools like `black` or `ruff` globally. ## Installing Tools -Use the `rye tools install` (aliased to `rye install`) command to install a tool -globally with a shim: +Use the [`rye tools install`](commands/tools/install.md) (aliased to [`rye +install`](commands/install.md)) command to install a tool globally with a shim: ```bash rye install ruff diff --git a/mkdocs.yml b/mkdocs.yml index ade8290ace..24970dfa10 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -12,9 +12,45 @@ nav: - Installation: guide/installation.md - Basics: guide/basics.md - Configuration: guide/config.md - - Shims: guide/shims.md - Python Project: guide/pyproject.md - Syncing and Locking: guide/sync.md + - Commands: + - Overview: guide/commands/index.md + - add: guide/commands/add.md + - build: guide/commands/build.md + - config: guide/commands/config.md + - fetch: guide/commands/fetch.md + - fmt: guide/commands/fmt.md + - init: guide/commands/init.md + - install: guide/commands/install.md + - lock: guide/commands/lock.md + - lint: guide/commands/lint.md + - make-req: guide/commands/make-req.md + - pin: guide/commands/pin.md + - publish: guide/commands/publish.md + - remove: guide/commands/remove.md + - run: guide/commands/run.md + - shell: guide/commands/shell.md + - show: guide/commands/show.md + - sync: guide/commands/sync.md + - toolchain: + - Overview: guide/commands/toolchain/index.md + - fetch: guide/commands/toolchain/fetch.md + - list: guide/commands/toolchain/list.md + - register: guide/commands/toolchain/register.md + - remove: guide/commands/toolchain/remove.md + - tools: + - Overview: guide/commands/tools/index.md + - install: guide/commands/tools/install.md + - uninstall: guide/commands/tools/uninstall.md + - self: + - Overview: guide/commands/self/index.md + - completion: guide/commands/self/completion.md + - update: guide/commands/self/update.md + - uninstall: guide/commands/self/uninstall.md + - uninstall: guide/commands/uninstall.md + - version: guide/commands/version.md + - Shims: guide/shims.md - Building and Publishing: guide/publish.md - Rust Modules: guide/rust.md - Dependency Sources: guide/sources.md diff --git a/pyproject.toml b/pyproject.toml index c9d82164c9..216cc60c51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "rye-dev" -version = "0.1.0" +version = "1.0.0" description = "Workspace for rye development" authors = [{ name = "Armin Ronacher", email = "armin.ronacher@active-4.com" }] dependencies = [ diff --git a/rye/src/cli/lint.rs b/rye/src/cli/lint.rs index 415b9739d9..4105800c92 100644 --- a/rye/src/cli/lint.rs +++ b/rye/src/cli/lint.rs @@ -15,7 +15,7 @@ use crate::utils::{CommandOutput, QuietExit}; /// This invokes ruff in lint mode. #[derive(Parser, Debug)] pub struct Args { - /// Linter all packages + /// Lint all packages #[arg(short, long)] all: bool, /// Lint a specific package diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index e04dfa7bc5..659c0844ce 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -59,8 +59,8 @@ pub struct CompletionCommand { /// Performs an update of rye. /// -/// This currently just is an alias to running cargo install again with the -/// right arguments. +/// This can install updates from the latest release binaries or trigger a manual +/// compilation of Rye if Rust is installed. #[derive(Parser, Debug)] pub struct UpdateCommand { /// Update to a specific version. From 2134ce3842be92ac197d70ebe6c728402fb07049 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 22 Jan 2024 20:06:55 +0100 Subject: [PATCH 070/166] Slightly improved user guide --- docs/guide/config.md | 2 ++ docs/guide/deps.md | 6 +++--- docs/guide/pyproject.md | 2 +- mkdocs.yml | 14 +++++++------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/guide/config.md b/docs/guide/config.md index 62797a5195..58608acc77 100644 --- a/docs/guide/config.md +++ b/docs/guide/config.md @@ -101,6 +101,8 @@ rye config --set-bool behavior.force-rye-managed=true rye config --get default.requires-python ``` +For more information see [`config`](commands/config.md). + ## Per Project Config For the project specific `pyproject.toml` config see [pyproject.toml](pyproject.md). diff --git a/docs/guide/deps.md b/docs/guide/deps.md index db37a236c1..a586d47a25 100644 --- a/docs/guide/deps.md +++ b/docs/guide/deps.md @@ -1,12 +1,12 @@ # Dependencies Dependencies are declared in [pyproject.toml](pyproject.md) however adding them can be -simplified with the `rye add` command. In the most simple invocation it adds a regular +simplified with the [`rye add`](commands/add.md) command. In the most simple invocation it adds a regular dependency, but it can be customized. ## Adding Basic Dependency -To add a regular dependency just invoke `rye add` with the name of the Python package: +To add a regular dependency just invoke [`rye add`](commands/add.md) with the name of the Python package: ``` rye add Flask @@ -49,7 +49,7 @@ rye add --dev black These dependencies are stored in the non-standard [`tool.rye.dev-dependencies`](pyproject.md#toolryedev-dependencies) key. -To run tools added this way without enabling the virtualenv use `rye run`: +To run tools added this way without enabling the virtualenv use [`rye run`](commands/run.md): ``` rye run black diff --git a/docs/guide/pyproject.md b/docs/guide/pyproject.md index a5a11762b9..21ea362cdd 100644 --- a/docs/guide/pyproject.md +++ b/docs/guide/pyproject.md @@ -30,7 +30,7 @@ my-hello-script = 'hello:main' This configuration will generate a script `my-hello-script` that will call the `main` function of the `hello` module. -Scripts can be installed using `rye sync` and run using `rye run`: +Scripts can be installed using [`rye sync`](commands/sync.md) and run using [`rye run`](commands/run.md): ```bash $ rye sync diff --git a/mkdocs.yml b/mkdocs.yml index 24970dfa10..c2ebcfe45c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,6 +14,13 @@ nav: - Configuration: guide/config.md - Python Project: guide/pyproject.md - Syncing and Locking: guide/sync.md + - Shims: guide/shims.md + - Building and Publishing: guide/publish.md + - Rust Modules: guide/rust.md + - Dependency Sources: guide/sources.md + - Dependencies: guide/deps.md + - Workspaces: guide/workspaces.md + - Virtual Projects: guide/virtual.md - Commands: - Overview: guide/commands/index.md - add: guide/commands/add.md @@ -50,13 +57,6 @@ nav: - uninstall: guide/commands/self/uninstall.md - uninstall: guide/commands/uninstall.md - version: guide/commands/version.md - - Shims: guide/shims.md - - Building and Publishing: guide/publish.md - - Rust Modules: guide/rust.md - - Dependency Sources: guide/sources.md - - Dependencies: guide/deps.md - - Workspaces: guide/workspaces.md - - Virtual Projects: guide/virtual.md - Toolchains: - guide/toolchains/index.md - Portable CPython: guide/toolchains/cpython.md From 7ba259825abb3760ddf71ea2e460f7c14847c76a Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 22 Jan 2024 20:09:22 +0100 Subject: [PATCH 071/166] Fix link --- docs/guide/commands/fetch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/commands/fetch.md b/docs/guide/commands/fetch.md index ad9bba1cdf..06fa3b740b 100644 --- a/docs/guide/commands/fetch.md +++ b/docs/guide/commands/fetch.md @@ -2,7 +2,7 @@ Uninstalls Rye again. -For more information see [Uninstalling](../install.md#uninstalling) +For more information see [Uninstalling](/guide/installation/#uninstalling). ## Example From f7a0e196beb27a6207ebf407af59293f5468cd49 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 22 Jan 2024 20:10:57 +0100 Subject: [PATCH 072/166] Link ruff docs --- docs/guide/commands/fmt.md | 3 +++ docs/guide/commands/lint.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/guide/commands/fmt.md b/docs/guide/commands/fmt.md index e5897b0c11..f0a1f9560b 100644 --- a/docs/guide/commands/fmt.md +++ b/docs/guide/commands/fmt.md @@ -4,6 +4,9 @@ Run the code formatter on the project. This command is aliased to `format`. +For more information about how to configure Ruff, have a look at the +[Ruff Configuration Documentation](https://docs.astral.sh/ruff/configuration/). + ## Example To format the code and write back to the files: diff --git a/docs/guide/commands/lint.md b/docs/guide/commands/lint.md index db20fb27bd..1fd7588533 100644 --- a/docs/guide/commands/lint.md +++ b/docs/guide/commands/lint.md @@ -5,6 +5,9 @@ Run the linter on the project. This command is aliased to `check`. At the moment this always runs `ruff` in lint mode. +For more information about how to configure Ruff, have a look at the +[Ruff Configuration Documentation](https://docs.astral.sh/ruff/configuration/). + ## Example Run the linter: From f9822267a7f00332d15be8551f89a212e7bc9017 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 22 Jan 2024 21:35:39 +0100 Subject: [PATCH 073/166] Feature list on the front page --- docs/index.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/index.md b/docs/index.md index 37a177c8fd..50c6d1cbb1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,19 +3,28 @@ hide: - navigation --- -# Rye: An Experimental Package Management Solution for Python +# Rye: A New Kind Of Package Management Solution for Python Rye is a project and package management solution for Python, created by [Armin](https://github.com/mitsuhiko/). It came out of his desire to create a -one-stop-shop for all Python needs. It installs and manages Python +one-stop-shop for all Python needs. It installs and manages Python installations, manages `pyproject.toml` files, installs and uninstalls -dependencies, manages virtualenvs behind the scenes. It supports monorepos and +dependencies, manages virtualenvs behind the scenes. It supports monorepos, global tool installations. Rye is an experimental endeavour to build a new type of packaging experience to Python inspired by `rustup` and `cargo` from Rust. Please give it a try. Feedback and suggestions are greatly appreciated. +**What it does:** + +* Download and manage Python interpreters +* Manage Projects +* Manage your dependencies via [pip-tools](https://github.com/jazzband/pip-tools) +* [Manage your virtualenvs](guide/sync.md) +* Simple way to [invoke scripts](guide/pyproject.md#toolryescripts) +* Lint and format via [Ruff](https://astral.sh/ruff) +

Star From 0da12c42d3e0ec0166547fb70019a68ea3c87eba Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 25 Jan 2024 23:10:57 +0100 Subject: [PATCH 074/166] Fix fetch docs Fixes #557 --- docs/guide/commands/fetch.md | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/docs/guide/commands/fetch.md b/docs/guide/commands/fetch.md index 06fa3b740b..37d20bf909 100644 --- a/docs/guide/commands/fetch.md +++ b/docs/guide/commands/fetch.md @@ -1,23 +1,42 @@ -# `uninstall` +# `fetch` -Uninstalls Rye again. - -For more information see [Uninstalling](/guide/installation/#uninstalling). +Fetches a Python interpreter for the local machine. This command is +available under the aliases `rye fetch` and `rye toolchain fetch`. ## Example -Uninstall Rye: +Fetch a specific version of Python: + +``` +$ rye fetch 3.8.13 +Downloading cpython@3.8.13 +Checking checksum +success: Downloaded cpython@3.8.13 +``` + +To fetch the pinned verison of Python you can leave out the argument: ``` -$ rye self uninstall +$ rye fetch +Downloading cpython@3.8.17 +Checking checksum +success: Downloaded cpython@3.8.17 ``` ## Arguments -*no arguments* +* `[VERSION]`: The version of Python to fetch. + + If no version is provided, the requested version will be fetched. +* `[ARCH]`: Overrides the architecture to fetch. + + When a non native architecture is fetched, the toolchain is installed under an alias. + ## Options -* `-y, --yes`: Skip safety check +* `-v, --verbose`: Enables verbose diagnostics + +* `-q, --quiet`: Turns off all output * `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file From 002030991d6bec8f9a89479f6feacee5b413ad87 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 25 Jan 2024 23:14:26 +0100 Subject: [PATCH 075/166] Fix typo --- docs/guide/commands/fetch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/commands/fetch.md b/docs/guide/commands/fetch.md index 37d20bf909..625694640d 100644 --- a/docs/guide/commands/fetch.md +++ b/docs/guide/commands/fetch.md @@ -14,7 +14,7 @@ Checking checksum success: Downloaded cpython@3.8.13 ``` -To fetch the pinned verison of Python you can leave out the argument: +To fetch the pinned version of Python you can leave out the argument: ``` $ rye fetch From 9773bebd1637b1ec6c32e0b81798c4e50dd019eb Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 29 Jan 2024 00:05:35 +0100 Subject: [PATCH 076/166] Update dependencies (#563) --- Cargo.lock | 1178 ++++++++++++++++++++++-------------------- rye/Cargo.toml | 16 +- rye/src/pyproject.rs | 25 +- 3 files changed, 650 insertions(+), 569 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 58d6d3aea0..e678b298d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -29,9 +29,9 @@ dependencies = [ [[package]] name = "age" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9e4dfef09bebad6d85efa8b6e1b2f7a809c4419d7135ab573c4fd133c0e8ead" +checksum = "6d55a4d912c80a92762ffd1c884065f3f9646467d22c95390e824a0ff7def472" dependencies = [ "age-core", "base64 0.13.1", @@ -74,44 +74,42 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ - "getrandom 0.2.9", + "cfg-if", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] -name = "aho-corasick" -version = "1.0.1" +name = "allocator-api2" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" -dependencies = [ - "memchr", -] +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" dependencies = [ "backtrace", ] @@ -130,15 +128,15 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide 0.6.2", + "miniz_oxide", "object", "rustc-demangle", ] @@ -151,9 +149,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bech32" @@ -167,6 +165,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + [[package]] name = "block-buffer" version = "0.10.4" @@ -178,19 +182,25 @@ dependencies = [ [[package]] name = "bstr" -version = "1.4.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", "serde", ] +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bzip2" @@ -215,11 +225,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -275,9 +286,9 @@ dependencies = [ [[package]] name = "chumsky" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23170228b96236b5a7299057ac284a321457700bc8c41a4476052f0f4ba5349d" +checksum = "8eebd66744a15ded14960ab4ccdbfb51ad3b81f51f3f04a80adac98c985396c9" dependencies = [ "hashbrown", "stacker", @@ -296,71 +307,69 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.5" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2686c4115cb0810d9a984776e197823d08ec94f176549a89a9efded477c456dc" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.5" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e53afce1efce6ed1f633cf0e57612fe51db54a1ee4fd8f8503d078fe02d69ae" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstyle", - "bitflags", "clap_lex", "terminal_size", ] [[package]] name = "clap_complete" -version = "4.2.3" +version = "4.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1594fe2312ec4abf402076e407628f5c313e54c32ade058521df4ee34ecac8a8" +checksum = "df631ae429f6613fcd3a7c1adbdb65f637271e561b03680adaa6573015dfb106" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.48", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "configparser" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5458d9d1a587efaf5091602c59d299696a3877a439c8f6d461a2d3cce11df87a" +checksum = "4ec6d3da8e550377a85339063af6e3735f4b1d9392108da4e083a1b3b9820288" [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -371,15 +380,15 @@ checksum = "396de984970346b0d9e93d1415082923c679e5ae5c3ee3dcbd104f5610af126b" [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -393,48 +402,30 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crypto-common" @@ -463,9 +454,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.67+curl-8.3.0" +version = "0.4.70+curl-8.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc35d066510b197a0f72de863736641539957628c8a42e70e27c66849e77c34" +checksum = "3c0333d8849afe78a4c8102a429a446bfdd055832af071945520e835ae2d841e" dependencies = [ "cc", "libc", @@ -526,9 +517,9 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.4.0" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", "hashbrown", @@ -539,9 +530,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "decompress" @@ -556,7 +547,16 @@ dependencies = [ "regex", "tar", "thiserror", - "zstd", + "zstd 0.12.4", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", ] [[package]] @@ -592,9 +592,9 @@ dependencies = [ [[package]] name = "deunicode" -version = "0.4.3" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" +checksum = "3ae2a35373c5c74340b79ae6780b498b2b183915ec5dacf263aac5a099bf485a" [[package]] name = "dialoguer" @@ -619,9 +619,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -636,14 +636,14 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.48", ] [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encode_unicode" @@ -653,32 +653,27 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] [[package]] -name = "errno" -version = "0.3.1" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "errno" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -690,16 +685,22 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + [[package]] name = "filetime" -version = "0.2.21" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", - "windows-sys 0.48.0", + "redox_syscall", + "windows-sys 0.52.0", ] [[package]] @@ -713,12 +714,12 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", - "miniz_oxide 0.7.1", + "miniz_oxide", ] [[package]] @@ -742,7 +743,7 @@ dependencies = [ "intl-memoizer", "intl_pluralrules", "rustc-hash", - "self_cell", + "self_cell 0.10.3", "smallvec", "unic-langid", ] @@ -773,18 +774,31 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "fs-err" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] [[package]] name = "generic-array" @@ -809,9 +823,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -820,53 +834,53 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.2" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "git-testament" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "986bf57c808270f3a0a0652c3bfce0f5d667aa5f5b465616dc697c7f390834b1" +checksum = "710c78d2b68e46e62f5ba63ba0a7a2986640f37f9ecc07903b9ad4e7b2dbfc8e" dependencies = [ "git-testament-derive", - "no-std-compat", ] [[package]] name = "git-testament-derive" -version = "0.1.14" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a782db5866c7ab75f3552dda4cbf34e3e257cc64c963c6ed5af1e12818e8ae6" +checksum = "9b31494efbbe1a6730f6943759c21b92c8dc431cb4df177e6f2a6429c3c96842" dependencies = [ "log", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", "time", ] [[package]] name = "globset" -version = "0.4.10" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ - "aho-corasick 0.7.20", + "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata", + "regex-syntax", ] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -875,12 +889,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - [[package]] name = "hex" version = "0.4.3" @@ -889,9 +897,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac", ] @@ -902,7 +910,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -916,23 +924,23 @@ dependencies = [ [[package]] name = "i18n-config" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d9f93ceee6543011739bc81699b5e0cf1f23f3a80364649b6d80de8636bc8df" +checksum = "0c9ce3c48cbc21fd5b22b9331f32b5b51f6ad85d969b99e793427332e76e7640" dependencies = [ "log", "serde", "serde_derive", "thiserror", - "toml 0.5.11", + "toml 0.8.8", "unic-langid", ] [[package]] name = "i18n-embed" -version = "0.13.8" +version = "0.13.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2653dd1a8be0726315603f1c180b29f90e5b2a58f8b943d949d5170d9ad81101" +checksum = "92a86226a7a16632de6723449ee5fe70bac5af718bc642ee9ca2f0f6e14fa1fa" dependencies = [ "arc-swap", "fluent", @@ -951,9 +959,9 @@ dependencies = [ [[package]] name = "i18n-embed-fl" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b5809e2295beeb55013705c3b947cbbe83b8cadf3c73a1e6dca06381927212a" +checksum = "d26a3d3569737dfaac7fc1c4078e6af07471c3060b8e570bcd83cdd5f4685395" dependencies = [ "dashmap", "find-crate", @@ -966,21 +974,21 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 1.0.109", + "syn 2.0.48", "unic-langid", ] [[package]] name = "i18n-embed-impl" -version = "0.8.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0db2330e035808eb064afb67e6743ddce353763af3e0f2bdfc2476e00ce76136" +checksum = "81093c4701672f59416582fe3145676126fd23ba5db910acad0793c1108aaa58" dependencies = [ "find-crate", "i18n-config", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -991,9 +999,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1001,23 +1009,24 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "cf2a4f498956c7723dc280afc6a37d0dec50b39a29e232c6187ce4503703e8c2" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] [[package]] name = "indicatif" -version = "0.17.3" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" dependencies = [ "console", + "instant", "number_prefix", - "portable-atomic 0.3.20", + "portable-atomic", "unicode-width", ] @@ -1067,17 +1076,6 @@ dependencies = [ "unic-langid", ] -[[package]] -name = "io-lifetimes" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "io_tee" version = "0.1.1" @@ -1086,15 +1084,15 @@ checksum = "4b3f7cef34251886990511df1c61443aa928499d598a9473929ab5a90a527304" [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] @@ -1117,15 +1115,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.144" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libz-sys" -version = "1.1.9" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ee889ecc9568871456d42f603d6a0ce59ff328d291063a45cbdf0036baf6db" +checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" dependencies = [ "cc", "libc", @@ -1135,9 +1133,9 @@ dependencies = [ [[package]] name = "license" -version = "3.1.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66615d42e949152327c402e03cd29dab8bff91ce470381ac2ca6d380d8d9946" +checksum = "778718185117620a06e95d2b1e57d50166b1d6bfad93c8abfc1b3344c863ad8c" dependencies = [ "reword", "serde", @@ -1146,15 +1144,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.3.7" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1162,44 +1160,32 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "mailparse" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b56570f5f8c0047260d1c8b5b331f62eb9c660b9dd4071a8c46f8c7d3f280aa" +checksum = "2d096594926cab442e054e047eb8c1402f7d5b2272573b97ba68aa40629f9757" dependencies = [ "charset", "data-encoding", - "quoted_printable", + "quoted_printable 0.5.0", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "minijinja" -version = "1.0.5" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f75e6f2b03d9292f6e18aaeeda21d58c91f6943a58ea19a2e8672dcf9d91d5b" +checksum = "6fe0ff215195a22884d867b547c70a0c4815cbbcc70991f281dca604b20d10ce" dependencies = [ "serde", "serde_json", @@ -1211,15 +1197,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -1232,36 +1209,38 @@ dependencies = [ [[package]] name = "monotrail-utils" version = "0.0.1" -source = "git+https://github.com/konstin/poc-monotrail#596c51ed1955ada7117b09b526eba6140cbdc288" +source = "git+https://github.com/konstin/poc-monotrail#9d3892a57ecc117d35f084870e5d4e74fc39a240" dependencies = [ "anyhow", + "cpufeatures", "fs-err", + "fs2", "pep508_rs", + "regex", "serde", "serde_json", - "toml 0.7.3", + "tar", + "target-lexicon", + "tempfile", + "thiserror", + "toml 0.8.8", "tracing", "unscanny", + "ureq", + "zstd 0.12.4", ] [[package]] name = "nix" -version = "0.26.2" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags", + "bitflags 2.4.2", "cfg-if", "libc", - "static_assertions", ] -[[package]] -name = "no-std-compat" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" - [[package]] name = "nom" version = "7.1.3" @@ -1281,16 +1260,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "number_prefix" version = "0.4.0" @@ -1299,18 +1268,18 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.30.3" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.17.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -1326,18 +1295,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.25.3+1.1.1t" +version = "300.2.1+3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924757a6a226bf60da5f7dd0311a34d2b52283dd82ddeb103208ddc66362f80c" +checksum = "3fe476c29791a5ca0d1273c697e96085bbabbbea2ef7afd5617e78a4b40332d3" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.87" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -1358,15 +1327,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall", "smallvec", - "windows-sys 0.45.0", + "windows-targets 0.48.5", ] [[package]] @@ -1381,27 +1350,26 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] name = "pep440_rs" -version = "0.3.9" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe1d15693a11422cfa7d401b00dc9ae9fb8edbfbcb711a77130663f4ddf67650" +checksum = "887f66cc62717ea72caac4f1eb4e6f392224da3ffff3f40ec13ab427802746d6" dependencies = [ "lazy_static", "regex", "serde", - "tracing", "unicode-width", ] [[package]] name = "pep508_rs" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0713d7bb861ca2b7d4c50a38e1f31a4b63a2e2df35ef1e5855cc29e108453e2" +checksum = "e4516b53d9ea6112ebb38b4af08d5707d30b994fb7f98ff133c5dcf7ed8fa854" dependencies = [ "once_cell", "pep440_rs", @@ -1415,41 +1383,41 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "poly1305" @@ -1464,18 +1432,15 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "0.3.20" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" -dependencies = [ - "portable-atomic 1.3.2", -] +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] -name = "portable-atomic" -version = "1.3.2" +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc59d1bcc64fc5d021d67521f818db868368028108d37f0e98d74e33f68297b5" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" @@ -1509,9 +1474,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -1527,9 +1492,9 @@ dependencies = [ [[package]] name = "python-pkginfo" -version = "0.5.6" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e23988cc0f9fbe3c42ae6e399daa7c0273d6013784b744b1742c6e1060611b0e" +checksum = "037469c164f08c891bf6d69ca02f1d56210011451e229618669777df82124cfa" dependencies = [ "flate2", "fs-err", @@ -1543,9 +1508,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1556,6 +1521,12 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3866219251662ec3b26fc217e3e05bf9c4f84325234dfb96bf0bf840889e49" +[[package]] +name = "quoted_printable" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79ec282e887b434b68c18fe5c121d38e72a5cf35119b59e54ec5b992ea9c8eb0" + [[package]] name = "rand" version = "0.7.3" @@ -1615,7 +1586,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.9", + "getrandom 0.2.12", ] [[package]] @@ -1629,9 +1600,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -1639,41 +1610,30 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.9.1" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ - "aho-corasick 1.0.1", + "aho-corasick", "memchr", "regex-automata", "regex-syntax", @@ -1681,20 +1641,20 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ - "aho-corasick 1.0.1", + "aho-corasick", "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reword" @@ -1711,19 +1671,33 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61fc4b4e52897c3e30b12b7e9b04461215b647fbe66f6def60dd8edbce14ec2e" dependencies = [ - "base64 0.21.2", + "base64 0.21.7", "charset", "chumsky", "memchr", - "quoted_printable", + "quoted_printable 0.4.8", "thiserror", ] +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom 0.2.12", + "libc", + "spin", + "untrusted", + "windows-sys 0.48.0", +] + [[package]] name = "rust-embed" -version = "6.6.1" +version = "6.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b68543d5527e158213414a92832d2aab11a84d2571a5eb021ebe22c43aab066" +checksum = "a36224c3276f8c4ebc8c20f158eca7ca4359c8db89991c4925132aaaf6702661" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -1732,22 +1706,22 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "6.5.0" +version = "6.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4e0f0ced47ded9a68374ac145edd65a6c1fa13a96447b873660b2a568a0fd7" +checksum = "49b94b81e5b2c284684141a2fb9e2a31be90638caf040bf9afbc5a0416afe1ac" dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 1.0.109", + "syn 2.0.48", "walkdir", ] [[package]] name = "rust-embed-utils" -version = "7.5.0" +version = "7.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512b0ab6853f7e14e3c8754acb43d6f748bb9ced66aa5915a6553ac8213f7731" +checksum = "9d38ff6bf570dc3bb7100fce9f7b60c33fa71d80e88da3f2580df4ff2bdded74" dependencies = [ "sha2", "walkdir", @@ -1767,16 +1741,37 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.37.19" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags", + "bitflags 2.4.2", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", ] [[package]] @@ -1829,14 +1824,14 @@ dependencies = [ "winapi", "winreg", "zip", - "zstd", + "zstd 0.13.0", ] [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "salsa20" @@ -1858,18 +1853,18 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.42.0", + "windows-sys 0.52.0", ] [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scrypt" @@ -1883,6 +1878,16 @@ dependencies = [ "sha2", ] +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "secrecy" version = "0.8.0" @@ -1894,46 +1899,55 @@ dependencies = [ [[package]] name = "self-replace" -version = "1.3.5" +version = "1.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e7c919783db74b5995f13506069227e4721d388bea4a8ac3055acac864ac16" +checksum = "525db198616b2bcd0f245daf7bfd8130222f7ee6af9ff9984c19a61bf1160c55" dependencies = [ - "fastrand", + "fastrand 1.9.0", "tempfile", "windows-sys 0.48.0", ] [[package]] name = "self_cell" -version = "0.10.2" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14e4d63b804dc0c7ec4a1e52bcb63f02c7ac94476755aa579edac21e01f915d" +dependencies = [ + "self_cell 1.0.3", +] + +[[package]] +name = "self_cell" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ef965a420fe14fdac7dd018862966a4c14094f900e1650bbc71ddd7d580c8af" +checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" [[package]] name = "serde" -version = "1.0.163" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "4d1bd37ce2324cf3bf85e5a25f96eb4baf0d5aa6eba43e7ae8958870c4ec48ed" dependencies = [ "itoa", "ryu", @@ -1942,22 +1956,22 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -1968,35 +1982,42 @@ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] name = "shlex" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "slug" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373" +checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4" dependencies = [ "deunicode", + "wasm-bindgen", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "stacker" version = "0.1.15" @@ -2010,12 +2031,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strsim" version = "0.10.0" @@ -2024,9 +2039,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -2041,9 +2056,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -2052,9 +2067,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.29.9" +version = "0.29.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d0e9cc2273cc8d31377bdd638d72e3ac3e5607b18621062b169d02787f1bab" +checksum = "cd727fc423c2060f6c92d9534cef765c65a6ed3f428a03d7def74a8c4348e666" dependencies = [ "cfg-if", "core-foundation-sys", @@ -2067,33 +2082,39 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.38" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" dependencies = [ "filetime", "libc", "xattr", ] +[[package]] +name = "target-lexicon" +version = "0.12.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" + [[package]] name = "tempfile" -version = "3.5.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", - "fastrand", - "redox_syscall 0.3.5", + "fastrand 2.0.1", + "redox_syscall", "rustix", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] name = "terminal_size" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ "rustix", "windows-sys 0.48.0", @@ -2101,31 +2122,33 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.47" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.47" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.48", ] [[package]] name = "time" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ + "deranged", "itoa", + "powerfmt", "serde", "time-core", "time-macros", @@ -2133,24 +2156,24 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] [[package]] name = "tinystr" -version = "0.7.1" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ac3f5b6856e931e15e07b478e98c8045239829a65f9156d4fa7e7788197a5ef" +checksum = "83c02bf3c538ab32ba913408224323915f4ef9a6d61c0e85d493f355921c0ece" dependencies = [ "displaydoc", ] @@ -2181,9 +2204,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.3" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", @@ -2193,18 +2216,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.1" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.8" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ "indexmap", "serde", @@ -2215,11 +2238,10 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -2228,20 +2250,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.48", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -2257,24 +2279,24 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unic-langid" -version = "0.9.1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "398f9ad7239db44fd0f80fe068d12ff22d78354080332a5077dc6f52f14dcf2f" +checksum = "238722e6d794ed130f91f4ea33e01fcff4f188d92337a21297892521c72df516" dependencies = [ "unic-langid-impl", ] [[package]] name = "unic-langid-impl" -version = "0.9.1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35bfd2f2b8796545b55d7d3fd3e89a0613f68a0d1c8bc28cb7ff96b411a35ff" +checksum = "4bd55a2063fdea4ef1f8633243a7b0524cbeef1905ae04c31a1c9b9775c55bc6" dependencies = [ "serde", "tinystr", @@ -2282,15 +2304,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -2309,15 +2331,15 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "universal-hash" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3160b73c9a19f7e2939a2fdad446c57c1bbbbf4d919d3213ff1267a580d8b5" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", "subtle", @@ -2329,11 +2351,35 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9df2af067a7953e9c3831320f35c1cc0600c30d44d9f7a12b01db1cd88d6b47" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cdd25c339e200129fe4de81451814e5228c9b771d57378817d6117cc2b3f97" +dependencies = [ + "base64 0.21.7", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-webpki", + "serde", + "serde_json", + "url", + "webpki-roots", +] + [[package]] name = "url" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -2343,9 +2389,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.3.2" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dad5567ad0cf5b760e5665964bec1b47dfd077ba8a2544b513f3556d3d239a2" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" [[package]] name = "vcpkg" @@ -2361,9 +2407,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -2381,11 +2427,71 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasm-bindgen" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" + +[[package]] +name = "webpki-roots" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" + [[package]] name = "whattheshell" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d2a141eb1ec499706110282b3f2d2b44f28872b6efec92ee76e3b3fc900745d" +checksum = "7c94d2698698cb1322e20292460fd158373af5fb2802afb6bea9ee17628efddb" dependencies = [ "sysinfo", "thiserror", @@ -2393,13 +2499,15 @@ dependencies = [ [[package]] name = "which" -version = "4.4.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "7fa5e0c10bf77f44aac573e498d1a82d5fbd5e91f6fc0a99e7be4b38e85e101c" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix", + "windows-sys 0.52.0", ] [[package]] @@ -2420,9 +2528,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -2433,37 +2541,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -2477,32 +2561,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" -dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -2522,15 +2591,9 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" @@ -2540,15 +2603,9 @@ checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" @@ -2558,15 +2615,9 @@ checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" @@ -2576,15 +2627,9 @@ checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" @@ -2594,15 +2639,9 @@ checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" @@ -2612,15 +2651,9 @@ checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" @@ -2630,15 +2663,9 @@ checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" @@ -2648,18 +2675,18 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.4.6" +version = "0.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if", "windows-sys 0.48.0", @@ -2678,18 +2705,40 @@ dependencies = [ [[package]] name = "xattr" -version = "0.2.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -2702,14 +2751,14 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.48", ] [[package]] name = "zip" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e92305c174683d78035cbf1b70e18db6329cc0f1b9cae0a52ca90bf5bfe7125" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ "byteorder", "bzip2", @@ -2721,30 +2770,47 @@ dependencies = [ [[package]] name = "zstd" -version = "0.12.3+zstd.1.5.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" dependencies = [ - "zstd-safe", + "zstd-safe 6.0.6", +] + +[[package]] +name = "zstd" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" +dependencies = [ + "zstd-safe 7.0.0", ] [[package]] name = "zstd-safe" -version = "6.0.5+zstd.1.5.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" dependencies = [ "libc", "zstd-sys", ] +[[package]] +name = "zstd-safe" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" +dependencies = [ + "zstd-sys", +] + [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 2045ccdd75..9190141398 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -29,24 +29,24 @@ indicatif = "0.17.3" memchr = "2.5.0" license = { version = "3.1.1", features = ["offline"] } minijinja = { version = "1.0.0", features = ["json"] } -nix = { version = "0.26.2", default-features = false, features = ["process"] } +nix = { version = "0.27.1", default-features = false, features = ["process"] } once_cell = "1.17.1" pathdiff = "0.2.1" -pep440_rs = "0.3.9" +pep440_rs = "0.3.11" pep508_rs = "0.2.1" regex = "1.8.1" same-file = "1.0.6" serde = { version = "1.0.160", features = ["derive"] } serde_json = "1.0.94" -shlex = "1.1.0" +shlex = "1.3.0" slug = "0.1.4" tar = "0.4.38" tempfile = "3.5.0" -toml_edit = "0.19.8" +toml_edit = "0.21.0" url = "2.3.1" walkdir = "2.3.3" -which = "4.4.0" -zstd = "0.12.3" +which = "6.0.0" +zstd = "0.13.0" sha2 = "0.10.6" dialoguer = { git = "https://github.com/console-rs/dialoguer", rev = "47a9d4df729db7ffc1492bd0845be786e6f20153" } hex = "0.4.3" @@ -56,7 +56,7 @@ zip = { version = "0.6.5", features = ["deflate"], default-features = false } self-replace = "1.3.5" configparser = "3.0.2" monotrail-utils = { git = "https://github.com/konstin/poc-monotrail", version = "0.0.1" } -python-pkginfo = { version = "0.5.6", features = ["serde"] } +python-pkginfo = { version = "0.6.0", features = ["serde"] } sysinfo = { version = "0.29.4", default-features = false, features = [] } home = "0.5.9" @@ -65,4 +65,4 @@ whattheshell = "1.0.1" [target."cfg(windows)".dependencies] winapi = { version = "0.3.9", default-features = false, features = [] } -winreg = "0.51" +winreg = "0.52.0" diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index 64e0c40607..290751d100 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -271,18 +271,28 @@ impl Script { } } +/// Unsafe form of [`shlex::try_quote`] for display only. +fn shlex_quote_unsafe(s: &str) -> Cow<'_, str> { + shlex::Quoter::new().allow_nul(true).quote(s).unwrap() +} + impl fmt::Display for Script { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Script::Call(entry, env) => { - write!(f, "{}", shlex::quote(entry))?; + write!(f, "{}", shlex_quote_unsafe(entry))?; if !env.is_empty() { write!(f, " (env: ")?; for (idx, (key, value)) in env.iter().enumerate() { if idx > 0 { write!(f, " ")?; } - write!(f, "{}={}", shlex::quote(key), shlex::quote(value))?; + write!( + f, + "{}={}", + shlex_quote_unsafe(key), + shlex_quote_unsafe(value) + )?; } write!(f, ")")?; } @@ -294,14 +304,19 @@ impl fmt::Display for Script { if need_space { write!(f, " ")?; } - write!(f, "{}={}", shlex::quote(key), shlex::quote(value))?; + write!( + f, + "{}={}", + shlex_quote_unsafe(key), + shlex_quote_unsafe(value) + )?; need_space = true; } for arg in args.iter() { if need_space { write!(f, " ")?; } - write!(f, "{}", shlex::quote(arg))?; + write!(f, "{}", shlex_quote_unsafe(arg))?; need_space = true; } Ok(()) @@ -317,7 +332,7 @@ impl fmt::Display for Script { if idx > 0 { write!(f, " ")?; } - write!(f, "{}", shlex::quote(arg))?; + write!(f, "{}", shlex_quote_unsafe(arg))?; } write!(f, "]")?; } From 5bc9f4915da1e20e7c8274bb74f6c577e55807ee Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 29 Jan 2024 00:29:18 +0100 Subject: [PATCH 077/166] Explicitly handle ctrl-c to restore cursor (#564) --- CHANGELOG.md | 3 +++ Cargo.lock | 11 +++++++++++ rye/Cargo.toml | 1 + rye/src/main.rs | 20 ++++++++++++++++++++ rye/src/utils/mod.rs | 16 +++------------- 5 files changed, 38 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 986afdfe2b..e4e36ad58d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ _Unreleased_ - Added `rye fmt` and `rye lint` commands to format and lint with the help of Ruff. #555 +- Restore cursor state on Ctrl-C. This fixes some issues where in rare cases the + cursor would disappear even after shutting down rye. #564 + ## 0.19.0 diff --git a/Cargo.lock b/Cargo.lock index e678b298d6..8aa6be240c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -437,6 +437,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "ctrlc" +version = "3.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b467862cc8610ca6fc9a1532d7777cee0804e678ab45410897b9396495994a0b" +dependencies = [ + "nix", + "windows-sys 0.52.0", +] + [[package]] name = "curl" version = "0.4.44" @@ -1785,6 +1795,7 @@ dependencies = [ "clap_complete", "configparser", "console", + "ctrlc", "curl", "decompress", "dialoguer", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 9190141398..ea4ac2a7f7 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -59,6 +59,7 @@ monotrail-utils = { git = "https://github.com/konstin/poc-monotrail", version = python-pkginfo = { version = "0.6.0", features = ["serde"] } sysinfo = { version = "0.29.4", default-features = false, features = [] } home = "0.5.9" +ctrlc = "3.4.2" [target."cfg(unix)".dependencies] whattheshell = "1.0.1" diff --git a/rye/src/main.rs b/rye/src/main.rs index cc1096430a..40499e7733 100644 --- a/rye/src/main.rs +++ b/rye/src/main.rs @@ -20,13 +20,33 @@ mod sync; mod utils; static SHOW_CONTINUE_PROMPT: AtomicBool = AtomicBool::new(false); +static DISABLE_CTRLC_HANDLER: AtomicBool = AtomicBool::new(false); /// Changes the shutdown behavior to request a continue prompt. pub fn request_continue_prompt() { SHOW_CONTINUE_PROMPT.store(true, Ordering::Relaxed); } +/// Disables the ctrl-c handler +pub fn disable_ctrlc_handler() { + DISABLE_CTRLC_HANDLER.store(true, Ordering::Relaxed); +} + pub fn main() { + ctrlc::set_handler(move || { + if !DISABLE_CTRLC_HANDLER.load(Ordering::Relaxed) { + let term = console::Term::stderr(); + term.show_cursor().ok(); + term.flush().ok(); + std::process::exit(if cfg!(windows) { + 0xC000013Au32 as i32 + } else { + 130 + }); + } + }) + .unwrap(); + let result = cli::execute(); let status = match result { Ok(()) => 0, diff --git a/rye/src/utils/mod.rs b/rye/src/utils/mod.rs index d78c4520df..57fd275e0e 100644 --- a/rye/src/utils/mod.rs +++ b/rye/src/utils/mod.rs @@ -262,6 +262,9 @@ pub fn unpack_archive(contents: &[u8], dst: &Path, strip_components: usize) -> R /// Spawns a command exec style. pub fn exec_spawn(cmd: &mut Command) -> Result { + // this is technically only necessary on windows + crate::disable_ctrlc_handler(); + #[cfg(unix)] { use std::os::unix::process::CommandExt; @@ -270,19 +273,6 @@ pub fn exec_spawn(cmd: &mut Command) -> Result { } #[cfg(windows)] { - use winapi::shared::minwindef::{BOOL, DWORD, FALSE, TRUE}; - use winapi::um::consoleapi::SetConsoleCtrlHandler; - - unsafe extern "system" fn ctrlc_handler(_: DWORD) -> BOOL { - // Do nothing. Let the child process handle it. - TRUE - } - unsafe { - if SetConsoleCtrlHandler(Some(ctrlc_handler), TRUE) == FALSE { - return Err(anyhow!("unable to set console handler")); - } - } - cmd.stdin(Stdio::inherit()); let status = cmd.status()?; std::process::exit(status.code().unwrap()) From bdd750f9d03bc70b8185173eb025365c0b9253b5 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 29 Jan 2024 08:46:41 +0100 Subject: [PATCH 078/166] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4e36ad58d..116be8bbaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,8 @@ _Unreleased_ - Restore cursor state on Ctrl-C. This fixes some issues where in rare cases the cursor would disappear even after shutting down rye. #564 +- Upon installation Rye now prompts if global shims should be enabled. #566 + ## 0.19.0 From 92931c3ca01311942a529af7399e4d5468043e83 Mon Sep 17 00:00:00 2001 From: Jo <10510431+j178@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:50:07 +0800 Subject: [PATCH 079/166] Reuse `consts::VENV_BIN` (#565) --- rye/src/cli/shell.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/rye/src/cli/shell.rs b/rye/src/cli/shell.rs index cc125ca37a..b802492b70 100644 --- a/rye/src/cli/shell.rs +++ b/rye/src/cli/shell.rs @@ -8,6 +8,7 @@ use clap::Parser; use console::style; use sysinfo::{Pid, PidExt, ProcessExt, System, SystemExt}; +use crate::consts; use crate::pyproject::PyProject; use crate::sync::{sync, SyncOptions}; use crate::tui::redirect_to_stderr; @@ -68,11 +69,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { .context("failed to sync ahead of shell")?; let venv_path = pyproject.venv_path(); - let venv_bin = if env::consts::OS == "windows" { - venv_path.join("Scripts") - } else { - venv_path.join("bin") - }; + let venv_bin = venv_path.join(consts::VENV_BIN); let s = get_shell()?; let sep = if is_ms_shells(s.as_str()) { ";" } else { ":" }; From 3923183f6db1330483244586f541456df8f3822b Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 29 Jan 2024 08:50:43 +0100 Subject: [PATCH 080/166] Change the installation wizard to prompt about global shims (#566) --- rye/src/cli/publish.rs | 6 +++--- rye/src/cli/rye.rs | 30 +++++++++++++++++++++++++++--- rye/src/utils/mod.rs | 7 +++++++ 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/rye/src/cli/publish.rs b/rye/src/cli/publish.rs index 0972e51c52..45bc4756e2 100644 --- a/rye/src/cli/publish.rs +++ b/rye/src/cli/publish.rs @@ -14,7 +14,7 @@ use url::Url; use crate::bootstrap::ensure_self_venv; use crate::platform::{get_credentials, write_credentials}; use crate::pyproject::PyProject; -use crate::utils::{escape_string, get_venv_python_bin, CommandOutput}; +use crate::utils::{escape_string, get_venv_python_bin, tui_theme, CommandOutput}; /// Publish packages to a package repository. #[derive(Parser, Debug)] @@ -190,7 +190,7 @@ fn prompt_for_token() -> Result { fn maybe_encrypt(secret: &Secret, yes: bool) -> Result>, Error> { let phrase = if !yes { - dialoguer::Password::new() + dialoguer::Password::with_theme(tui_theme()) .with_prompt("Encrypt with passphrase (optional)") .allow_empty_password(true) .report(false) @@ -218,7 +218,7 @@ fn maybe_encrypt(secret: &Secret, yes: bool) -> Result>, fn maybe_decrypt(secret: &Secret, yes: bool) -> Result, Error> { let phrase = if !yes { - dialoguer::Password::new() + dialoguer::Password::with_theme(tui_theme()) .with_prompt("Decrypt with passphrase (optional)") .allow_empty_password(true) .report(false) diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index 659c0844ce..b3ed51bb49 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -3,6 +3,7 @@ use std::env::consts::{ARCH, EXE_EXTENSION, OS}; use std::env::{join_paths, split_paths}; use std::path::{Path, PathBuf}; use std::process::Command; +use std::sync::Arc; use std::{env, fs}; use anyhow::{bail, Context, Error}; @@ -18,8 +19,9 @@ use crate::bootstrap::{ update_core_shims, }; use crate::cli::toolchain::register_toolchain; +use crate::config::Config; use crate::platform::{get_app_dir, symlinks_supported}; -use crate::utils::{check_checksum, CommandOutput, QuietExit}; +use crate::utils::{check_checksum, tui_theme, CommandOutput, QuietExit}; #[cfg(windows)] const DEFAULT_HOME: &str = "%USERPROFILE%\\.rye"; @@ -268,7 +270,7 @@ fn remove_dir_all_if_exists(path: &Path) -> Result<(), Error> { fn uninstall(args: UninstallCommand) -> Result<(), Error> { if !args.yes - && !dialoguer::Confirm::new() + && !dialoguer::Confirm::with_theme(tui_theme()) .with_prompt("Do you want to uninstall rye?") .interact()? { @@ -341,6 +343,8 @@ fn is_fish() -> bool { } fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<(), Error> { + let mut config = Config::current(); + let config_doc = Arc::make_mut(&mut config).doc_mut(); let exe = env::current_exe()?; let app_dir = get_app_dir(); let shims = app_dir.join("shims"); @@ -386,7 +390,7 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( echo!(); if !matches!(mode, InstallMode::NoPrompts) - && !dialoguer::Confirm::new() + && !dialoguer::Confirm::with_theme(tui_theme()) .with_prompt("Continue?") .interact()? { @@ -394,6 +398,24 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( return Err(QuietExit(1).into()); } + // If the global-python flag is not in the settings, ask the user if they want to turn + // on global shims upon installation. + if config_doc + .get("behavior") + .and_then(|x| x.get("global-python")) + .is_none() + && (matches!(mode, InstallMode::NoPrompts) + || dialoguer::Select::with_theme(tui_theme()) + .with_prompt("Determine Rye's python Shim behavior outside of Rye managed projects") + .item("Make Rye's own Python distribution available") + .item("Transparently pass through to non Rye (system, pyenv, etc.) Python") + .default(0) + .interact()? + == 0) + { + config_doc.as_item_mut()["behavior"]["global-python"] = toml_edit::value(true); + } + // place executable in rye home folder fs::create_dir_all(&shims).ok(); if target.is_file() { @@ -478,6 +500,8 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( echo!(); echo!("{}", style("All done!").green()); + config.save()?; + Ok(()) } diff --git a/rye/src/utils/mod.rs b/rye/src/utils/mod.rs index 57fd275e0e..0388fc4438 100644 --- a/rye/src/utils/mod.rs +++ b/rye/src/utils/mod.rs @@ -6,6 +6,7 @@ use std::process::{Command, ExitStatus, Stdio}; use std::{fmt, fs}; use anyhow::{anyhow, bail, Error}; +use dialoguer::theme::{ColorfulTheme, Theme}; use once_cell::sync::Lazy; use pep508_rs::{Requirement, VersionOrUrl}; use regex::{Captures, Regex}; @@ -22,6 +23,12 @@ pub use std::os::windows::fs::symlink_file; use crate::config::Config; use crate::consts::VENV_BIN; +/// Returns the preferred theme for dialoguer +pub fn tui_theme() -> &'static dyn Theme { + static THEME: Lazy = Lazy::new(ColorfulTheme::default); + Lazy::force(&THEME) as &dyn Theme +} + #[cfg(windows)] pub(crate) mod windows; From b839a2c5b7e648e9e5d836a8bf5f703c9807d615 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 29 Jan 2024 08:57:41 +0100 Subject: [PATCH 081/166] Add a warning to the console command about bugs (#567) --- CHANGELOG.md | 3 +++ rye/src/cli/shell.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 116be8bbaa..1c9d4912a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ _Unreleased_ - Upon installation Rye now prompts if global shims should be enabled. #566 +- Add a warning about bugs to the `shell` command until the behavior has been + fixed. #567 + ## 0.19.0 diff --git a/rye/src/cli/shell.rs b/rye/src/cli/shell.rs index b802492b70..4c70395bf6 100644 --- a/rye/src/cli/shell.rs +++ b/rye/src/cli/shell.rs @@ -63,6 +63,8 @@ pub fn execute(cmd: Args) -> Result<(), Error> { bail!("cannot invoke recursive rye shell"); } + warn!("this command is quite buggy and recommended against. Please activate the virtualenv instead."); + let _guard = redirect_to_stderr(true); let pyproject = PyProject::load_or_discover(cmd.pyproject.as_deref())?; sync(SyncOptions::python_only().pyproject(cmd.pyproject)) From bc8da3f11456804b3ce2826725ecd390b286f52e Mon Sep 17 00:00:00 2001 From: nahco314 <73940286+nahco314@users.noreply.github.com> Date: Thu, 1 Feb 2024 18:59:10 +0900 Subject: [PATCH 082/166] Add functionality to specify target files in fmt and lint commands (#570) --- docs/guide/commands/fmt.md | 10 +++++++++- docs/guide/commands/lint.md | 10 +++++++++- rye/src/cli/fmt.rs | 16 ++++++++++++---- rye/src/cli/lint.rs | 16 ++++++++++++---- 4 files changed, 42 insertions(+), 10 deletions(-) diff --git a/docs/guide/commands/fmt.md b/docs/guide/commands/fmt.md index f0a1f9560b..c5545c48b0 100644 --- a/docs/guide/commands/fmt.md +++ b/docs/guide/commands/fmt.md @@ -40,9 +40,17 @@ $ rye fmt -- --diff 1 file would be reformatted, 231 files already formatted ``` +Format a specific file: + +``` +rye fmt src/foo.py +``` + ## Arguments -* `[EXTRA_ARGS]` Extra arguments to the formatter. +* `[PATHS]...` List of files or directories to lint. If not supplied all files are formatted. + +* `[EXTRA_ARGS]...` Extra arguments to the formatter. These arguments are forwarded directly to the underlying formatter (currently always `ruff`). Note that extra arguments must be separated from other arguments diff --git a/docs/guide/commands/lint.md b/docs/guide/commands/lint.md index 1fd7588533..0f6cceab09 100644 --- a/docs/guide/commands/lint.md +++ b/docs/guide/commands/lint.md @@ -32,9 +32,17 @@ To pass extra arguments: $ rye lint -- --watch ``` +Lint a specific file: + +``` +rye lint src/foo.py +``` + ## Arguments -* `[EXTRA_ARGS]` Extra arguments to the linter. +* `[PATHS]...` List of files or directories to lint. If not supplied all files are linted. + +* `[EXTRA_ARGS]...` Extra arguments to the linter. These arguments are forwarded directly to the underlying linter (currently always `ruff`). Note that extra arguments must be separated from other arguments diff --git a/rye/src/cli/fmt.rs b/rye/src/cli/fmt.rs index 7b24f6dbfd..663a3b56ac 100644 --- a/rye/src/cli/fmt.rs +++ b/rye/src/cli/fmt.rs @@ -15,6 +15,8 @@ use crate::utils::{CommandOutput, QuietExit}; /// This invokes ruff in format mode. #[derive(Parser, Debug)] pub struct Args { + /// List of files or directories to format + paths: Vec, /// Format all packages #[arg(short, long)] all: bool, @@ -34,7 +36,7 @@ pub struct Args { #[arg(short, long, conflicts_with = "verbose")] quiet: bool, /// Extra arguments to the formatter - #[arg(trailing_var_arg = true)] + #[arg(last = true)] extra_args: Vec, } @@ -62,9 +64,15 @@ pub fn execute(cmd: Args) -> Result<(), Error> { ruff_cmd.args(cmd.extra_args); ruff_cmd.arg("--"); - let projects = locate_projects(project, cmd.all, &cmd.package[..])?; - for project in projects { - ruff_cmd.arg(project.root_path().as_os_str()); + if cmd.paths.is_empty() { + let projects = locate_projects(project, cmd.all, &cmd.package[..])?; + for project in projects { + ruff_cmd.arg(project.root_path().as_os_str()); + } + } else { + for file in cmd.paths { + ruff_cmd.arg(file.as_os_str()); + } } let status = ruff_cmd.status()?; diff --git a/rye/src/cli/lint.rs b/rye/src/cli/lint.rs index 4105800c92..75b2ebafe8 100644 --- a/rye/src/cli/lint.rs +++ b/rye/src/cli/lint.rs @@ -15,6 +15,8 @@ use crate::utils::{CommandOutput, QuietExit}; /// This invokes ruff in lint mode. #[derive(Parser, Debug)] pub struct Args { + /// List of files or directories to lint + paths: Vec, /// Lint all packages #[arg(short, long)] all: bool, @@ -34,7 +36,7 @@ pub struct Args { #[arg(short, long, conflicts_with = "verbose")] quiet: bool, /// Extra arguments to the linter - #[arg(trailing_var_arg = true)] + #[arg(last = true)] extra_args: Vec, } @@ -62,9 +64,15 @@ pub fn execute(cmd: Args) -> Result<(), Error> { ruff_cmd.args(cmd.extra_args); ruff_cmd.arg("--"); - let projects = locate_projects(project, cmd.all, &cmd.package[..])?; - for project in projects { - ruff_cmd.arg(project.root_path().as_os_str()); + if cmd.paths.is_empty() { + let projects = locate_projects(project, cmd.all, &cmd.package[..])?; + for project in projects { + ruff_cmd.arg(project.root_path().as_os_str()); + } + } else { + for file in cmd.paths { + ruff_cmd.arg(file.as_os_str()); + } } let status = ruff_cmd.status()?; From 33919d43ea48fd3cde1ae5025f19416fc8047553 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 1 Feb 2024 11:36:17 +0100 Subject: [PATCH 083/166] 0.20.0 --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c9d4912a9..7662565fd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. + + ## 0.20.0 -_Unreleased_ +Released on 2024-02-01 - Improved the error message when an update could not be performed because files are in use. #550 @@ -29,8 +31,6 @@ _Unreleased_ - Add a warning about bugs to the `shell` command until the behavior has been fixed. #567 - - ## 0.19.0 Released on 2024-01-21 From 3e4372a044dd9e3457b0911bce43b2567a1bbe92 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 1 Feb 2024 11:37:04 +0100 Subject: [PATCH 084/166] 0.21 ready for dev --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7662565fd2..6685577489 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.21.0 + +_Unreleased_ + ## 0.20.0 diff --git a/Cargo.lock b/Cargo.lock index 8aa6be240c..346f821267 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.20.0" +version = "0.21.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index ea4ac2a7f7..cfab134e9e 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.20.0" +version = "0.21.0" edition = "2021" license = "MIT" From 5e7b6754ac341cf7f9d4271d63bdfc99e4aad8da Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 1 Feb 2024 13:19:12 +0100 Subject: [PATCH 085/166] Improve fetch to be able to fetch all implicit defaults (#574) --- CHANGELOG.md | 4 ++++ rye/src/cli/fetch.rs | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6685577489..a23f0d69a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ that were not yet released. _Unreleased_ +- `rye fetch` now is able to fetch impliciit version in all cases. Previously + global shims were not properly defaulted which required the user to be explicit + with the fetch request. #574 + ## 0.20.0 diff --git a/rye/src/cli/fetch.rs b/rye/src/cli/fetch.rs index 7c468106bb..2d1b4f88cb 100644 --- a/rye/src/cli/fetch.rs +++ b/rye/src/cli/fetch.rs @@ -1,7 +1,8 @@ -use anyhow::{anyhow, Context, Error}; +use anyhow::{Context, Error}; use clap::Parser; use crate::bootstrap::fetch; +use crate::config::Config; use crate::platform::get_python_version_request_from_pyenv_pin; use crate::pyproject::PyProject; use crate::sources::PythonVersionRequest; @@ -36,9 +37,10 @@ pub fn execute(cmd: Args) -> Result<(), Error> { if let Ok(pyproject) = PyProject::discover() { pyproject.venv_python_version()?.into() } else { - get_python_version_request_from_pyenv_pin(&std::env::current_dir()?).ok_or_else( - || anyhow!("not sure what to fetch, please provide an explicit version"), - )? + match get_python_version_request_from_pyenv_pin(&std::env::current_dir()?) { + Some(version) => version, + None => Config::current().default_toolchain()?, + } } } }; From d7feaca98eac89bec81263141383d8d781078501 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 1 Feb 2024 16:05:36 +0100 Subject: [PATCH 086/166] Prompt for default toolchain on installation (#576) --- CHANGELOG.md | 5 +++++ rye/src/bootstrap.rs | 4 ++-- rye/src/cli/rye.rs | 52 +++++++++++++++++++++++++++++++++++++++----- rye/src/utils/mod.rs | 15 +++++++++++++ 4 files changed, 69 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a23f0d69a4..edbc8e23c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ _Unreleased_ global shims were not properly defaulted which required the user to be explicit with the fetch request. #574 +- The rye installer now prompts for the default toolchain version if global shims + are enabled. #576 + +- The internal Python version was bumped to 3.12. #576 + ## 0.20.0 diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index 670d25b5e1..dc57bb6db0 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -31,12 +31,12 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques arch: None, os: None, major: 3, - minor: Some(11), + minor: Some(12), patch: None, suffix: None, }; -const SELF_VERSION: u64 = 8; +const SELF_VERSION: u64 = 9; const SELF_REQUIREMENTS: &str = r#" build==1.0.3 diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index b3ed51bb49..e163dc6547 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -6,7 +6,7 @@ use std::process::Command; use std::sync::Arc; use std::{env, fs}; -use anyhow::{bail, Context, Error}; +use anyhow::{anyhow, bail, Context, Error}; use clap::{CommandFactory, Parser}; use clap_complete::Shell; use console::style; @@ -16,12 +16,13 @@ use tempfile::tempdir; use crate::bootstrap::{ download_url, download_url_ignore_404, ensure_self_venv, is_self_compatible_toolchain, - update_core_shims, + update_core_shims, SELF_PYTHON_TARGET_VERSION, }; use crate::cli::toolchain::register_toolchain; use crate::config::Config; use crate::platform::{get_app_dir, symlinks_supported}; -use crate::utils::{check_checksum, tui_theme, CommandOutput, QuietExit}; +use crate::sources::{get_download_url, PythonVersionRequest}; +use crate::utils::{check_checksum, ensure_toml_table, tui_theme, CommandOutput, QuietExit}; #[cfg(windows)] const DEFAULT_HOME: &str = "%USERPROFILE%\\.rye"; @@ -344,11 +345,13 @@ fn is_fish() -> bool { fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<(), Error> { let mut config = Config::current(); + let mut registered_toolchain: Option = None; let config_doc = Arc::make_mut(&mut config).doc_mut(); let exe = env::current_exe()?; let app_dir = get_app_dir(); let shims = app_dir.join("shims"); let target = shims.join("rye").with_extension(EXE_EXTENSION); + let mut prompt_for_toolchain_later = false; echo!("{}", style("Welcome to Rye!").bold()); @@ -413,7 +416,18 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( .interact()? == 0) { - config_doc.as_item_mut()["behavior"]["global-python"] = toml_edit::value(true); + ensure_toml_table(config_doc, "behavior")["global-python"] = toml_edit::value(true); + + // configure the default toolchain. If we are not using a pre-configured toolchain we + // can ask now, otherwise we need to wait for the toolchain to be available before we + // can fill in the default. + if !matches!(mode, InstallMode::NoPrompts) { + if toolchain_path.is_none() { + prompt_for_default_toolchain(SELF_PYTHON_TARGET_VERSION, config_doc)?; + } else { + prompt_for_toolchain_later = true; + } + } } // place executable in rye home folder @@ -454,7 +468,8 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( } Ok(()) })?; - echo!("Registered toolchain as {}", style(version).cyan()); + echo!("Registered toolchain as {}", style(&version).cyan()); + registered_toolchain = Some(version.into()); } // Ensure internals next @@ -464,6 +479,11 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( style(self_path.display()).cyan() ); + // now that the registered toolchain is available, prompt now. + if prompt_for_toolchain_later { + prompt_for_default_toolchain(registered_toolchain.unwrap(), config_doc)?; + } + #[cfg(unix)] { if !env::split_paths(&env::var_os("PATH").unwrap()) @@ -505,6 +525,28 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( Ok(()) } +fn prompt_for_default_toolchain( + default_toolchain: PythonVersionRequest, + config_doc: &mut toml_edit::Document, +) -> Result<(), Error> { + let choice = dialoguer::Input::with_theme(tui_theme()) + .with_prompt("Which version of Python should be used as default toolchain?") + .default(default_toolchain.clone()) + .validate_with(move |version: &PythonVersionRequest| { + // this is for ensuring that if a toolchain was registered manually we can + // accept it, even if it's not downloadable + if version == &default_toolchain { + return Ok(()); + } + get_download_url(version) + .map(|_| ()) + .ok_or_else(|| anyhow!("Unavailable version '{}'", version)) + }) + .interact_text()?; + ensure_toml_table(config_doc, "default")["toolchain"] = toml_edit::value(choice.to_string()); + Ok(()) +} + pub fn auto_self_install() -> Result { // disables self installation if env::var("RYE_NO_AUTO_INSTALL").ok().as_deref() == Some("1") { diff --git a/rye/src/utils/mod.rs b/rye/src/utils/mod.rs index 0388fc4438..0eeb14a568 100644 --- a/rye/src/utils/mod.rs +++ b/rye/src/utils/mod.rs @@ -387,6 +387,21 @@ pub fn reformat_toml_array_multiline(deps: &mut Array) { deps.set_trailing_comma(true); } +/// Given a toml document, ensures that a given named table exists toplevel. +/// +/// The table is created as a non inline table which is the preferred style. +pub fn ensure_toml_table<'a>( + doc: &'a mut toml_edit::Document, + name: &str, +) -> &'a mut toml_edit::Item { + if doc.as_item().get(name).is_none() { + let mut tbl = toml_edit::Table::new(); + tbl.set_implicit(true); + doc.as_item_mut()[name] = toml_edit::Item::Table(tbl); + } + &mut doc.as_item_mut()[name] +} + pub fn escape_string(s: String) -> String { s.trim().replace(['\\', '"'], "") } From 675255c2c12176fff8988b6c3896dcd10766b681 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 1 Feb 2024 20:54:27 +0100 Subject: [PATCH 087/166] Bump monotrail (#577) --- Cargo.lock | 4 ++-- rye/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 346f821267..f6e5b5d019 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1219,7 +1219,7 @@ dependencies = [ [[package]] name = "monotrail-utils" version = "0.0.1" -source = "git+https://github.com/konstin/poc-monotrail#9d3892a57ecc117d35f084870e5d4e74fc39a240" +source = "git+https://github.com/konstin/poc-monotrail?rev=136807e1fe87e9319e0223f76b602ba5db881322#136807e1fe87e9319e0223f76b602ba5db881322" dependencies = [ "anyhow", "cpufeatures", @@ -1237,7 +1237,7 @@ dependencies = [ "tracing", "unscanny", "ureq", - "zstd 0.12.4", + "zstd 0.13.0", ] [[package]] diff --git a/rye/Cargo.toml b/rye/Cargo.toml index cfab134e9e..04f70a816a 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -55,7 +55,7 @@ bzip2 = "0.4.4" zip = { version = "0.6.5", features = ["deflate"], default-features = false } self-replace = "1.3.5" configparser = "3.0.2" -monotrail-utils = { git = "https://github.com/konstin/poc-monotrail", version = "0.0.1" } +monotrail-utils = { git = "https://github.com/konstin/poc-monotrail", rev = "136807e1fe87e9319e0223f76b602ba5db881322" } python-pkginfo = { version = "0.6.0", features = ["serde"] } sysinfo = { version = "0.29.4", default-features = false, features = [] } home = "0.5.9" From 8498dd1eb57b0d8e01d6c77f584ce7ae0edade29 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 1 Feb 2024 23:19:20 +0100 Subject: [PATCH 088/166] Update website index --- docs/index.md | 34 +++++++++++++--------------------- requirements-dev.lock | 1 + requirements.lock | 1 + 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/docs/index.md b/docs/index.md index 50c6d1cbb1..53eb34c24f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,27 +3,19 @@ hide: - navigation --- -# Rye: A New Kind Of Package Management Solution for Python - -Rye is a project and package management solution for Python, created by -[Armin](https://github.com/mitsuhiko/). It came out of his desire to create a -one-stop-shop for all Python needs. It installs and manages Python -installations, manages `pyproject.toml` files, installs and uninstalls -dependencies, manages virtualenvs behind the scenes. It supports monorepos, -global tool installations. - -Rye is an experimental endeavour to build a new type of packaging experience to -Python inspired by `rustup` and `cargo` from Rust. Please give it a try. -Feedback and suggestions are greatly appreciated. - -**What it does:** - -* Download and manage Python interpreters -* Manage Projects -* Manage your dependencies via [pip-tools](https://github.com/jazzband/pip-tools) -* [Manage your virtualenvs](guide/sync.md) -* Simple way to [invoke scripts](guide/pyproject.md#toolryescripts) -* Lint and format via [Ruff](https://astral.sh/ruff) +

+ +

Rye: a Hassle-Free Python Experience

+
+ +Rye is a comprehensive project and package management solution for Python. +Born from [its creators](https://github.com/mitsuhiko) desire to establish a +one-stop-shop for all Python users, Rye provides a unified experience to install and manages Python +installations, `pyproject.toml` based projects, dependencies and virtualenvs +seamlessly. It's designed to accomodate complex projects, monorepos and to +facilitate global tool installations. + +A hassle-free experience for Python developers at every level.

diff --git a/requirements-dev.lock b/requirements-dev.lock index 6d2381d268..847c1aa1ab 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -5,6 +5,7 @@ # pre: false # features: [] # all-features: false +# with-sources: false -e file:. certifi==2023.5.7 diff --git a/requirements.lock b/requirements.lock index 6d2381d268..847c1aa1ab 100644 --- a/requirements.lock +++ b/requirements.lock @@ -5,6 +5,7 @@ # pre: false # features: [] # all-features: false +# with-sources: false -e file:. certifi==2023.5.7 From a1e1aee8fb54bc3ff0d02d090e97b66dcc41ead2 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 1 Feb 2024 23:30:40 +0100 Subject: [PATCH 089/166] Fix spelling --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 53eb34c24f..7b05731282 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,7 +12,7 @@ Rye is a comprehensive project and package management solution for Python. Born from [its creators](https://github.com/mitsuhiko) desire to establish a one-stop-shop for all Python users, Rye provides a unified experience to install and manages Python installations, `pyproject.toml` based projects, dependencies and virtualenvs -seamlessly. It's designed to accomodate complex projects, monorepos and to +seamlessly. It's designed to accommodate complex projects, monorepos and to facilitate global tool installations. A hassle-free experience for Python developers at every level. From 475c6d530ae028b9edfb225ba380e365fd20d9ec Mon Sep 17 00:00:00 2001 From: Ned Western Date: Sat, 3 Feb 2024 06:20:06 +1000 Subject: [PATCH 090/166] Update sync.md (#579) Copied in error from `lock` page. --- docs/guide/commands/sync.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/guide/commands/sync.md b/docs/guide/commands/sync.md index 4ae19ab2f2..f1306264cb 100644 --- a/docs/guide/commands/sync.md +++ b/docs/guide/commands/sync.md @@ -1,8 +1,6 @@ # `sync` Updates the lockfiles and installs the dependencies into the virtualenv. -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). @@ -63,4 +61,4 @@ To exit the sub shell run `exit`. * `-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') From 8dae30e58a3df061df5024c847c7da975c51489f Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 3 Feb 2024 14:11:50 +0100 Subject: [PATCH 091/166] Automatically add to PATH on UNIX shells (#580) --- CHANGELOG.md | 2 ++ docs/guide/installation.md | 31 ++++++++++++++++++++++++--- rye/src/bootstrap.rs | 4 ++-- rye/src/cli/rye.rs | 33 ++++++++++++++++++++++++----- rye/src/utils/mod.rs | 3 +++ rye/src/utils/unix.rs | 43 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 106 insertions(+), 10 deletions(-) create mode 100644 rye/src/utils/unix.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index edbc8e23c9..6988aceb4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ _Unreleased_ - The internal Python version was bumped to 3.12. #576 +- The installer now can automatically add Rye to `PATH` on most UNIX environments. #580 + ## 0.20.0 diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 04d5abcf14..4da9dda99f 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -51,15 +51,23 @@ This folder is a folder that contains "shims" which are executables that Rye manages for you as well as the `rye` executable itself. For instance any Python installation managed by Rye will be available via a shim placed there. -On macOS or Linux you can accomplish this by adding it to your `.bashrc`, `.zshrc` +On macOS or Linux you can accomplish this by adding it to your `.profile` file or similar. This step is technically optional but required if you want to be able to just type `python` or `rye` into the shell to pick up the current virtualenv's Python -interpreter. +interpreter. The installer will offer to do this for you automatically. If you +opt-out, or you run a custom shell you will need to do this manually. === "Bash" Rye ships an `env` file which should be sourced to update `PATH` automatically. + ```bash + echo 'source "$HOME/.rye/env"' >> ~/.profile + ``` + + In some setups `.profile` is not sourced, in which case you can add it to your + `.bashrc` instead: + ```bash echo 'source "$HOME/.rye/env"' >> ~/.bashrc ``` @@ -69,7 +77,14 @@ interpreter. Rye ships an `env` file which should be sourced to update `PATH` automatically. ```bash - echo 'source "$HOME/.rye/env"' >> ~/.zshrc + echo 'source "$HOME/.rye/env"' >> ~/.profile + ``` + + In some setups `.profile` is not sourced, in which case you can add it to your + `.zprofile` instead: + + ```bash + echo 'source "$HOME/.rye/env"' >> ~/.zprofile ``` === "Fish" @@ -82,6 +97,16 @@ interpreter. set -Ua fish_user_paths "$HOME/.rye/shims" ``` +=== "Nushell" + + Since nushell does not support `env` files, you instead need to add + the shims directly. This can be accomplished by adding this to your + `env.nu` file: + + ```shell + $env.PATH = ($env.PATH | split row (char esep) | append "~/.rye/shims") + ``` + === "Unix Shells" Rye ships an `env` file which should be sourced to update `PATH` automatically. diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index dc57bb6db0..2e2697b450 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -308,9 +308,9 @@ pub fn get_pip_module(venv: &Path) -> Result { Ok(rv) } -/// we only support cpython 3.9 to 3.11 +/// we only support cpython 3.9 to 3.12 pub fn is_self_compatible_toolchain(version: &PythonVersion) -> bool { - version.name == "cpython" && version.major == 3 && version.minor >= 9 && version.minor < 12 + version.name == "cpython" && version.major == 3 && version.minor >= 9 && version.minor <= 12 } fn ensure_self_toolchain(output: CommandOutput) -> Result { diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index e163dc6547..3c254eccd1 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -484,6 +484,7 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( prompt_for_default_toolchain(registered_toolchain.unwrap(), config_doc)?; } + let rye_home = Path::new(&*rye_home); #[cfg(unix)] { if !env::split_paths(&env::var_os("PATH").unwrap()) @@ -496,23 +497,45 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( style("PATH").cyan() ); echo!("It is highly recommended that you add it."); - echo!("Add this at the end of your .profile, .zprofile or similar:"); + + if matches!(mode, InstallMode::NoPrompts) + || dialoguer::Confirm::with_theme(tui_theme()) + .with_prompt(format!( + "Should the installer add Rye to {} via .profile?", + style("PATH").cyan() + )) + .interact()? + { + crate::utils::unix::add_to_path(rye_home)?; + echo!("Added to {}.", style("PATH").cyan()); + echo!( + "{}: for this to take effect you will need to restart your shell or run this manually:", + style("note").cyan() + ); + } else { + echo!( + "{}: did not manipulate the path. To make it work, add this to your .profile manually:", + style("note").cyan() + ); + } + echo!(); - echo!(" source \"{}/env\"", rye_home); + echo!(" source \"{}/env\"", rye_home.display()); echo!(); if is_fish() { echo!("To make it work with fish, run this once instead:"); echo!(); - echo!(" set -Ua fish_user_paths \"{}/shims\"", rye_home); + echo!( + " set -Ua fish_user_paths \"{}/shims\"", + rye_home.display() + ); echo!(); } - echo!("Note: after adding rye to your path, restart your shell for it to take effect."); echo!("For more information read https://mitsuhiko.github.io/rye/guide/installation"); } } #[cfg(windows)] { - let rye_home = Path::new(&*rye_home); crate::utils::windows::add_to_programs(rye_home)?; crate::utils::windows::add_to_path(rye_home)?; } diff --git a/rye/src/utils/mod.rs b/rye/src/utils/mod.rs index 0eeb14a568..abc40d937b 100644 --- a/rye/src/utils/mod.rs +++ b/rye/src/utils/mod.rs @@ -32,6 +32,9 @@ pub fn tui_theme() -> &'static dyn Theme { #[cfg(windows)] pub(crate) mod windows; +#[cfg(unix)] +pub(crate) mod unix; + #[cfg(windows)] pub fn symlink_dir(original: P, link: Q) -> Result<(), std::io::Error> where diff --git a/rye/src/utils/unix.rs b/rye/src/utils/unix.rs new file mode 100644 index 0000000000..775aa89da6 --- /dev/null +++ b/rye/src/utils/unix.rs @@ -0,0 +1,43 @@ +use std::path::{Path, PathBuf}; +use std::{env, fs}; + +use anyhow::{Context, Error}; + +pub(crate) fn add_to_path(rye_home: &Path) -> Result<(), Error> { + // for regular shells just add the path to `.profile` + add_source_line_to_profile( + &home::home_dir() + .context("could not find home dir")? + .join(".profile"), + &(format!( + ". \"{}\"", + reverse_resolve_env_home(rye_home.join("env")).display() + )), + )?; + Ok(()) +} + +fn add_source_line_to_profile(profile_path: &Path, source_line: &str) -> Result<(), Error> { + let mut profile = if profile_path.is_file() { + fs::read_to_string(profile_path)? + } else { + String::new() + }; + + if !profile.lines().any(|x| x.trim() == source_line) { + profile.push_str(source_line); + profile.push('\n'); + fs::write(profile_path, profile).context("failed to write updated .profile")?; + } + + Ok(()) +} + +fn reverse_resolve_env_home(path: PathBuf) -> PathBuf { + if let Some(env_home) = env::var_os("HOME").map(PathBuf::from) { + if let Ok(rest) = path.strip_prefix(&env_home) { + return Path::new("$HOME").join(rest); + } + } + path +} From 2e0e024594af3e990c2c2fe11ff5b82a5c2d78c7 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 3 Feb 2024 14:14:56 +0100 Subject: [PATCH 092/166] 0.21.0 --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6988aceb4a..0c39e4dab0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. + + ## 0.21.0 -_Unreleased_ +Released on 2024-02-03 - `rye fetch` now is able to fetch impliciit version in all cases. Previously global shims were not properly defaulted which required the user to be explicit @@ -18,8 +20,6 @@ _Unreleased_ - The installer now can automatically add Rye to `PATH` on most UNIX environments. #580 - - ## 0.20.0 Released on 2024-02-01 From 84aa85bd583bf816ad0dc73565e40a69c3b9a6d3 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 3 Feb 2024 14:15:25 +0100 Subject: [PATCH 093/166] 0.22 ready for dev --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c39e4dab0..ee10c661e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.22.0 + +_Unreleased_ + ## 0.21.0 diff --git a/Cargo.lock b/Cargo.lock index f6e5b5d019..508d54ea0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.21.0" +version = "0.22.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 04f70a816a..57d808d00c 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.21.0" +version = "0.22.0" edition = "2021" license = "MIT" From 8f9a41ea76cc7f6def5768cb6fde8a8d8f5b74ae Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 3 Feb 2024 16:36:28 +0100 Subject: [PATCH 094/166] Added dark/light logo --- docs/index.md | 4 ++-- docs/static/logo-auto.svg | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 docs/static/logo-auto.svg diff --git a/docs/index.md b/docs/index.md index 7b05731282..c94085861b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,7 +4,7 @@ hide: ---

- +

Rye: a Hassle-Free Python Experience

@@ -29,4 +29,4 @@ A hassle-free experience for Python developers at every level. {% include-markdown ".includes/quick-install.md" %} For the next steps or ways to customize the installation, head over to the detailed - [installation](./guide/installation.md) guide. \ No newline at end of file + [installation](./guide/installation.md) guide. diff --git a/docs/static/logo-auto.svg b/docs/static/logo-auto.svg new file mode 100644 index 0000000000..6e4e5f3933 --- /dev/null +++ b/docs/static/logo-auto.svg @@ -0,0 +1,14 @@ + + + + + + + From 52c14fc1c702ac245ab13502a9e2375618260334 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 3 Feb 2024 16:43:16 +0100 Subject: [PATCH 095/166] Fixed typo --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index c94085861b..d8d08467b5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -9,7 +9,7 @@ hide:
Rye is a comprehensive project and package management solution for Python. -Born from [its creators](https://github.com/mitsuhiko) desire to establish a +Born from [its creator's](https://github.com/mitsuhiko) desire to establish a one-stop-shop for all Python users, Rye provides a unified experience to install and manages Python installations, `pyproject.toml` based projects, dependencies and virtualenvs seamlessly. It's designed to accommodate complex projects, monorepos and to From 35cc4a38956fb596a0e67683c3dbb7bbbeae1b07 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 3 Feb 2024 18:16:51 +0100 Subject: [PATCH 096/166] Update video link --- docs/guide/index.md | 2 +- docs/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/index.md b/docs/guide/index.md index c30ebc8d94..88d9da82ff 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -15,7 +15,7 @@ for you, install packages from package indexes, manage virtualenvs behind the scenes and more.
- +
Interested? Then head over to [Installation](./installation.md) to learn about diff --git a/docs/index.md b/docs/index.md index d8d08467b5..b7445ab932 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,7 +13,7 @@ Born from [its creator's](https://github.com/mitsuhiko) desire to establish a one-stop-shop for all Python users, Rye provides a unified experience to install and manages Python installations, `pyproject.toml` based projects, dependencies and virtualenvs seamlessly. It's designed to accommodate complex projects, monorepos and to -facilitate global tool installations. +facilitate global tool installations. Curious? [Watch an introduction](https://youtu.be/q99TYA7LnuA). A hassle-free experience for Python developers at every level. From 852063a0720e3f2d1175ebcac37e0e86afb5e316 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 3 Feb 2024 19:11:15 +0100 Subject: [PATCH 097/166] Update demo video --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e40efc3503..a7415cba21 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ from perfect, but always improving. It also asks the question: **[Should it exist?](https://github.com/mitsuhiko/rye/discussions/6)**
- - Watch the instruction + + Watch the instruction

Click on the thumbnail to watch a 9 minute introduction video

From 349e37e9734d13d649632212e51b6657f4280aa6 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 3 Feb 2024 19:13:19 +0100 Subject: [PATCH 098/166] Swap out thumbnail --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a7415cba21..37a3b76091 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ from perfect, but always improving. It also asks the question:
- Watch the instruction + Watch the instruction

Click on the thumbnail to watch a 9 minute introduction video

From dec1bd835fd4448334fbfc2ef332c9598a0f56d5 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 3 Feb 2024 19:16:06 +0100 Subject: [PATCH 099/166] 9 -> 16 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 37a3b76091..c166393a45 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ from perfect, but always improving. It also asks the question: Watch the instruction -

Click on the thumbnail to watch a 9 minute introduction video

+

Click on the thumbnail to watch a 16 minute introduction video

Learn more: From 9e387a0304a8688bcbded568b2ee998d13666630 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 4 Feb 2024 14:07:47 +0100 Subject: [PATCH 100/166] Change tagline --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c166393a45..d493f2fcec 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-

Rye: An Experimental Package Management Solution for Python

+

Rye: a Hassle-Free Python Experience

---- From d778d654cf7265876b36e02f486a449f07c0d732 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 4 Feb 2024 14:08:26 +0100 Subject: [PATCH 101/166] Update introduction text --- README.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d493f2fcec..fa7f6a4762 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,14 @@ -Rye is a project and package management solution for Python, created by -[Armin](https://github.com/mitsuhiko/). It came out of his desire to create a -one-stop-shop for all Python needs. It installs and manages Python -installations, manages `pyproject.toml` files, installs and uninstalls -dependencies, manages virtualenvs behind the scenes. It supports monorepos and -global tool installations. - -It is a wish of what Python was, an exploration of what is possible. It's far -from perfect, but always improving. It also asks the question: -**[Should it exist?](https://github.com/mitsuhiko/rye/discussions/6)** +Rye is a comprehensive project and package management solution for Python. +Born from [its creator's](https://github.com/mitsuhiko) desire to establish a +one-stop-shop for all Python users, Rye provides a unified experience to install and manages Python +installations, `pyproject.toml` based projects, dependencies and virtualenvs +seamlessly. It's designed to accommodate complex projects, monorepos and to +facilitate global tool installations. Curious? [Watch an introduction](https://youtu.be/q99TYA7LnuA). + +A hassle-free experience for Python developers at every level.
From 7ab87ad7115794980988fb2a121741e4d70535e3 Mon Sep 17 00:00:00 2001 From: Greg Roodt Date: Mon, 5 Feb 2024 00:08:57 +1100 Subject: [PATCH 102/166] Fixes small nits in docs (#582) --- docs/.includes/quick-install.md | 2 +- docs/guide/installation.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/.includes/quick-install.md b/docs/.includes/quick-install.md index 702212ff55..ec037685b6 100644 --- a/docs/.includes/quick-install.md +++ b/docs/.includes/quick-install.md @@ -1,6 +1,6 @@ === "Linux" - To install run you can curl a command which will install the right binary for your + To install you can run a curl command which will install the right binary for your operating system and CPU architecture and install it: ```bash diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 4da9dda99f..aaa2a43bbf 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -7,7 +7,7 @@ Windows. ## Installing Rye Rye is installed per-user and self manages itself. It will install itself into -a folder in your home directory and mange itself there. +a folder in your home directory and manage itself there. {% include-markdown "../.includes/quick-install.md" %} From ace4da62fd20587fac600212cc4c41f284663212 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 4 Feb 2024 14:20:36 +0100 Subject: [PATCH 103/166] Simplify the readme greatly --- README.md | 142 +++++++++--------------------------------------------- 1 file changed, 24 insertions(+), 118 deletions(-) diff --git a/README.md b/README.md index fa7f6a4762..932add08ea 100644 --- a/README.md +++ b/README.md @@ -27,136 +27,42 @@ A hassle-free experience for Python developers at every level.

Click on the thumbnail to watch a 16 minute introduction video

-Learn more: +## In The Box -* [Documentation](https://mitsuhiko.github.io/rye) -* [Issue Tracker](https://github.com/mitsuhiko/rye/issues) -* [Discussions](https://github.com/mitsuhiko/rye/discussions) -* [Discord](https://discord.gg/drbkcdtSbg) +Rye picks and ships the right tools so you can get started in minutes: -## Usage +* **Bootstraps Python:** it provides an automated way to get access to the amazing [Indygreg Python Builds](https://github.com/indygreg/python-build-standalone/) as well as the PyPy binary distributions. +* **Linting and Formatting:** it bundles [ruff](https://github.com/astral-sh/ruff) and makes it available with `rye lint` and `rye fmt`. +* **Managing Virtualenvs:** it uses the well established virtualenv library under the hood. +* **Building Wheels:** it delegates that work largely to [build](https://pypi.org/project/build/). +* **Publishing:** its publish command uses [twine](https://pypi.org/project/twine/) to accomplish this task. +* **Locking and Dependency Installation:** is today implemented by using [unearth](https://pypi.org/project/unearth/) and [pip-tools](https://github.com/jazzband/pip-tools/). +* **Workspace support:** Rye lets you work with complex projects consisting + of multiple libraries. -For installation instructions please refer to the [installation documentation](https://mitsuhiko.github.io/rye/guide/installation/). +## Installation -To use rye for automatic management, you first need to create a new project using `rye init`: +The installation takes just a minute: -```shell -$ rye init my_project && cd my_project -``` +* **Linux and macOS:** -Once that's done, you can follow these steps to enjoy the benefits of automated management: + ``` + curl -sSf https://rye-up.com/get | bash + ``` -```shell -$ rye sync -``` +* **Windows:** -If you want to choose a specific version of Python, you can use the `rye pin` command to specify the version you need (optionally): + Download and run the installer ([64bit Intel](https://github.com/mitsuhiko/rye/releases/latest/download/rye-x86_64-windows.exe) or [32bit Intel](https://github.com/mitsuhiko/rye/releases/latest/download/rye-x86-windows.exe)). -``` shell -$ rye pin cpython@3.11 -``` +For more details and other options, refer to the [installation instructions](https://rye-up.com/guide/installation/). -That's it! You can now easily achieve automatic management and switch between different versions of Python as needed. +## Learn More -The virtualenv that `rye` manages is placed in `.venv` next to your `pyproject.toml`. -You can activate and work with it as normal with one notable exception: the Python -installation in it does not contain `pip`. +Did I spark your interest? -Correctly installed, `rye` will automatically pick up the right Python without -manually activating the virtualenv. That is enabled by having `~/.rye/shims` at -higher priority in your `PATH`. If you operate outside of a rye managed -project, the regular Python is picked up automatically. - -## Some of the things it does - -It automatically installs and manages Python: - -``` -$ rye pin 3.11 -$ rye run python -Python 3.11.1 (main, Jan 16 2023, 16:02:03) [Clang 15.0.7 ] on darwin -Type "help", "copyright", "credits" or "license" for more information. ->>> -``` - -**Note that does mean, that Rye will automatically download and -install an appropriate Python binary for you.** These Python binaries -are currently pulled from [the indygreg -python-build-standalone releases](https://github.com/indygreg/python-build-standalone/releases). - -Install tools in isolation globally: - -``` -$ rye install maturin -``` - -Manage dependencies of a local `pyproject.toml` and update the virtualenv -automatically: - -``` -$ rye add flask -$ rye sync -``` - -## Decisions Made - -To understand why things are the way they are: - -- **Virtualenvs:** they are not pefect, but they are widespread. - Because they have reasonable tooling support, the decision was made to - leverage them over `__pypackages__`. - -- **No Default Dependencies:** the virtualenvs when they come up are completely void - of dependencies. Not even `pip` or `setuptools` are installed into it. Rye - manages the virtualenv from outside the virtualenv. - -- **No Core Non Standard Stuff:** Rye (with the exception of it's own `tool` section - in the `pyproject.toml`) uses standardized keys. That means it uses regular - requirements as you would expect. It also does not use a custom lock file - format and uses [`pip-tools`](https://github.com/jazzband/pip-tools) behind the scenes. - -- **No Pip:** Rye uses pip, but it does not expose it. It manage dependencies in - `pyproject.toml` only. - -- **No System Python:** To simplify the experience for users across operating systems, - Rye manages Python installations for you, bypassing the system one by default in - favor of [indygreg's Python builds](https://github.com/indygreg/python-build-standalone). - Rye will automatically download and manage Python builds from there. No compiling, - no divergence. - -- **Project Local Shims:** Rye maintains a `python` shim that auto discovers the - current `pyproject.toml` and automatically operates below it. Just add the - shims to your shell and you can run `python` and it will automatically always - operate in the right project. - -## Python Distributions - -Rye does not use system python installations. Instead it uses Gregory Szorc's standalone -Python builds: [python-build-standalone](https://github.com/indygreg/python-build-standalone). -This is done to create a unified experience of Python installations and to avoid -incompatibilities created by different Python distributions. Most importantly this also -means you never need to compile a Python any more, it just downloads prepared binaries. - -## Global Tools - -If you want tools to be installed into isolated virtualenvs (like pipsi and pipx), you -can use `rye` too (requires `~/.rye/shims` to be on the path): - -``` -$ rye install pycowsay -$ pycowsay Wow - - --- -< Wow > - --- - \ ^__^ - \ (oo)\_______ - (__)\ )\/\ - ||----w | - || || -``` - -To uninstall run `rye uninstall pycowsay` again. +* [Visit the Website](https://rye-up.com/) +* [Read the Documentation](https://rye-up.com/guide/) +* [Report Problems in the Issue Tracker](https://github.com/mitsuhiko/rye/issues) ## More From fdaf14cdf40e58222d5bcbcbad9b281aebd9caa4 Mon Sep 17 00:00:00 2001 From: Chris Laplante Date: Mon, 5 Feb 2024 02:37:37 -0500 Subject: [PATCH 104/166] Update dependencies; fix fallout form pep440_rs change from usize => u64 (#588) --- Cargo.lock | 82 +++++++++++++++++++++++++--------------------- rye/Cargo.toml | 2 +- rye/src/sources.rs | 12 +++---- 3 files changed, 50 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 508d54ea0f..3db55ec26c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -101,9 +101,9 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" [[package]] name = "anyhow" @@ -328,9 +328,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.4.9" +version = "4.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df631ae429f6613fcd3a7c1adbdb65f637271e561b03680adaa6573015dfb106" +checksum = "abb745187d7f4d76267b37485a65e0149edd0e91a4cfcdd3f27524ad86cee9f3" dependencies = [ "clap", ] @@ -464,9 +464,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.70+curl-8.5.0" +version = "0.4.71+curl-8.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0333d8849afe78a4c8102a429a446bfdd055832af071945520e835ae2d841e" +checksum = "c7b12a7ab780395666cb576203dc3ed6e01513754939a600b85196ccf5356bc5" dependencies = [ "cc", "libc", @@ -942,7 +942,7 @@ dependencies = [ "serde", "serde_derive", "thiserror", - "toml 0.8.8", + "toml 0.8.9", "unic-langid", ] @@ -1019,9 +1019,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.0" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2a4f498956c7723dc280afc6a37d0dec50b39a29e232c6187ce4503703e8c2" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", "hashbrown", @@ -1125,9 +1125,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libz-sys" @@ -1209,9 +1209,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -1233,7 +1233,7 @@ dependencies = [ "target-lexicon", "tempfile", "thiserror", - "toml 0.8.8", + "toml 0.8.9", "tracing", "unscanny", "ureq", @@ -1270,6 +1270,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "number_prefix" version = "0.4.0" @@ -1305,9 +1311,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.2.1+3.2.0" +version = "300.2.2+3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fe476c29791a5ca0d1273c697e96085bbabbbea2ef7afd5617e78a4b40332d3" +checksum = "8bbfad0063610ac26ee79f7484739e2b07555a75c42453b89263830b5c8103bc" dependencies = [ "cc", ] @@ -1365,11 +1371,11 @@ dependencies = [ [[package]] name = "pep440_rs" -version = "0.3.12" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "887f66cc62717ea72caac4f1eb4e6f392224da3ffff3f40ec13ab427802746d6" +checksum = "e0c29f9c43de378b4e4e0cd7dbcce0e5cfb80443de8c05620368b2948bc936a1" dependencies = [ - "lazy_static", + "once_cell", "regex", "serde", "unicode-width", @@ -1377,9 +1383,9 @@ dependencies = [ [[package]] name = "pep508_rs" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4516b53d9ea6112ebb38b4af08d5707d30b994fb7f98ff133c5dcf7ed8fa854" +checksum = "aa9d1320b78f4a5715b3ec914f32b5e85a50287ad923730e3cbf0255259432eb" dependencies = [ "once_cell", "pep440_rs", @@ -1751,9 +1757,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ "bitflags 2.4.2", "errno", @@ -1956,9 +1962,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.112" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d1bd37ce2324cf3bf85e5a25f96eb4baf0d5aa6eba43e7ae8958870c4ec48ed" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -2153,12 +2159,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -2173,10 +2180,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -2215,9 +2223,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" dependencies = [ "serde", "serde_spanned", @@ -2236,9 +2244,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "serde", @@ -2494,9 +2502,9 @@ checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "whattheshell" @@ -2686,9 +2694,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.35" +version = "0.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d" +checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" dependencies = [ "memchr", ] diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 57d808d00c..b6a7587546 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -32,7 +32,7 @@ minijinja = { version = "1.0.0", features = ["json"] } nix = { version = "0.27.1", default-features = false, features = ["process"] } once_cell = "1.17.1" pathdiff = "0.2.1" -pep440_rs = "0.3.11" +pep440_rs = "0.4.0" pep508_rs = "0.2.1" regex = "1.8.1" same-file = "1.0.6" diff --git a/rye/src/sources.rs b/rye/src/sources.rs index 1bd8374af8..f9e2f45901 100644 --- a/rye/src/sources.rs +++ b/rye/src/sources.rs @@ -118,11 +118,7 @@ impl From for Version { fn from(value: PythonVersion) -> Self { Version { epoch: 0, - release: vec![ - value.major as usize, - value.minor as usize, - value.patch as usize, - ], + release: vec![value.major as u64, value.minor as u64, value.patch as u64], pre: None, post: None, dev: None, @@ -136,9 +132,9 @@ impl From for Version { Version { epoch: 0, release: vec![ - value.major as usize, - value.minor.unwrap_or_default() as usize, - value.patch.unwrap_or_default() as usize, + value.major as u64, + value.minor.unwrap_or_default() as u64, + value.patch.unwrap_or_default() as u64, ], pre: None, post: None, From 0d26fdc52bcd75c31eb1d6b262b7a366f3198094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Deltheil?= <355031+deltheil@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:13:16 +0100 Subject: [PATCH 105/166] docs/guide/publish.md: fix typos (#591) --- docs/guide/publish.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/publish.md b/docs/guide/publish.md index f37a23173e..eb5b9c276a 100644 --- a/docs/guide/publish.md +++ b/docs/guide/publish.md @@ -4,7 +4,7 @@ Rye currently uses [build](https://github.com/pypa/build) to build the package a ## Build -By default, `rye` will build the both sdist and wheel target in the `dist` directory. The command for this is called [`build`](commands/build.md). +By default, `rye` will build both the sdist and wheel targets in the `dist` directory. The command for this is called [`build`](commands/build.md). ``` rye build From b05fe47598617b6ae8cfbe8cd789032e189b8021 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 5 Feb 2024 17:44:12 +0100 Subject: [PATCH 106/166] Added support for marking virtualenvs ignored for cloud sync (#589) --- CHANGELOG.md | 3 +++ Cargo.lock | 1 + docs/guide/config.md | 6 ++++++ docs/guide/faq.md | 16 ++++++++++++++++ rye/Cargo.toml | 1 + rye/src/config.rs | 9 +++++++++ rye/src/sync.rs | 15 ++++++++++++++- rye/src/utils/mod.rs | 30 ++++++++++++++++++++++++++++++ 8 files changed, 80 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee10c661e5..4f79ca260b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ that were not yet released. _Unreleased_ +- Virtual envs managed by Rye will now by default be marked to not sync to + known cloud storage systems (Dropbox and iCloud). #589 + ## 0.21.0 diff --git a/Cargo.lock b/Cargo.lock index 3db55ec26c..2937c16c58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1840,6 +1840,7 @@ dependencies = [ "which", "winapi", "winreg", + "xattr", "zip", "zstd 0.13.0", ] diff --git a/docs/guide/config.md b/docs/guide/config.md index 58608acc77..7c8e3b8224 100644 --- a/docs/guide/config.md +++ b/docs/guide/config.md @@ -81,6 +81,12 @@ force-rye-managed = false # virtual environments. global-python = false +# Marks the managed .venv in a way that cloud based synchronization systems +# like Dropbox and iCloud Files will not upload it. This defaults to true +# as a .venv in cloud storage typically does not make sense. Set this to +# `false` to disable this behavior. +venv-mark-sync-ignore = true + # a array of tables with optional sources. Same format as in pyproject.toml [[sources]] name = "default" diff --git a/docs/guide/faq.md b/docs/guide/faq.md index f3cf5d1f3b..7e4f252269 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -149,3 +149,19 @@ wheel is built: [tool.hatch.build.targets.sdist] include = ["src/my_package", "tests"] ``` + +## Can I Relocate Virtualenvs? + +Rye very intentionally places the virtualenv (`.venv`) in the root folder of the +workspace. Relocations of virtualenvs is not supported. This is a very intentional +decision so that tools do not need to deal with various complex alternatives and can +rely on a simple algorithm to locate it. This is a form of convention over configuration +and can also assist editor integrations. + +There are some known downsides of this. For instance if you are placing your projects +in Dropbox, it would cause this folder to synchronize. As a way to combat this, Rye +will automatically mark the virtualenv with the necessary flags to disable cloud sync +of known supported cloud synchronization systems. + +For override this behavior you can set the `behavior.venv-mark-sync-ignore` configuration +key to `false`. diff --git a/rye/Cargo.toml b/rye/Cargo.toml index b6a7587546..dc39d00d5a 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -63,6 +63,7 @@ ctrlc = "3.4.2" [target."cfg(unix)".dependencies] whattheshell = "1.0.1" +xattr = "1.3.1" [target."cfg(windows)".dependencies] winapi = { version = "0.3.9", default-features = false, features = [] } diff --git a/rye/src/config.rs b/rye/src/config.rs index 53524fcda0..bd2b9a97bc 100644 --- a/rye/src/config.rs +++ b/rye/src/config.rs @@ -186,6 +186,15 @@ impl Config { .unwrap_or(false) } + /// Mark the `.venv` to not sync to cloud storage + pub fn venv_mark_sync_ignore(&self) -> bool { + self.doc + .get("behavior") + .and_then(|x| x.get("venv-mark-sync-ignore")) + .and_then(|x| x.as_bool()) + .unwrap_or(true) + } + /// Returns the HTTP proxy that should be used. pub fn http_proxy_url(&self) -> Option { std::env::var("http_proxy").ok().or_else(|| { diff --git a/rye/src/sync.rs b/rye/src/sync.rs index a3fa32d565..5b5cb5bee1 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -9,6 +9,7 @@ use serde::{Deserialize, Serialize}; use tempfile::tempdir; use crate::bootstrap::{ensure_self_venv, fetch, get_pip_module}; +use crate::config::Config; use crate::consts::VENV_BIN; use crate::lock::{ make_project_root_fragment, update_single_project_lockfile, update_workspace_lockfile, @@ -18,7 +19,9 @@ use crate::piptools::{get_pip_sync, get_pip_tools_venv}; use crate::platform::get_toolchain_python_bin; use crate::pyproject::{read_venv_marker, ExpandedSources, PyProject}; use crate::sources::PythonVersion; -use crate::utils::{get_venv_python_bin, set_proxy_variables, symlink_dir, CommandOutput}; +use crate::utils::{ + get_venv_python_bin, mark_path_sync_ignore, set_proxy_variables, symlink_dir, CommandOutput, +}; /// Controls the sync mode #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Default)] @@ -302,6 +305,16 @@ pub fn create_virtualenv( venv: &Path, prompt: &str, ) -> Result<(), Error> { + // create the venv folder first so we can manipulate some flags on it. + fs::create_dir(venv) + .with_context(|| format!("unable to create virtualenv folder '{}'", venv.display()))?; + + if let Err(err) = mark_path_sync_ignore(venv, Config::current().venv_mark_sync_ignore()) { + if output != CommandOutput::Quiet && Config::current().venv_mark_sync_ignore() { + warn!("unable to mark virtualenv ignored for cloud sync: {}", err); + } + } + let py_bin = get_toolchain_python_bin(py_ver)?; let mut venv_cmd = Command::new(self_venv.join(VENV_BIN).join("virtualenv")); if output == CommandOutput::Verbose { diff --git a/rye/src/utils/mod.rs b/rye/src/utils/mod.rs index abc40d937b..0e97c105d9 100644 --- a/rye/src/utils/mod.rs +++ b/rye/src/utils/mod.rs @@ -52,6 +52,36 @@ where } } +/// Given the path to a folder this adds or removes a cloud sync flag +/// on the folder. +/// +/// Today this only supports dropbox and apple icloud. +pub fn mark_path_sync_ignore(venv: &Path, mark_ignore: bool) -> Result<(), Error> { + #[cfg(unix)] + { + for flag in ["com.dropbox.ignored", "com.apple.fileprovider.ignore#P"] { + if mark_ignore { + xattr::set(venv, flag, b"1")?; + } else { + xattr::remove(venv, flag)?; + } + } + } + + #[cfg(windows)] + { + let mut stream_path = venv.as_os_str().to_os_string(); + stream_path.push(":com.dropbox.ignored"); + if mark_ignore { + fs::write(stream_path, b"1")?; + } else { + fs::remove_file(stream_path).ok(); + } + } + + Ok(()) +} + #[derive(Debug)] pub struct QuietExit(pub i32); From d4d2a52405c2c9aa28f071749eafe6921e901ec8 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 5 Feb 2024 21:28:57 +0100 Subject: [PATCH 107/166] Update venv ignore marker on update too --- rye/src/sync.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/rye/src/sync.rs b/rye/src/sync.rs index 5b5cb5bee1..2ec15887f2 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -159,6 +159,7 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { { echo!("Reusing already existing virtualenv"); } + update_venv_sync_marker(output, &venv); } else { if output != CommandOutput::Quiet { echo!( @@ -309,11 +310,7 @@ pub fn create_virtualenv( fs::create_dir(venv) .with_context(|| format!("unable to create virtualenv folder '{}'", venv.display()))?; - if let Err(err) = mark_path_sync_ignore(venv, Config::current().venv_mark_sync_ignore()) { - if output != CommandOutput::Quiet && Config::current().venv_mark_sync_ignore() { - warn!("unable to mark virtualenv ignored for cloud sync: {}", err); - } - } + update_venv_sync_marker(output, venv); let py_bin = get_toolchain_python_bin(py_ver)?; let mut venv_cmd = Command::new(self_venv.join(VENV_BIN).join("virtualenv")); @@ -348,6 +345,16 @@ pub fn create_virtualenv( Ok(()) } +/// Update the cloud synchronization marker for the given path +/// based on the config flag. +fn update_venv_sync_marker(output: CommandOutput, venv_path: &Path) { + if let Err(err) = mark_path_sync_ignore(venv_path, Config::current().venv_mark_sync_ignore()) { + if output != CommandOutput::Quiet && Config::current().venv_mark_sync_ignore() { + warn!("unable to mark virtualenv ignored for cloud sync: {}", err); + } + } +} + #[cfg(unix)] fn inject_tcl_config(venv: &Path, py_bin: &Path) -> Result<(), Error> { let lib_path = match py_bin From 1deecb1e483ccebd1abfd327b85a4b39eb609ea8 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 5 Feb 2024 22:22:38 +0100 Subject: [PATCH 108/166] On sync ensure that pip tools are bootstrap in the right order (#596) --- CHANGELOG.md | 2 ++ rye/src/piptools.rs | 4 ++-- rye/src/sync.rs | 16 ++++++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f79ca260b..44f8149343 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ _Unreleased_ - Virtual envs managed by Rye will now by default be marked to not sync to known cloud storage systems (Dropbox and iCloud). #589 +- Fixed a bug where pip-tools sometimes did not get initialized. #596 + ## 0.21.0 diff --git a/rye/src/piptools.rs b/rye/src/piptools.rs index e2e64bbe62..db5f1fa76d 100644 --- a/rye/src/piptools.rs +++ b/rye/src/piptools.rs @@ -34,7 +34,7 @@ impl PipToolsVersion { fn get_pip_tools_bin(py_ver: &PythonVersion, output: CommandOutput) -> Result { let self_venv = ensure_self_venv(output)?; - let venv = get_pip_tools_venv(py_ver); + let venv = get_pip_tools_venv_path(py_ver); let py = get_venv_python_bin(&venv); let version = get_pip_tools_version(py_ver); @@ -77,7 +77,7 @@ pub fn get_pip_tools_version(py_ver: &PythonVersion) -> PipToolsVersion { } } -pub fn get_pip_tools_venv(py_ver: &PythonVersion) -> PathBuf { +pub fn get_pip_tools_venv_path(py_ver: &PythonVersion) -> PathBuf { let key = format!("{}@{}.{}", py_ver.name, py_ver.major, py_ver.minor); get_app_dir().join("pip-tools").join(key) } diff --git a/rye/src/sync.rs b/rye/src/sync.rs index 2ec15887f2..d4ab6f55eb 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -15,7 +15,7 @@ use crate::lock::{ make_project_root_fragment, update_single_project_lockfile, update_workspace_lockfile, LockMode, LockOptions, }; -use crate::piptools::{get_pip_sync, get_pip_tools_venv}; +use crate::piptools::{get_pip_sync, get_pip_tools_venv_path}; use crate::platform::get_toolchain_python_bin; use crate::pyproject::{read_venv_marker, ExpandedSources, PyProject}; use crate::sources::PythonVersion; @@ -247,15 +247,19 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { echo!("Installing dependencies"); } let tempdir = tempdir()?; + let mut pip_sync_cmd = Command::new(get_pip_sync(&py_ver, output)?); + let root = pyproject.workspace_path(); + let py_path = get_venv_python_bin(&venv); + + // we need to run this after we have run the `get_pip_sync` command + // as this is what bootstraps or updates the pip tools installation. + // This is needed as on unix platforms we need to search the module path. symlink_dir( - get_pip_module(&get_pip_tools_venv(&py_ver)).context("could not locate pip")?, + get_pip_module(&get_pip_tools_venv_path(&py_ver)) + .context("could not locate pip")?, tempdir.path().join("pip"), ) .context("failed linking pip module into for pip-sync")?; - let mut pip_sync_cmd = Command::new(get_pip_sync(&py_ver, output)?); - let root = pyproject.workspace_path(); - - let py_path = get_venv_python_bin(&venv); pip_sync_cmd .env("PROJECT_ROOT", make_project_root_fragment(&root)) From e72311698234aac238c8638c08c504557bb47db0 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 5 Feb 2024 23:38:16 +0100 Subject: [PATCH 109/166] Select latest compatible installed toolchain (#598) --- CHANGELOG.md | 3 +++ docs/guide/commands/pin.md | 6 ++++++ rye/src/piptools.rs | 10 ++++++++++ rye/src/platform.rs | 1 + rye/src/pyproject.rs | 13 +++++++++---- 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44f8149343..7bc2fd7155 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ _Unreleased_ - Fixed a bug where pip-tools sometimes did not get initialized. #596 +- Rye now prefers installed toolchains over newer latest toolchains unless + a precise pin is used. #598 + ## 0.21.0 diff --git a/docs/guide/commands/pin.md b/docs/guide/commands/pin.md index 96550d7281..424ce5c0ce 100644 --- a/docs/guide/commands/pin.md +++ b/docs/guide/commands/pin.md @@ -7,6 +7,12 @@ Additionally it will update `requires-python` in the `pyproject.toml` if it's lower than the current version. This can be disabled by passing `--no-update-requires-python`. +Which toolchain Rye prefers depends on the Rye version. From 0.22 onwards +the latest compatible installed toolchain is picked, and only if a non +existing one is found a download will be attempted. For older versions +Rye will always attempt to download the latest available if it's not +installed yet unless a precise pin is selected. + ## Example Pin a specific version of Python: diff --git a/rye/src/piptools.rs b/rye/src/piptools.rs index db5f1fa76d..38feb57300 100644 --- a/rye/src/piptools.rs +++ b/rye/src/piptools.rs @@ -1,3 +1,4 @@ +use std::fs; use std::path::PathBuf; use std::process::Command; @@ -39,10 +40,19 @@ fn get_pip_tools_bin(py_ver: &PythonVersion, output: CommandOutput) -> Result Option } // otherwise, any version we can download is an acceptable version + // by try to pin to something we already have. if target_version.is_none() { if let Some(version) = latest_available_python_version(req) { target_version = Some(version); diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index 290751d100..954e8e2aea 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -1065,7 +1065,8 @@ pub fn get_current_venv_python_version(venv_path: &Path) -> Option Option { @@ -1084,9 +1085,13 @@ pub fn latest_available_python_version( Vec::new() }; - if let Some((latest, _, _)) = get_download_url(requested_version) { - all.push(latest); - }; + // if we don't have a match yet, try to fill it in with the latest + // version we are capable of fetching from the internet. + if all.is_empty() { + if let Some((latest, _, _)) = get_download_url(requested_version) { + all.push(latest); + }; + } all.sort(); all.into_iter().next_back() From 24a655ef72b6ca448ffe373bcbb1ae5a8f3b536c Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 6 Feb 2024 17:16:59 +0100 Subject: [PATCH 110/166] Fix the incorrect version range for internal toolchains --- docs/.includes/installer-options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/.includes/installer-options.md b/docs/.includes/installer-options.md index ee6b46e876..4f87db723e 100644 --- a/docs/.includes/installer-options.md +++ b/docs/.includes/installer-options.md @@ -4,4 +4,4 @@ interpreter that should be used as the internal interpreter. If not provided a suitable interpreter is automatically downloaded. - At present only CPython 3.9 to 3.11 are supported. + At present only CPython 3.9 to 3.12 are supported. From ee92aeb4a504942278ae8a7d7a6d940e88570213 Mon Sep 17 00:00:00 2001 From: Gabriele Belluardo Date: Tue, 6 Feb 2024 19:51:49 +0100 Subject: [PATCH 111/166] Remove shell command (#602) --- docs/guide/commands/index.md | 1 - docs/guide/commands/shell.md | 32 ---------- rye/src/cli/mod.rs | 3 - rye/src/cli/shell.rs | 112 ----------------------------------- 4 files changed, 148 deletions(-) delete mode 100644 docs/guide/commands/shell.md delete mode 100644 rye/src/cli/shell.rs diff --git a/docs/guide/commands/index.md b/docs/guide/commands/index.md index 92897a7fef..3fedf90ee8 100644 --- a/docs/guide/commands/index.md +++ b/docs/guide/commands/index.md @@ -16,7 +16,6 @@ This is a list of all the commands that rye provides: * [publish](publish.md): Publish packages to a package repository * [remove](remove.md): Remove a dependency from this project * [run](run.md): Runs a command installed into this package -* [shell](shell.md): Spawns a shell with the virtualenv activated * [show](show.md): Prints the current state of the project * [sync](sync.md): Updates the virtualenv based on the pyproject.toml * [toolchain](toolchain/index.md): Helper utility to manage Python toolchains diff --git a/docs/guide/commands/shell.md b/docs/guide/commands/shell.md deleted file mode 100644 index 418abfe38e..0000000000 --- a/docs/guide/commands/shell.md +++ /dev/null @@ -1,32 +0,0 @@ -# `shell` - -Spawns a shell with the virtualenv activated. - -**Warning:** this feature is inherently buggy as shells do not support portable APIs -to enable this functionality. This command might to away if it cannot be fixed. - -## Example - -Run a tool from the virtualenv: - -``` -$ rye shell -Spawning virtualenv shell from /Users/username/my-project/.venv -Leave shell with 'exit' -``` - -To exit the sub shell run `exit`. - -## Arguments - -*no arguments* - -## Options - -* `--no-banner`: Do not show banner - -* `--allow-nested`: Allow nested invocations - -* `--pyproject`: Use this `pyproject.toml` file - -* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/rye/src/cli/mod.rs b/rye/src/cli/mod.rs index e428798475..8701c648b0 100644 --- a/rye/src/cli/mod.rs +++ b/rye/src/cli/mod.rs @@ -18,7 +18,6 @@ mod publish; mod remove; mod run; mod rye; -mod shell; mod shim; mod show; mod sync; @@ -63,7 +62,6 @@ enum Command { Publish(publish::Args), Remove(remove::Args), Run(run::Args), - Shell(shell::Args), Show(show::Args), Sync(sync::Args), Toolchain(toolchain::Args), @@ -123,7 +121,6 @@ pub fn execute() -> Result<(), Error> { Command::Publish(cmd) => publish::execute(cmd), Command::Remove(cmd) => remove::execute(cmd), Command::Run(cmd) => run::execute(cmd), - Command::Shell(cmd) => shell::execute(cmd), Command::Show(cmd) => show::execute(cmd), Command::Sync(cmd) => sync::execute(cmd), Command::Toolchain(cmd) => toolchain::execute(cmd), diff --git a/rye/src/cli/shell.rs b/rye/src/cli/shell.rs deleted file mode 100644 index 4c70395bf6..0000000000 --- a/rye/src/cli/shell.rs +++ /dev/null @@ -1,112 +0,0 @@ -use std::env; -use std::path::PathBuf; -use std::process; -use std::process::Command; - -use anyhow::{bail, Context, Error}; -use clap::Parser; -use console::style; -use sysinfo::{Pid, PidExt, ProcessExt, System, SystemExt}; - -use crate::consts; -use crate::pyproject::PyProject; -use crate::sync::{sync, SyncOptions}; -use crate::tui::redirect_to_stderr; -use crate::utils::QuietExit; - -/// Spawns a shell with the virtualenv activated. -#[derive(Parser, Debug)] -pub struct Args { - /// Do not show banner - #[arg(long)] - no_banner: bool, - /// Allow nested invocations. - #[arg(long)] - allow_nested: bool, - /// Use this pyproject.toml file - #[arg(long, value_name = "PYPROJECT_TOML")] - pyproject: Option, -} - -fn get_shell() -> Result { - let shell_env = env::var("SHELL"); - if let Ok(shell) = shell_env { - return Ok(shell); - } - - let mut system = System::default(); - system.refresh_processes(); - - let mut pid = Some(Pid::from_u32(process::id())); - while let Some(p) = pid { - if let Some(process) = system.process(p) { - let name = process.name(); - if let "cmd.exe" | "powershell.exe" | "pwsh.exe" = name { - return Ok(String::from(name)); - } else { - pid = process.parent(); - continue; - } - } - break; - } - - Err(anyhow::anyhow!("don't know which shell is used")) -} - -fn is_ms_shells(shell: &str) -> bool { - matches!(shell, "cmd.exe" | "powershell.exe" | "pwsh.exe") -} - -pub fn execute(cmd: Args) -> Result<(), Error> { - if !cmd.allow_nested && env::var("__RYE_SHELL").ok().as_deref() == Some("1") { - bail!("cannot invoke recursive rye shell"); - } - - warn!("this command is quite buggy and recommended against. Please activate the virtualenv instead."); - - let _guard = redirect_to_stderr(true); - let pyproject = PyProject::load_or_discover(cmd.pyproject.as_deref())?; - sync(SyncOptions::python_only().pyproject(cmd.pyproject)) - .context("failed to sync ahead of shell")?; - - let venv_path = pyproject.venv_path(); - let venv_bin = venv_path.join(consts::VENV_BIN); - - let s = get_shell()?; - let sep = if is_ms_shells(s.as_str()) { ";" } else { ":" }; - let args = if !is_ms_shells(s.as_str()) { - vec!["-l"] - } else { - vec![] - }; - let mut shell = Command::new(s.as_str()); - shell.args(args).env("VIRTUAL_ENV", &*venv_path); - - if let Some(path) = env::var_os("PATH") { - let mut new_path = venv_bin.as_os_str().to_owned(); - new_path.push(sep); - new_path.push(path); - shell.env("PATH", new_path); - } else { - shell.env("PATH", &*venv_bin); - } - shell.env_remove("PYTHONHOME"); - shell.env("__RYE_SHELL", "1"); - - if !cmd.no_banner { - echo!( - "Spawning virtualenv shell from {}", - style(&venv_path.display()).cyan() - ); - echo!("Leave shell with 'exit'"); - } - - let status = shell.status()?; - if !status.success() { - let code = status.code().unwrap_or(1); - Err(QuietExit(code).into()) - } else { - Ok(()) - } -} From 08910bc9b3b7c72a3d3ac694c4f3412259161477 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 6 Feb 2024 19:55:10 +0100 Subject: [PATCH 112/166] Add a hint about the removed shell command --- CHANGELOG.md | 2 ++ rye/src/cli/mod.rs | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bc2fd7155..6d3961255d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ _Unreleased_ - Rye now prefers installed toolchains over newer latest toolchains unless a precise pin is used. #598 +- Removed the non functional `shell` command. #602 + ## 0.21.0 diff --git a/rye/src/cli/mod.rs b/rye/src/cli/mod.rs index 8701c648b0..4ed1f5247e 100644 --- a/rye/src/cli/mod.rs +++ b/rye/src/cli/mod.rs @@ -72,6 +72,8 @@ enum Command { Version(version::Args), #[command(hide = true)] List(list::Args), + #[command(hide = true)] + Shell(shell::Args), } pub mod list { @@ -82,6 +84,12 @@ pub mod list { pub struct Args {} } +pub mod shell { + /// The shell command was removed. + #[derive(clap::Parser, Debug)] + pub struct Args {} +} + pub fn execute() -> Result<(), Error> { // common initialization crate::platform::init()?; @@ -133,6 +141,16 @@ pub fn execute() -> Result<(), Error> { // user should be using instead. bail!("unknown command. Maybe you mean rye show --installed-deps"); } + Command::Shell(..) => { + bail!( + "unknown command. The shell command was removed. Activate the virtualenv instead with '{}' instead.", + if cfg!(windows) { + ".venv\\Scripts\\activate" + } else { + ". .venv/bin/activate" + } + ); + } } } From dbfdeeb90110e87754498d46ac46fca65578e80a Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 7 Feb 2024 09:14:44 +0100 Subject: [PATCH 113/166] Fix self docs --- docs/guide/commands/self/completion.md | 24 +++++++++++++- docs/guide/commands/self/uninstall.md | 25 ++++++++++++++- docs/guide/commands/self/update.md | 43 +++++++++++++++++++++++++- 3 files changed, 89 insertions(+), 3 deletions(-) mode change 120000 => 100644 docs/guide/commands/self/completion.md mode change 120000 => 100644 docs/guide/commands/self/uninstall.md mode change 120000 => 100644 docs/guide/commands/self/update.md diff --git a/docs/guide/commands/self/completion.md b/docs/guide/commands/self/completion.md deleted file mode 120000 index fecfb581f0..0000000000 --- a/docs/guide/commands/self/completion.md +++ /dev/null @@ -1 +0,0 @@ -../fetch.md \ No newline at end of file diff --git a/docs/guide/commands/self/completion.md b/docs/guide/commands/self/completion.md new file mode 100644 index 0000000000..5631ae0e5e --- /dev/null +++ b/docs/guide/commands/self/completion.md @@ -0,0 +1,23 @@ +# `completion` + +Generates a completion script for a shell + +## Example + +Generate a completion script for zsh and load it: + +``` +$ eval (rye self completion -s zsh) +``` + +## Arguments + +_no arguments_ + +## Options + +* `-s, --shell `: The shell to generate a completion script for (defaults to 'bash') + + [possible values: `bash`, `elvish`, `fish`, `powershell`, `zsh`] + +* `-h, --help`: Print help (see a summary with '-h') diff --git a/docs/guide/commands/self/uninstall.md b/docs/guide/commands/self/uninstall.md deleted file mode 120000 index fecfb581f0..0000000000 --- a/docs/guide/commands/self/uninstall.md +++ /dev/null @@ -1 +0,0 @@ -../fetch.md \ No newline at end of file diff --git a/docs/guide/commands/self/uninstall.md b/docs/guide/commands/self/uninstall.md new file mode 100644 index 0000000000..c4048c1a7b --- /dev/null +++ b/docs/guide/commands/self/uninstall.md @@ -0,0 +1,24 @@ +# `uninstall` + +Uninstalls rye again. Note that this leaves a trace +`.rye` folder behind with an empty `env` file. You also +need to remove the sourcing of that script from your +`.profile` file. + +## Example + +Uninstall rye without asking: + +``` +$ rye self uninstall --yes +``` + +## Arguments + +_no arguments_ + +## Options + +* `-y, --yes`: Do not prompt and uninstall. + +* `-h, --help`: Print help (see a summary with '-h') diff --git a/docs/guide/commands/self/update.md b/docs/guide/commands/self/update.md deleted file mode 120000 index fecfb581f0..0000000000 --- a/docs/guide/commands/self/update.md +++ /dev/null @@ -1 +0,0 @@ -../fetch.md \ No newline at end of file diff --git a/docs/guide/commands/self/update.md b/docs/guide/commands/self/update.md new file mode 100644 index 0000000000..af93a124c6 --- /dev/null +++ b/docs/guide/commands/self/update.md @@ -0,0 +1,42 @@ +# `update` + +Performs an update of rye. + +This can install updates from the latest release binaries or trigger a manual +compilation of Rye if Rust is installed. + +## Example + +Update to the latest version: + +``` +$ rye self udpate +``` + +Update (or downgrade) to a specific version: + +``` +$ rye self update --version 0.20 +``` + +Compile a specific revision: + +``` +$ rye self update --rev 08910bc9b3b7c72a3d3ac694c4f3412259161477 +``` + +## Arguments + +_no arguments_ + +## Options + +* `--version `: Update to a specific version + +* `--tag `: Update to a specific tag + +* `--rev `: Update to a specific git rev + +* `--force`: Force reinstallation + +* `-h, --help`: Print help (see a summary with '-h') From 4ed0f87cc134a37bf7a68020524de1491873457c Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 7 Feb 2024 16:13:39 +0100 Subject: [PATCH 114/166] Fix typo --- docs/guide/commands/self/update.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/commands/self/update.md b/docs/guide/commands/self/update.md index af93a124c6..629c4ca352 100644 --- a/docs/guide/commands/self/update.md +++ b/docs/guide/commands/self/update.md @@ -10,7 +10,7 @@ compilation of Rye if Rust is installed. Update to the latest version: ``` -$ rye self udpate +$ rye self update ``` Update (or downgrade) to a specific version: From c734926baeffe23e87e40c483b7b891b4a184c4a Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 7 Feb 2024 23:45:02 +0100 Subject: [PATCH 115/166] Use create_dir_all to create virtualenvs (#612) --- rye/src/sync.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rye/src/sync.rs b/rye/src/sync.rs index d4ab6f55eb..e379adfcec 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -311,7 +311,7 @@ pub fn create_virtualenv( prompt: &str, ) -> Result<(), Error> { // create the venv folder first so we can manipulate some flags on it. - fs::create_dir(venv) + fs::create_dir_all(venv) .with_context(|| format!("unable to create virtualenv folder '{}'", venv.display()))?; update_venv_sync_marker(output, venv); From 676d5f7738931207c8ee24aa428f450a71e773b3 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 7 Feb 2024 23:59:56 +0100 Subject: [PATCH 116/166] Bump unearth to newer version (#614) --- CHANGELOG.md | 3 +++ rye/src/bootstrap.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d3961255d..cb603c99f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ _Unreleased_ - Removed the non functional `shell` command. #602 +- Upgraded internal unearth dependency which resolved an issue where + `rye add tensorflow` would not work. #614 + ## 0.21.0 diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index 2e2697b450..64036eed16 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -36,7 +36,7 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques suffix: None, }; -const SELF_VERSION: u64 = 9; +const SELF_VERSION: u64 = 10; const SELF_REQUIREMENTS: &str = r#" build==1.0.3 @@ -52,7 +52,7 @@ pyproject_hooks==1.0.0 requests==2.31.0 tomli==2.0.1 twine==4.0.2 -unearth==0.12.1 +unearth==0.14.0 urllib3==2.0.7 virtualenv==20.25.0 ruff==0.1.14 From f1b61b3b4b89eee672ad8ffb4d0eb5086eba88ed Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 8 Feb 2024 00:10:20 +0100 Subject: [PATCH 117/166] Added support for bootstrapping with specific toolchain version (#606) --- CHANGELOG.md | 2 + docs/.includes/installer-options.md | 9 +++ rye/src/bootstrap.rs | 87 +++++++++++++++++++++++------ rye/src/cli/rye.rs | 67 +++++++++++++++++----- rye/src/cli/shim.rs | 9 +-- 5 files changed, 138 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb603c99f6..18abf57120 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ _Unreleased_ - Upgraded internal unearth dependency which resolved an issue where `rye add tensorflow` would not work. #614 +- The installer now supports `RYE_TOOLCHAIN_VERSION`. #606 + ## 0.21.0 diff --git a/docs/.includes/installer-options.md b/docs/.includes/installer-options.md index 4f87db723e..f500fe257f 100644 --- a/docs/.includes/installer-options.md +++ b/docs/.includes/installer-options.md @@ -5,3 +5,12 @@ provided a suitable interpreter is automatically downloaded. At present only CPython 3.9 to 3.12 are supported. + +`RYE_TOOLCHAIN_VERSION` + +: For Rye 0.22 and later a specific Python version can be picked rather + than the default. This affects the internal toolchain version only. + It's useful for Docker builds where you can set the internal toolchain + to the same as your project to only fetch a single Python. + + At present only CPython 3.9 to 3.12 are supported. diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index 64036eed16..e0abce6382 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -6,7 +6,7 @@ use std::process::Command; use std::sync::atomic::{self, AtomicBool}; use std::{env, fs}; -use anyhow::{bail, Context, Error}; +use anyhow::{anyhow, bail, Context, Error}; use console::style; use indicatif::{ProgressBar, ProgressStyle}; use once_cell::sync::Lazy; @@ -19,6 +19,7 @@ use crate::platform::{ get_app_dir, get_canonical_py_path, get_toolchain_python_bin, list_known_toolchains, symlinks_supported, }; +use crate::pyproject::latest_available_python_version; use crate::sources::{get_download_url, PythonVersion, PythonVersionRequest}; use crate::utils::{ check_checksum, get_venv_python_bin, set_proxy_variables, symlink_file, unpack_archive, @@ -71,6 +72,14 @@ fn is_up_to_date() -> bool { /// Bootstraps the venv for rye itself pub fn ensure_self_venv(output: CommandOutput) -> Result { + ensure_self_venv_with_toolchain(output, None) +} + +/// Bootstraps the venv for rye itself +pub fn ensure_self_venv_with_toolchain( + output: CommandOutput, + toolchain_version_request: Option, +) -> Result { let app_dir = get_app_dir(); let venv_dir = app_dir.join("self"); let pip_tools_dir = app_dir.join("pip-tools"); @@ -94,12 +103,22 @@ pub fn ensure_self_venv(output: CommandOutput) -> Result { echo!("Bootstrapping rye internals"); } - let version = ensure_self_toolchain(output).with_context(|| { - format!( - "failed to fetch internal cpython toolchain {}", - SELF_PYTHON_TARGET_VERSION - ) - })?; + let version = match toolchain_version_request { + Some(ref version_request) => ensure_specific_self_toolchain(output, version_request) + .with_context(|| { + format!( + "failed to provision internal cpython toolchain {}", + version_request + ) + })?, + None => ensure_latest_self_toolchain(output).with_context(|| { + format!( + "failed to fetch internal cpython toolchain {}", + SELF_PYTHON_TARGET_VERSION + ) + })?, + }; + let py_bin = get_toolchain_python_bin(&version)?; // linux specific detection of shared libraries. @@ -313,23 +332,59 @@ pub fn is_self_compatible_toolchain(version: &PythonVersion) -> bool { version.name == "cpython" && version.major == 3 && version.minor >= 9 && version.minor <= 12 } -fn ensure_self_toolchain(output: CommandOutput) -> Result { - let possible_versions = list_known_toolchains()? +/// Ensure that the toolchain for the self environment is available. +fn ensure_latest_self_toolchain(output: CommandOutput) -> Result { + if let Some(version) = list_known_toolchains()? .into_iter() .map(|x| x.0) .filter(is_self_compatible_toolchain) - .collect::>(); - - if let Some(version) = possible_versions.into_iter().max() { - echo!( - "Found a compatible python version: {}", - style(&version).cyan() - ); + .collect::>() + .into_iter() + .max() + { + if output != CommandOutput::Quiet { + echo!( + "Found a compatible python version: {}", + style(&version).cyan() + ); + } Ok(version) } else { fetch(&SELF_PYTHON_TARGET_VERSION, output) } } + +/// Ensure a specific toolchain is available. +fn ensure_specific_self_toolchain( + output: CommandOutput, + toolchain_version_request: &PythonVersionRequest, +) -> Result { + let toolchain_version = latest_available_python_version(toolchain_version_request) + .ok_or_else(|| anyhow!("requested toolchain version is not available"))?; + if !is_self_compatible_toolchain(&toolchain_version) { + bail!( + "the requested toolchain version ({}) is not supported for rye-internal usage", + toolchain_version + ); + } + if !get_toolchain_python_bin(&toolchain_version)?.is_file() { + if output != CommandOutput::Quiet { + echo!( + "Fetching requested internal toolchain '{}'", + toolchain_version + ); + } + fetch(&toolchain_version.into(), output) + } else { + if output != CommandOutput::Quiet { + echo!( + "Found a compatible python version: {}", + style(&toolchain_version).cyan() + ); + } + Ok(toolchain_version) + } +} /// Fetches a version if missing. pub fn fetch( version: &PythonVersionRequest, diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index 3c254eccd1..1b53e2fc75 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -15,8 +15,8 @@ use self_replace::self_delete_outside_path; use tempfile::tempdir; use crate::bootstrap::{ - download_url, download_url_ignore_404, ensure_self_venv, is_self_compatible_toolchain, - update_core_shims, SELF_PYTHON_TARGET_VERSION, + download_url, download_url_ignore_404, ensure_self_venv_with_toolchain, + is_self_compatible_toolchain, update_core_shims, SELF_PYTHON_TARGET_VERSION, }; use crate::cli::toolchain::register_toolchain; use crate::config::Config; @@ -93,6 +93,9 @@ pub struct InstallCommand { /// Register a specific toolchain before bootstrap. #[arg(long)] toolchain: Option, + /// Use a specific toolchain version. + #[arg(long)] + toolchain_version: Option, } #[derive(Debug, Copy, Clone)] @@ -259,6 +262,7 @@ fn install(args: InstallCommand) -> Result<(), Error> { InstallMode::Default }, args.toolchain.as_deref(), + args.toolchain_version, ) } @@ -343,7 +347,11 @@ fn is_fish() -> bool { Shell::infer().map_or(false, |x| matches!(x, Shell::Fish)) } -fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<(), Error> { +fn perform_install( + mode: InstallMode, + toolchain_path: Option<&Path>, + toolchain_version: Option, +) -> Result<(), Error> { let mut config = Config::current(); let mut registered_toolchain: Option = None; let config_doc = Arc::make_mut(&mut config).doc_mut(); @@ -353,6 +361,26 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( let target = shims.join("rye").with_extension(EXE_EXTENSION); let mut prompt_for_toolchain_later = false; + // When we perform an install and a toolchain path has not been passed, + // we always also pick up on the RYE_TOOLCHAIN environment variable + // as a fallback. + let toolchain_path = match toolchain_path { + Some(path) => Some(Cow::Borrowed(path)), + None => env::var_os("RYE_TOOLCHAIN") + .map(PathBuf::from) + .map(Cow::Owned), + }; + + // Also pick up the target version from the RYE_TOOLCHAIN_VERSION + // environment variable. + let toolchain_version_request = match toolchain_version { + Some(version) => Some(version), + None => match env::var("RYE_TOOLCHAIN_VERSION") { + Ok(val) => Some(val.parse()?), + Err(_) => None, + }, + }; + echo!("{}", style("Welcome to Rye!").bold()); if matches!(mode, InstallMode::AutoInstall) { @@ -378,6 +406,18 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( echo!("{}", style("Details:").bold()); echo!(" Rye Version: {}", style(env!("CARGO_PKG_VERSION")).cyan()); echo!(" Platform: {} ({})", style(OS).cyan(), style(ARCH).cyan()); + if let Some(ref toolchain_path) = toolchain_path { + echo!( + " Internal Toolchain Path: {}", + style(toolchain_path.display()).cyan() + ); + } + if let Some(ref toolchain_version_request) = toolchain_version_request { + echo!( + " Internal Toolchain Version: {}", + style(toolchain_version_request).cyan() + ); + } if cfg!(windows) && !symlinks_supported() { echo!(); @@ -423,7 +463,12 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( // can fill in the default. if !matches!(mode, InstallMode::NoPrompts) { if toolchain_path.is_none() { - prompt_for_default_toolchain(SELF_PYTHON_TARGET_VERSION, config_doc)?; + prompt_for_default_toolchain( + toolchain_version_request + .clone() + .unwrap_or(SELF_PYTHON_TARGET_VERSION), + config_doc, + )?; } else { prompt_for_toolchain_later = true; } @@ -457,7 +502,7 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( "Registering toolchain at {}", style(toolchain_path.display()).cyan() ); - let version = register_toolchain(toolchain_path, None, |ver| { + let version = register_toolchain(&toolchain_path, None, |ver| { if ver.name != "cpython" { bail!("Only cpython toolchains are allowed, got '{}'", ver.name); } else if !is_self_compatible_toolchain(ver) { @@ -473,7 +518,8 @@ fn perform_install(mode: InstallMode, toolchain_path: Option<&Path>) -> Result<( } // Ensure internals next - let self_path = ensure_self_venv(CommandOutput::Normal)?; + let self_path = + ensure_self_venv_with_toolchain(CommandOutput::Normal, toolchain_version_request)?; echo!( "Updated self-python installation at {}", style(self_path.display()).cyan() @@ -576,10 +622,6 @@ pub fn auto_self_install() -> Result { return Ok(false); } - // auto install reads RYE_TOOLCHAIN to pre-register a - // regular toolchain. - let toolchain_path = env::var_os("RYE_TOOLCHAIN"); - let app_dir = get_app_dir(); let rye_exe = app_dir .join("shims") @@ -597,10 +639,7 @@ pub fn auto_self_install() -> Result { crate::request_continue_prompt(); } - perform_install( - InstallMode::AutoInstall, - toolchain_path.as_ref().map(Path::new), - )?; + perform_install(InstallMode::AutoInstall, None, None)?; Ok(true) } } diff --git a/rye/src/cli/shim.rs b/rye/src/cli/shim.rs index cc35942cdb..71cd0bd40e 100644 --- a/rye/src/cli/shim.rs +++ b/rye/src/cli/shim.rs @@ -13,7 +13,7 @@ use crate::config::Config; use crate::consts::VENV_BIN; use crate::platform::{get_python_version_request_from_pyenv_pin, get_toolchain_python_bin}; use crate::pyproject::{latest_available_python_version, PyProject}; -use crate::sources::{PythonVersion, PythonVersionRequest}; +use crate::sources::PythonVersionRequest; use crate::sync::{sync, SyncOptions}; use crate::tui::redirect_to_stderr; use crate::utils::{exec_spawn, get_venv_python_bin, CommandOutput}; @@ -253,11 +253,8 @@ fn get_shim_target( return find_shadowed_target(target, args); }; - let py_ver = match PythonVersion::try_from(version_request.clone()) { - Ok(py_ver) => py_ver, - Err(_) => latest_available_python_version(&version_request) - .ok_or_else(|| anyhow!("Unable to determine target Python version"))?, - }; + let py_ver = latest_available_python_version(&version_request) + .ok_or_else(|| anyhow!("Unable to determine target Python version"))?; let py = get_toolchain_python_bin(&py_ver)?; if !py.is_file() { let hint = if implicit_request { From 9f2f635264101648c07197bafee482c70f9bfde7 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 8 Feb 2024 09:25:40 +0100 Subject: [PATCH 118/166] Init fix for projects starting with digits (#616) --- CHANGELOG.md | 2 ++ rye/src/cli/init.rs | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18abf57120..cf870fb482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ _Unreleased_ - The installer now supports `RYE_TOOLCHAIN_VERSION`. #606 +- `rye init` will no longer create packages with leading digits. #616 + ## 0.21.0 diff --git a/rye/src/cli/init.rs b/rye/src/cli/init.rs index efcdec07ac..8156791e6a 100644 --- a/rye/src/cli/init.rs +++ b/rye/src/cli/init.rs @@ -317,6 +317,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { .map(|x| x.to_string_lossy().into_owned()) .unwrap_or_else(|| "unknown".into()) })); + let version = "0.1.0"; let author = get_default_author_with_fallback(&dir); let license = match cmd.license { @@ -416,7 +417,19 @@ pub fn execute(cmd: Args) -> Result<(), Error> { }; let private = cmd.private; - let name_safe = metadata.name.as_ref().unwrap().replace('-', "_"); + + // crate a python module safe name. This is the name on the metadata with + // underscores instead of dashes to form a valid python package name and in + // case it starts with a digit, an underscore is prepended. + let mut name_safe = metadata.name.as_ref().unwrap().replace('-', "_"); + if name_safe + .chars() + .next() + .map_or(true, |c| c.is_ascii_digit()) + { + name_safe.insert(0, '_'); + } + let is_rust = build_system == BuildSystem::Maturin; // if git init is successful prepare the local git repository @@ -478,7 +491,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { let name = metadata.name.expect("project name"); if is_rust { fs::create_dir_all(&src_dir).ok(); - let project_dir = dir.join("python").join(name.replace('-', "_")); + let project_dir = dir.join("python").join(&name_safe); fs::create_dir_all(&project_dir).ok(); let rv = env.render_named_str("lib.rs", LIB_RS_TEMPLATE, context! { name })?; fs::write(src_dir.join("lib.rs"), rv).context("failed to write lib.rs")?; @@ -501,7 +514,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { fs::write(project_dir.join("__init__.py"), rv) .context("failed to write __init__.py")?; } else { - let project_dir = src_dir.join(name.replace('-', "_")); + let project_dir = src_dir.join(&name_safe); fs::create_dir_all(&project_dir).ok(); let rv = env.render_named_str("__init__.py", INIT_PY_TEMPLATE, context! { name })?; From 574db36acbe529b44b56101a08bed516c7eb577e Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 8 Feb 2024 22:08:17 +0100 Subject: [PATCH 119/166] Add an FAQ entry for issue #621 --- docs/guide/faq.md | 15 +++++++++++++++ mkdocs.yml | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/guide/faq.md b/docs/guide/faq.md index 7e4f252269..015a8aa8a5 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -85,6 +85,21 @@ export PATH="/usr/bin:$PATH" curl -sSf https://rye-up.com/get | bash ``` +## References to Build-Time Paths + +The prefers using standalone Python builds. As Python historically is not much +accomodating 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 +extensions. There is no known solution to this problem today other than +[registering a non portable toolchain](toolchains/index.md#registering-toolchains). + +This issue is inherited from `python-build-standalone` and more informations can +be found in the documentation: [References to Build-Time Paths](https://gregoryszorc.com/docs/python-build-standalone/main/quirks.html#references-to-build-time-paths). There is also an open +Rye issue for it: [Issue #621](https://github.com/mitsuhiko/rye/issues/621). + ## TKinter Support TKinter uses TCL behind the scenes. Unfortunately this also means that some runtime diff --git a/mkdocs.yml b/mkdocs.yml index c2ebcfe45c..2949d291ab 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -37,7 +37,6 @@ nav: - publish: guide/commands/publish.md - remove: guide/commands/remove.md - run: guide/commands/run.md - - shell: guide/commands/shell.md - show: guide/commands/show.md - sync: guide/commands/sync.md - toolchain: From 3d6403782550c3b9b897b203701cf5e1f09ed20e Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 8 Feb 2024 22:10:51 +0100 Subject: [PATCH 120/166] Fix typos --- docs/guide/faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/faq.md b/docs/guide/faq.md index 015a8aa8a5..ba12167e5d 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -88,7 +88,7 @@ curl -sSf https://rye-up.com/get | bash ## References to Build-Time Paths The prefers using standalone Python builds. As Python historically is not much -accomodating to portable builds there are various limitations still with this +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 @@ -96,7 +96,7 @@ 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). -This issue is inherited from `python-build-standalone` and more informations can +This issue is inherited from `python-build-standalone` and more information can be found in the documentation: [References to Build-Time Paths](https://gregoryszorc.com/docs/python-build-standalone/main/quirks.html#references-to-build-time-paths). There is also an open Rye issue for it: [Issue #621](https://github.com/mitsuhiko/rye/issues/621). From ae7dedcde9c54fedc027e4a17558a9b713aa4290 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 9 Feb 2024 22:19:08 +0100 Subject: [PATCH 121/166] Statically link vsruntime (#622) --- Cargo.lock | 7 +++++++ rye/Cargo.toml | 3 +++ rye/build.rs | 6 ++++++ 3 files changed, 16 insertions(+) create mode 100644 rye/build.rs diff --git a/Cargo.lock b/Cargo.lock index 2937c16c58..f60d223aba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1830,6 +1830,7 @@ dependencies = [ "sha2", "shlex", "slug", + "static_vcruntime", "sysinfo", "tar", "tempfile", @@ -2049,6 +2050,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "static_vcruntime" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "954e3e877803def9dc46075bf4060147c55cd70db97873077232eae0269dc89b" + [[package]] name = "strsim" version = "0.10.0" diff --git a/rye/Cargo.toml b/rye/Cargo.toml index dc39d00d5a..d0027804c0 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -68,3 +68,6 @@ xattr = "1.3.1" [target."cfg(windows)".dependencies] winapi = { version = "0.3.9", default-features = false, features = [] } winreg = "0.52.0" + +[target."cfg(windows)".build-dependencies] +static_vcruntime = "2.0.0" diff --git a/rye/build.rs b/rye/build.rs new file mode 100644 index 0000000000..207fe53822 --- /dev/null +++ b/rye/build.rs @@ -0,0 +1,6 @@ +fn main() { + #[cfg(windows)] + { + static_vcruntime::metabuild(); + } +} From 58ad9ca39dc74e3c91fd40f4540080c107bf0b2d Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 9 Feb 2024 22:19:47 +0100 Subject: [PATCH 122/166] Added changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf870fb482..c9a7d6a886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,9 @@ _Unreleased_ - `rye init` will no longer create packages with leading digits. #616 +- Rye now statically links `vcruntime` on Windows which no longer requires + the vs redist to be installed. #622 + ## 0.21.0 From 62c5394ad65b611e121e0b9158ebf91ec9bf511f Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 9 Feb 2024 22:40:11 +0100 Subject: [PATCH 123/166] Move toml code into submodule --- rye/src/cli/rye.rs | 6 ++--- rye/src/pyproject.rs | 6 ++--- rye/src/utils/mod.rs | 59 ++----------------------------------------- rye/src/utils/toml.rs | 54 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 63 deletions(-) create mode 100644 rye/src/utils/toml.rs diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index 1b53e2fc75..c429b3a97f 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -22,7 +22,7 @@ use crate::cli::toolchain::register_toolchain; use crate::config::Config; use crate::platform::{get_app_dir, symlinks_supported}; use crate::sources::{get_download_url, PythonVersionRequest}; -use crate::utils::{check_checksum, ensure_toml_table, tui_theme, CommandOutput, QuietExit}; +use crate::utils::{check_checksum, toml, tui_theme, CommandOutput, QuietExit}; #[cfg(windows)] const DEFAULT_HOME: &str = "%USERPROFILE%\\.rye"; @@ -456,7 +456,7 @@ fn perform_install( .interact()? == 0) { - ensure_toml_table(config_doc, "behavior")["global-python"] = toml_edit::value(true); + toml::ensure_table(config_doc, "behavior")["global-python"] = toml_edit::value(true); // configure the default toolchain. If we are not using a pre-configured toolchain we // can ask now, otherwise we need to wait for the toolchain to be available before we @@ -612,7 +612,7 @@ fn prompt_for_default_toolchain( .ok_or_else(|| anyhow!("Unavailable version '{}'", version)) }) .interact_text()?; - ensure_toml_table(config_doc, "default")["toolchain"] = toml_edit::value(choice.to_string()); + toml::ensure_table(config_doc, "default")["toolchain"] = toml_edit::value(choice.to_string()); Ok(()) } diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index 954e8e2aea..99c40db299 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -20,7 +20,7 @@ use crate::sync::VenvMarker; use crate::utils::CommandOutput; use crate::utils::{ escape_string, expand_env_vars, format_requirement, get_short_executable_name, is_executable, - reformat_toml_array_multiline, + toml, }; use anyhow::{anyhow, bail, Context, Error}; use globset::GlobBuilder; @@ -1025,7 +1025,7 @@ fn set_dependency(deps: &mut Array, req: &Requirement) { } else { deps.push(formatted); } - reformat_toml_array_multiline(deps); + toml::reformat_array_multiline(deps); } fn remove_dependency(deps: &mut Array, req: &Requirement) -> Option { @@ -1046,7 +1046,7 @@ fn remove_dependency(deps: &mut Array, req: &Requirement) -> Option .remove(idx) .as_str() .and_then(|x| Requirement::from_str(x).ok()); - reformat_toml_array_multiline(deps); + toml::reformat_array_multiline(deps); rv } else { None diff --git a/rye/src/utils/mod.rs b/rye/src/utils/mod.rs index 0e97c105d9..f0c75f489d 100644 --- a/rye/src/utils/mod.rs +++ b/rye/src/utils/mod.rs @@ -11,7 +11,6 @@ use once_cell::sync::Lazy; use pep508_rs::{Requirement, VersionOrUrl}; use regex::{Captures, Regex}; use sha2::{Digest, Sha256}; -use toml_edit::{Array, RawString}; static ENV_VAR_RE: Lazy = Lazy::new(|| Regex::new(r"\$\{([A-Z0-9_]+)\}").unwrap()); @@ -35,6 +34,8 @@ pub(crate) mod windows; #[cfg(unix)] pub(crate) mod unix; +pub(crate) mod toml; + #[cfg(windows)] pub fn symlink_dir(original: P, link: Q) -> Result<(), std::io::Error> where @@ -379,62 +380,6 @@ pub fn check_checksum(content: &[u8], checksum: &str) -> Result<(), Error> { Ok(()) } -/// Reformats a TOML array to multi line while trying to -/// preserve all comments and move them around. This also makes -/// the array to have a trailing comma. -pub fn reformat_toml_array_multiline(deps: &mut Array) { - fn find_comments(s: Option<&RawString>) -> impl Iterator { - s.and_then(|x| x.as_str()) - .unwrap_or("") - .lines() - .filter_map(|line| { - let line = line.trim(); - line.starts_with('#').then_some(line) - }) - } - - for item in deps.iter_mut() { - let decor = item.decor_mut(); - let mut prefix = String::new(); - for comment in find_comments(decor.prefix()).chain(find_comments(decor.suffix())) { - prefix.push_str("\n "); - prefix.push_str(comment); - } - prefix.push_str("\n "); - decor.set_prefix(prefix); - decor.set_suffix(""); - } - - deps.set_trailing(&{ - let mut comments = find_comments(Some(deps.trailing())).peekable(); - let mut rv = String::new(); - if comments.peek().is_some() { - for comment in comments { - rv.push_str("\n "); - rv.push_str(comment); - } - } - rv.push('\n'); - rv - }); - deps.set_trailing_comma(true); -} - -/// Given a toml document, ensures that a given named table exists toplevel. -/// -/// The table is created as a non inline table which is the preferred style. -pub fn ensure_toml_table<'a>( - doc: &'a mut toml_edit::Document, - name: &str, -) -> &'a mut toml_edit::Item { - if doc.as_item().get(name).is_none() { - let mut tbl = toml_edit::Table::new(); - tbl.set_implicit(true); - doc.as_item_mut()[name] = toml_edit::Item::Table(tbl); - } - &mut doc.as_item_mut()[name] -} - pub fn escape_string(s: String) -> String { s.trim().replace(['\\', '"'], "") } diff --git a/rye/src/utils/toml.rs b/rye/src/utils/toml.rs new file mode 100644 index 0000000000..a4443b8225 --- /dev/null +++ b/rye/src/utils/toml.rs @@ -0,0 +1,54 @@ +use toml_edit::{Array, Document, Item, RawString, Table}; + +/// Given a toml document, ensures that a given named table exists toplevel. +/// +/// The table is created as a non inline table which is the preferred style. +pub fn ensure_table<'a>(doc: &'a mut Document, name: &str) -> &'a mut Item { + if doc.as_item().get(name).is_none() { + let mut tbl = Table::new(); + tbl.set_implicit(true); + doc.as_item_mut()[name] = Item::Table(tbl); + } + &mut doc.as_item_mut()[name] +} + +/// Reformats a TOML array to multi line while trying to +/// preserve all comments and move them around. This also makes +/// the array to have a trailing comma. +pub fn reformat_array_multiline(deps: &mut Array) { + fn find_comments(s: Option<&RawString>) -> impl Iterator { + s.and_then(|x| x.as_str()) + .unwrap_or("") + .lines() + .filter_map(|line| { + let line = line.trim(); + line.starts_with('#').then_some(line) + }) + } + + for item in deps.iter_mut() { + let decor = item.decor_mut(); + let mut prefix = String::new(); + for comment in find_comments(decor.prefix()).chain(find_comments(decor.suffix())) { + prefix.push_str("\n "); + prefix.push_str(comment); + } + prefix.push_str("\n "); + decor.set_prefix(prefix); + decor.set_suffix(""); + } + + deps.set_trailing(&{ + let mut comments = find_comments(Some(deps.trailing())).peekable(); + let mut rv = String::new(); + if comments.peek().is_some() { + for comment in comments { + rv.push_str("\n "); + rv.push_str(comment); + } + } + rv.push('\n'); + rv + }); + deps.set_trailing_comma(true); +} From 13c455f9f4a6e9efce810f609c56ff3935f97b40 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 9 Feb 2024 23:13:21 +0100 Subject: [PATCH 124/166] Add trojan info to FAQ --- docs/.includes/quick-install.md | 4 ++++ docs/guide/faq.md | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/docs/.includes/quick-install.md b/docs/.includes/quick-install.md index ec037685b6..689640f25a 100644 --- a/docs/.includes/quick-install.md +++ b/docs/.includes/quick-install.md @@ -56,6 +56,10 @@ the execution of the downloaded executable. If there is no obvious way to do so, click on "More info" on the error message that shows up and then on "Run anyway". + Additionally sometimes a Trojan warning about "Bearfoos" is shown. This is a false + positive. For more information see the discussion [Windows Bearfoos + virus associated with rye](https://github.com/mitsuhiko/rye/issues/468). + === "Compile Yourself" You need to have Rust and Cargo installed. If you don't have, you can use diff --git a/docs/guide/faq.md b/docs/guide/faq.md index ba12167e5d..b5205cfebd 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -180,3 +180,13 @@ of known supported cloud synchronization systems. For override this behavior you can set the `behavior.venv-mark-sync-ignore` configuration key to `false`. + +## Why Does Rye Contain Trojan "Bearfoos"? + +Unfortunately Windows likes to complain that Rye contains the trojan "Win32/Bearfoos.A!ml". +This seems to be something that happens to a few programs written in Rust every once in a +while because the compiler spits out some bytes that have been associated with Trojans +written in Rust. + +It can be ignored. For more information see the discussion [Windows Bearfoos +virus associated with rye](https://github.com/mitsuhiko/rye/issues/468). From 96c9dfd058d89c2f77a017fefb26b5a918eeedfe Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 9 Feb 2024 23:13:40 +0100 Subject: [PATCH 125/166] Show sources in rye show and support inline tables (#631) --- CHANGELOG.md | 2 ++ rye/src/cli/show.rs | 16 ++++++++++++++++ rye/src/config.rs | 4 +++- rye/src/pyproject.rs | 14 ++++++++++++-- rye/src/utils/toml.rs | 27 ++++++++++++++++++++++++++- 5 files changed, 59 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9a7d6a886..175815ec97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ _Unreleased_ - Rye now statically links `vcruntime` on Windows which no longer requires the vs redist to be installed. #622 +- `rye show` now prints out which sources are configured for a project. #631 + ## 0.21.0 diff --git a/rye/src/cli/show.rs b/rye/src/cli/show.rs index 305575c67f..d3903946b1 100644 --- a/rye/src/cli/show.rs +++ b/rye/src/cli/show.rs @@ -71,6 +71,22 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } } + match project.sources() { + Ok(mut sources) => { + sources.sort_by_cached_key(|x| (x.name != "default", x.name.to_string())); + echo!("configured sources:"); + for source in sources { + echo!( + " {} ({}: {})", + style(&source.name).cyan(), + style(&source.ty).yellow(), + style(&source.url).dim(), + ); + } + } + Err(err) => echo!("invalid source config: {}", style(err).red()), + } + Ok(()) } diff --git a/rye/src/config.rs b/rye/src/config.rs index bd2b9a97bc..d64a681247 100644 --- a/rye/src/config.rs +++ b/rye/src/config.rs @@ -11,6 +11,7 @@ use toml_edit::Document; use crate::platform::{get_app_dir, get_latest_cpython_version}; use crate::pyproject::{BuildSystem, SourceRef, SourceRefType}; use crate::sources::PythonVersionRequest; +use crate::utils::toml; static CONFIG: Mutex>> = Mutex::new(None); static AUTHOR_REGEX: Lazy = @@ -224,8 +225,9 @@ impl Config { pub fn sources(&self) -> Result, Error> { let mut rv = Vec::new(); let mut need_default = true; - if let Some(sources) = self.doc.get("sources").and_then(|x| x.as_array_of_tables()) { + 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)?; if source_ref.name == "default" { need_default = false; diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index 99c40db299..d311af74bc 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -116,6 +116,15 @@ impl FromStr for SourceRefType { } } +impl fmt::Display for SourceRefType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + SourceRefType::Index => write!(f, "index"), + SourceRefType::FindLinks => write!(f, "find-links"), + } + } +} + /// Represents a source. pub struct SourceRef { pub name: String, @@ -138,7 +147,7 @@ impl SourceRef { } } - pub fn from_toml_table(source: &Table) -> Result { + pub fn from_toml_table(source: &dyn TableLike) -> Result { let name = source .get("name") .and_then(|x| x.as_str()) @@ -1206,9 +1215,10 @@ fn get_sources(doc: &Document) -> Result, Error> { .get("tool") .and_then(|x| x.get("rye")) .and_then(|x| x.get("sources")) - .and_then(|x| x.as_array_of_tables()) + .map(|x| toml::iter_tables(x)) { 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)?; rv.push(source_ref); } diff --git a/rye/src/utils/toml.rs b/rye/src/utils/toml.rs index a4443b8225..087c316001 100644 --- a/rye/src/utils/toml.rs +++ b/rye/src/utils/toml.rs @@ -1,4 +1,5 @@ -use toml_edit::{Array, Document, Item, RawString, Table}; +use anyhow::{anyhow, bail, Error}; +use toml_edit::{Array, Document, Item, RawString, Table, TableLike}; /// Given a toml document, ensures that a given named table exists toplevel. /// @@ -52,3 +53,27 @@ pub fn reformat_array_multiline(deps: &mut Array) { }); deps.set_trailing_comma(true); } + +/// Iterate over tables in an array. +/// +/// This helps one iterate over +pub fn iter_tables<'x>( + item: &'x Item, +) -> Box> + 'x> { + if let Some(aot) = item.as_array_of_tables() { + Box::new(aot.into_iter().map(|x| Ok(x as &dyn TableLike))) + } else if let Some(arr) = item.as_array() { + Box::new(arr.into_iter().map(|x| match x.as_inline_table() { + Some(table) => Ok(table as &dyn TableLike), + None => bail!("expected inline table, got {}", x.type_name()), + })) + } else { + Box::new( + Some(Err(anyhow!( + "expected array of tables, got {}", + item.type_name() + ))) + .into_iter(), + ) + } +} From 203a0f33f3f4087bd68cfedd5480fb6d728f6c53 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 9 Feb 2024 23:15:49 +0100 Subject: [PATCH 126/166] 0.22.0 --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 175815ec97..aef1b15348 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. + + ## 0.22.0 -_Unreleased_ +Released on 2024-02-09 - Virtual envs managed by Rye will now by default be marked to not sync to known cloud storage systems (Dropbox and iCloud). #589 @@ -29,8 +31,6 @@ _Unreleased_ - `rye show` now prints out which sources are configured for a project. #631 - - ## 0.21.0 Released on 2024-02-03 From 089748728d4dbc6662537c9773321af623c3564b Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 9 Feb 2024 23:16:48 +0100 Subject: [PATCH 127/166] 0.23 ready for dev --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aef1b15348..21ac529e1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.23.0 + +_Unreleased_ + ## 0.22.0 diff --git a/Cargo.lock b/Cargo.lock index f60d223aba..5c95f3f96a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1792,7 +1792,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.22.0" +version = "0.23.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index d0027804c0..be9bc3b951 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.22.0" +version = "0.23.0" edition = "2021" license = "MIT" From bae3c954e48d6e0edb348b3154c1f91be20fb8c1 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 10 Feb 2024 13:36:26 +0100 Subject: [PATCH 128/166] No longer error on xattr removal if it fails (#633) --- CHANGELOG.md | 3 +++ rye/src/utils/mod.rs | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21ac529e1d..0c82038539 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ that were not yet released. _Unreleased_ +- When `behavior.venv-mark-sync-ignore` is set to `false` and the file system + does not support extended attributes, no longer will a warning be printed. #633 + ## 0.22.0 diff --git a/rye/src/utils/mod.rs b/rye/src/utils/mod.rs index f0c75f489d..97ef072858 100644 --- a/rye/src/utils/mod.rs +++ b/rye/src/utils/mod.rs @@ -54,7 +54,8 @@ where } /// Given the path to a folder this adds or removes a cloud sync flag -/// on the folder. +/// on the folder. Adding flags will return an error if it does not work, +/// removing flags is silently ignored. /// /// Today this only supports dropbox and apple icloud. pub fn mark_path_sync_ignore(venv: &Path, mark_ignore: bool) -> Result<(), Error> { @@ -64,7 +65,7 @@ pub fn mark_path_sync_ignore(venv: &Path, mark_ignore: bool) -> Result<(), Error if mark_ignore { xattr::set(venv, flag, b"1")?; } else { - xattr::remove(venv, flag)?; + xattr::remove(venv, flag).ok(); } } } From de398a6f2d1908ff7a46bdb49097a0d8f1069cff Mon Sep 17 00:00:00 2001 From: bluss Date: Sat, 10 Feb 2024 21:15:57 +0100 Subject: [PATCH 129/166] Use user namespace xattrs on linux and similar (#634) xattrs need a namespace on Linux, and user is the one that is user-writable. Dropbox seems to document that it will look at this attr. --- rye/src/utils/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rye/src/utils/mod.rs b/rye/src/utils/mod.rs index 97ef072858..77e4a8e7cb 100644 --- a/rye/src/utils/mod.rs +++ b/rye/src/utils/mod.rs @@ -61,7 +61,14 @@ where pub fn mark_path_sync_ignore(venv: &Path, mark_ignore: bool) -> Result<(), Error> { #[cfg(unix)] { - for flag in ["com.dropbox.ignored", "com.apple.fileprovider.ignore#P"] { + #[cfg(target_os = "macos")] + const ATTRS: &[&str] = &["com.dropbox.ignored", "com.apple.fileprovider.ignore#P"]; + + // xattrs need a namespace on Linux, and try this solution on every non-mac cfg(unix) system. + #[cfg(not(target_os = "macos"))] + const ATTRS: &[&str] = &["user.com.dropbox.ignored"]; + + for flag in ATTRS { if mark_ignore { xattr::set(venv, flag, b"1")?; } else { From 1812cc4bb09bf0a60a3d7dd41c67e74ed4bd73a9 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 10 Feb 2024 21:17:28 +0100 Subject: [PATCH 130/166] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c82038539..3bfcc29757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ _Unreleased_ - When `behavior.venv-mark-sync-ignore` is set to `false` and the file system does not support extended attributes, no longer will a warning be printed. #633 +- Fixed a bug that caused warnings about unsupported operations to be shown on Linux. #634 + ## 0.22.0 From d3099f61ea879edf5295bb3a803f8f9f7272094a Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Sun, 11 Feb 2024 09:56:28 +0000 Subject: [PATCH 131/166] rewrite find-downloads (#636) --- rye/find-downloads.py | 513 ++++++++++++++++++++++++++---------------- 1 file changed, 318 insertions(+), 195 deletions(-) diff --git a/rye/find-downloads.py b/rye/find-downloads.py index cc8fdf699c..7d8f3eec87 100644 --- a/rye/find-downloads.py +++ b/rye/find-downloads.py @@ -1,9 +1,30 @@ +"""This script is used to generate rye/src/downloads.inc. + +It find the latest python-build-standalone releases, sorts them by +various factors (arch, platform, flavor) and generates download +links to be included into rye at build time. In addition it maintains +a manual list of pypy downloads to be included into rye at build +time. +""" import re -import requests +import sys +import time +import unittest +from dataclasses import dataclass +from datetime import datetime, timezone +from enum import Enum from itertools import chain +from typing import Callable, Optional, Self from urllib.parse import unquote +import requests + + +def log(*args, **kwargs): + print(*args, file=sys.stderr, **kwargs) + +SESSION = requests.Session() TOKEN = open("token.txt").read().strip() RELEASE_URL = "https://api.github.com/repos/indygreg/python-build-standalone/releases" HEADERS = { @@ -14,10 +35,6 @@ "shared-pgo", "shared-noopt", "shared-noopt", - "static-noopt", - "gnu-pgo+lto", - "gnu-lto", - "gnu-pgo", "pgo+lto", "lto", "pgo", @@ -29,10 +46,12 @@ ] SPECIAL_TRIPLES = { "macos": "x86_64-apple-darwin", - "linux64": "x86_64-unknown-linux", - "windows-amd64": "x86_64-pc-windows", - "windows-x86": "i686-pc-windows", - "linux64-musl": "x86_64-unknown-linux", + "linux64": "x86_64-unknown-linux-gnu", + "windows-amd64": "x86_64-pc-windows-msvc", + "windows-x86-shared-pgo": "i686-pc-windows-msvc-shared-pgo", + "windows-amd64-shared-pgo": "x86_64 -pc-windows-msvc-shared-pgo", + "windows-x86": "i686-pc-windows-msvc", + "linux64-musl": "x86_64-unknown-linux-musl", } # matches these: https://doc.rust-lang.org/std/env/consts/constant.ARCH.html @@ -50,222 +69,326 @@ "linux": "linux", } -_filename_re = re.compile( - r"""(?x) - ^ - cpython-(?P\d+\.\d+\.\d+?) - (?:\+\d+)? - -(?P.*?) - (?:-[\dT]+)?\.tar\.(?:gz|zst) - $ -""" -) -_suffix_re = re.compile( - r"""(?x)^(.*?)-(%s)$""" - % ( - "|".join( - map( - re.escape, - sorted(FLAVOR_PREFERENCES + HIDDEN_FLAVORS, key=len, reverse=True), - ) - ) +ENV_MAPPING = { + "gnu": "gnu", + # We must ignore musl for now + # "musl": "musl", +} + + +@dataclass(frozen=True) +class PlatformTriple: + arch: str + platform: str + environment: Optional[str] + flavor: str + + @classmethod + def from_str(cls, triple: str) -> Optional[Self]: + """Parse a triple into a PlatformTriple object.""" + + # The parsing functions are all very similar and we could abstract them into a single function + # but I think it's clearer to keep them separate. + def match_flavor(triple): + for flavor in FLAVOR_PREFERENCES + HIDDEN_FLAVORS: + if flavor in triple: + return flavor + return "" + + def match_mapping(pieces: list[str], mapping: dict[str, str]): + for i in reversed(range(0, len(pieces))): + if pieces[i] in mapping: + return mapping[pieces[i]], pieces[:i] + return None, pieces + + # We split by '-' and match back to front to extract the flavor, env, platform and archk + arch, platform, env, flavor = None, None, None, None + + # Map, old, special triplets to proper triples for parsing, or + # return the triple if it's not a special one + triple = SPECIAL_TRIPLES.get(triple, triple) + pieces = triple.split("-") + flavor = match_flavor(triple) + env, pieces = match_mapping(pieces, ENV_MAPPING) + platform, pieces = match_mapping(pieces, PLATFORM_MAPPING) + arch, pieces = match_mapping(pieces, ARCH_MAPPING) + + if flavor is None or arch is None or platform is None: + return + + if env is None and platform == "linux": + return + + return cls(arch, platform, env, flavor) + + def grouped(self) -> tuple[str, str]: + # for now we only group by arch and platform, because rust's PythonVersion doesn't have a notion + # of environment. Flavor will never be used to sort download choices and must not be included in grouping. + return self.arch, self.platform + # return self.arch, self.platform, self.environment or "" + + +@dataclass(frozen=True, order=True) +class PythonVersion: + major: int + minor: int + patch: int + + @classmethod + def from_str(cls, version: str) -> Self: + return cls(*map(int, version.split(".", 3))) + + +@dataclass(frozen=True) +class IndygregDownload: + version: PythonVersion + triple: PlatformTriple + url: str + + FILENAME_RE = re.compile( + r"""(?x) + ^ + cpython-(?P\d+\.\d+\.\d+?) + (?:\+\d+)? + -(?P.*?) + (?:-[\dT]+)?\.tar\.(?:gz|zst) + $ + """ ) -) - - -def parse_filename(filename): - match = _filename_re.match(filename) - if match is None: - return - version, triple = match.groups() - if triple.endswith("-full"): - triple = triple[:-5] - match = _suffix_re.match(triple) - if match is not None: - triple, suffix = match.groups() - else: - suffix = None - return (version, triple, suffix) - - -def normalize_triple(triple): - if "-musl" in triple or "-static" in triple: - return - triple = SPECIAL_TRIPLES.get(triple, triple) - pieces = triple.split("-") - try: - arch = ARCH_MAPPING.get(pieces[0]) - if arch is None: + + @classmethod + def from_url(cls, url) -> Optional[Self]: + base_name = unquote(url.rsplit("/")[-1]) + if base_name.endswith(".sha256"): + return + + match = cls.FILENAME_RE.match(base_name) + if match is None: return - platform = PLATFORM_MAPPING.get(pieces[2]) - if platform is None: + + # Parse version string and triplet string + version_str, triple_str = match.groups() + version = PythonVersion.from_str(version_str) + triple = PlatformTriple.from_str(triple_str) + if triple is None: return - except IndexError: - return - return "%s-%s" % (arch, platform) - - -def read_sha256(url): - resp = sess.get(url + ".sha256", headers=HEADERS) - if not resp.ok: - return None - return resp.text.strip() - - -results = {} -sess = requests.Session() - -for page in range(1, 100): - resp = sess.get("%s?page=%d" % (RELEASE_URL, page), headers=HEADERS) - rows = resp.json() - if not rows: - break - for row in rows: - for asset in row["assets"]: - url = asset["browser_download_url"] - base_name = unquote(url.rsplit("/")[-1]) - if base_name.endswith(".sha256"): - continue - info = parse_filename(base_name) - if info is None: - continue - py_ver, triple, flavor = info - if "-static" in triple or (flavor and "noopt" in flavor): - continue - triple = normalize_triple(triple) - if triple is None: - continue - results.setdefault(py_ver, []).append((triple, flavor, url)) - - -def _sort_key(info): - triple, flavor, url = info - try: - pref = FLAVOR_PREFERENCES.index(flavor) - except ValueError: - pref = len(FLAVOR_PREFERENCES) + 1 - return pref - - -final_results = {} -for py_ver, choices in results.items(): - choices.sort(key=_sort_key) - urls = {} - for triple, flavor, url in choices: - triple = tuple(triple.split("-")) - if triple in urls: - continue - urls[triple] = url - final_results[tuple(map(int, py_ver.split(".")))] = urls + + return cls(version, triple, url) + + def sha256(self) -> Optional[str]: + """We only fetch the sha256 when needed. This generally is AFTER we have + decided that the download will be part of rye's download set""" + resp = fetch(self.url + ".sha256", headers=HEADERS) + if not resp.ok: + return None + return resp.text.strip() + + +def fetch(page, headers): + """Fetch a page from GitHub API with ratelimit awareness.""" + resp = SESSION.get(page, headers=headers, timeout=90) + if ( + resp.status_code in [403, 429] + and resp.headers.get("x-ratelimit-remaining") == "0" + ): + # See https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api?apiVersion=2022-11-28 + if (retry_after := resp.headers.get("retry-after")) is not None: + log("got retry-after header. retrying in {retry_after} seconds.") + time.sleep(int(retry_after)) + + return fetch(page, headers) + + if (retry_at := resp.headers.get("x-ratelimit-reset")) is not None: + utc = datetime.now(timezone.utc).timestamp() + retry_after = int(retry_at) - int(utc) + + log("got x-ratelimit-reset header. retrying in {retry_after} seconds.") + time.sleep(max(int(retry_at) - int(utc), 0)) + + return fetch(page, headers) + + log("got rate limited but no information how long. waiting for 2 minutes") + time.sleep(60 * 2) + return fetch(page, headers) + return resp + + +def fetch_indiygreg_downloads( + pages: int = 100, +) -> dict[PythonVersion, dict[PlatformTriple, list[IndygregDownload]]]: + """Fetch all the indygreg downloads from the release API.""" + results = {} + + for page in range(1, pages): + log(f"Fetching page {page}") + resp = fetch("%s?page=%d" % (RELEASE_URL, page), headers=HEADERS) + rows = resp.json() + if not rows: + break + for row in rows: + for asset in row["assets"]: + url = asset["browser_download_url"] + if (download := IndygregDownload.from_url(url)) is not None: + results.setdefault(download.version, {}).setdefault(download.triple.grouped(), []).append(download) + return results + + +def pick_best_download(downloads: list[IndygregDownload]) -> Optional[IndygregDownload]: + """Pick the best download from the list of downloads.""" + + def preference(download: IndygregDownload) -> int: + try: + return FLAVOR_PREFERENCES.index(download.triple.flavor) + except ValueError: + return len(FLAVOR_PREFERENCES) + 1 + + downloads.sort(key=preference) + return downloads[0] if downloads else None + + +def render( + indys: dict[PythonVersion, list[IndygregDownload]], + pypy: dict[PythonVersion, dict[PlatformTriple, str]], +): + """Render downloads.inc""" + log("Generating code and fetching sha256 of all cpython downloads.") + log("This can be slow......") + + print("// generated code, do not edit") + print("use std::borrow::Cow;") + print("pub const PYTHON_VERSIONS: &[(PythonVersion, &str, Option<&str>)] = &[") + + for version, downloads in sorted(pypy.items(), key=lambda v: v[0], reverse=True): + for triple, url in sorted(downloads.items(), key=lambda v: v[0].grouped()): + print( + f' (PythonVersion {{ name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("{triple.arch}"), os: Cow::Borrowed("{triple.platform}"), major: {version.major}, minor: {version.minor}, patch: {version.patch}, suffix: None }}, "{url}", None),' + ) + + for version, downloads in sorted(indys.items(), key=lambda v: v[0], reverse=True): + for download in sorted(downloads, key=lambda v: v.triple.grouped()): + if (sha256 := download.sha256()) is not None: + sha256_str = f'Some("{sha256}")' + else: + sha256_str = "None" + print( + f' (PythonVersion {{ name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("{download.triple.arch}"), os: Cow::Borrowed("{download.triple.platform}"), major: {version.major}, minor: {version.minor}, patch: {version.patch}, suffix: None }}, "{download.url}", {sha256_str}),' + ) + print("];") + + +def main(): + log("Rye download creator started.") + log("Fetching indygreg downloads...") + + indys = {} + # For every version, pick the best download per triple + # and store it in the results + for version, download_choices in fetch_indiygreg_downloads(100).items(): + # Create a dict[PlatformTriple, list[IndygregDownload]]] + # for each version + for triple, choices in download_choices.items(): + if (best_download := pick_best_download(choices)) is not None: + indys.setdefault(version, []).append(best_download) + + render(indys, PYPY_DOWNLOADS) # These are manually maintained for now PYPY_DOWNLOADS = { - (3, 10, 12): { - ( - "x86_64", - "linux", + PythonVersion(3, 10, 12): { + PlatformTriple( + arch="x86_64", platform="linux", environment="gnu", flavor="" ): "https://downloads.python.org/pypy/pypy3.10-v7.3.12-linux64.tar.bz2", - ( - "aarch64", - "linux", + PlatformTriple( + arch="aarch64", platform="linux", environment="gnu", flavor="" ): "https://downloads.python.org/pypy/pypy3.10-v7.3.12-aarch64.tar.bz2", - ( - "x86_64", - "macos", + PlatformTriple( + arch="x86_64", platform="macos", environment=None, flavor="" ): "https://downloads.python.org/pypy/pypy3.10-v7.3.12-macos_x86_64.tar.bz2", - ( - "aarch64", - "macos", + PlatformTriple( + arch="aarch64", platform="macos", environment=None, flavor="" ): "https://downloads.python.org/pypy/pypy3.10-v7.3.12-macos_arm64.tar.bz2", - ( - "x86_64", - "windows", + PlatformTriple( + arch="x86_64", platform="windows", environment=None, flavor="" ): "https://downloads.python.org/pypy/pypy3.10-v7.3.12-win64.zip", }, - (3, 9, 16): { - ( - "x86_64", - "linux", + PythonVersion(3, 9, 16): { + PlatformTriple( + arch="x86_64", platform="linux", environment="gnu", flavor="" ): "https://downloads.python.org/pypy/pypy3.9-v7.3.11-linux64.tar.bz2", - ( - "aarch64", - "linux", + PlatformTriple( + arch="aarch64", platform="linux", environment="gnu", flavor="" ): "https://downloads.python.org/pypy/pypy3.9-v7.3.11-aarch64.tar.bz2", - ( - "x86_64", - "macos", + PlatformTriple( + arch="x86_64", platform="macos", environment=None, flavor="" ): "https://downloads.python.org/pypy/pypy3.9-v7.3.11-macos_x86_64.tar.bz2", - ( - "aarch64", - "macos", + PlatformTriple( + arch="aarch64", platform="macos", environment=None, flavor="" ): "https://downloads.python.org/pypy/pypy3.9-v7.3.11-macos_arm64.tar.bz2", - ( - "x86_64", - "windows", + PlatformTriple( + arch="x86_64", platform="windows", environment=None, flavor="" ): "https://downloads.python.org/pypy/pypy3.9-v7.3.11-win64.zip", }, - (3, 8, 16): { - ( - "x86_64", - "linux", + PythonVersion(3, 8, 16): { + PlatformTriple( + arch="x86_64", platform="linux", environment="gnu", flavor="" ): "https://downloads.python.org/pypy/pypy3.8-v7.3.11-linux64.tar.bz2", - ( - "aarch64", - "linux", + PlatformTriple( + arch="aarch64", platform="linux", environment="gnu", flavor="" ): "https://downloads.python.org/pypy/pypy3.8-v7.3.11-aarch64.tar.bz2", - ( - "x86_64", - "macos", + PlatformTriple( + arch="x86_64", platform="macos", environment=None, flavor="" ): "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_x86_64.tar.bz2", - ( - "aarch64", - "macos", + PlatformTriple( + arch="aarch64", platform="macos", environment=None, flavor="" ): "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_arm64.tar.bz2", - ( - "x86_64", - "windows", + PlatformTriple( + arch="x86_64", platform="windows", environment=None, flavor="" ): "https://downloads.python.org/pypy/pypy3.8-v7.3.11-win64.zip", }, - (3, 7, 13): { - ( - "x86_64", - "linux", + PythonVersion(3, 7, 13): { + PlatformTriple( + arch="x86_64", platform="linux", environment="gnu", flavor="" ): "https://downloads.python.org/pypy/pypy3.7-v7.3.9-linux64.tar.bz2", - ( - "aarch64", - "linux", + PlatformTriple( + arch="aarch64", platform="linux", environment="gnu", flavor="" ): "https://downloads.python.org/pypy/pypy3.7-v7.3.9-aarch64.tar.bz2", - ( - "x86_64", - "macos", + PlatformTriple( + arch="x86_64", platform="macos", environment=None, flavor="" ): "https://downloads.python.org/pypy/pypy3.7-v7.3.9-osx64.tar.bz2", - ( - "x86_64", - "windows", + PlatformTriple( + arch="x86_64", platform="windows", environment=None, flavor="" ): "https://downloads.python.org/pypy/pypy3.7-v7.3.9-win64.zip", }, } +if __name__ == "__main__": + main() -print("// generated code, do not edit") -print("use std::borrow::Cow;") -print( - "pub const PYTHON_VERSIONS: &[(PythonVersion, &str, Option<&str>)] = &[" -) -for interpreter, py_ver, choices in sorted( - chain( - (("cpython",) + x for x in final_results.items()), - (("pypy",) + x for x in PYPY_DOWNLOADS.items()), - ), - key=lambda x: x[:2], - reverse=True, -): - for (arch, platform), url in sorted(choices.items()): - sha256 = read_sha256(url) - sha256 = 'Some("%s")' % sha256 if sha256 else "None" - print( - ' (PythonVersion { name: Cow::Borrowed("%s"), arch: Cow::Borrowed("%s"), os: Cow::Borrowed("%s"), major: %d, minor: %d, patch: %d, suffix: None }, "%s", %s),' - % ((interpreter, arch, platform) + py_ver + (url, sha256)) - ) -print("];") + +class Tests(unittest.TestCase): + def test_parse_triplets(self): + expected = { + "aarch64-apple-darwin-lto": PlatformTriple("aarch64", "macos", None, "lto"), + "aarch64-unknown-linux-gnu-pgo+lto": PlatformTriple( + "aarch64", "linux", "gnu", "pgo+lto" + ), + # "x86_64-unknown-linux-musl-debug": PlatformTriple( + # "x86_64", "linux", "musl", "debug" + # ), + "aarch64-unknown-linux-gnu-debug-full": PlatformTriple( + "aarch64", "linux", "gnu", "debug" + ), + "x86_64-unknown-linux-gnu-debug": PlatformTriple( + "x86_64", "linux", "gnu", "debug" + ), + "linux64": PlatformTriple("x86_64", "linux", "gnu", ""), + "ppc64le-unknown-linux-gnu-noopt-full": None, + "x86_64_v3-unknown-linux-gnu-lto": None, + "x86_64-pc-windows-msvc-shared-pgo": PlatformTriple( + "x86_64", "windows", None, "shared-pgo" + ), + } + + for input, expected in expected.items(): + self.assertEqual(PlatformTriple.from_str(input), expected, input) From a3f563b9613630a58bddd3f20ce82f5f7442ce84 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 11 Feb 2024 14:07:05 +0100 Subject: [PATCH 132/166] Only update venv cloud sync marker when creating virtualenvs (#638) --- CHANGELOG.md | 2 ++ rye/src/sync.rs | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bfcc29757..85d06a807a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ _Unreleased_ - Fixed a bug that caused warnings about unsupported operations to be shown on Linux. #634 +- The venv sync marker is now only updated when a new virtualenv is created. #638 + ## 0.22.0 diff --git a/rye/src/sync.rs b/rye/src/sync.rs index e379adfcec..0874e4bc9d 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -159,7 +159,6 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { { echo!("Reusing already existing virtualenv"); } - update_venv_sync_marker(output, &venv); } else { if output != CommandOutput::Quiet { echo!( From 2b2fa52b2fa8fd268303bb21f26c58c20aac8590 Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Sun, 11 Feb 2024 21:27:20 +0000 Subject: [PATCH 133/166] Add token.txt to .gitignore (#642) --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c3776a0f64..f9af4fa305 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ target /x site __pycache__ -.idea \ No newline at end of file +.idea +token.txt From 7066e683d46e5fa8c0859aca7ed7e5d570c440ea Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Sun, 11 Feb 2024 21:27:46 +0000 Subject: [PATCH 134/166] fix typo (#641) --- rye/find-downloads.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rye/find-downloads.py b/rye/find-downloads.py index 7d8f3eec87..fed44deabb 100644 --- a/rye/find-downloads.py +++ b/rye/find-downloads.py @@ -49,7 +49,7 @@ def log(*args, **kwargs): "linux64": "x86_64-unknown-linux-gnu", "windows-amd64": "x86_64-pc-windows-msvc", "windows-x86-shared-pgo": "i686-pc-windows-msvc-shared-pgo", - "windows-amd64-shared-pgo": "x86_64 -pc-windows-msvc-shared-pgo", + "windows-amd64-shared-pgo": "x86_64-pc-windows-msvc-shared-pgo", "windows-x86": "i686-pc-windows-msvc", "linux64-musl": "x86_64-unknown-linux-musl", } From 41efe9794d2c7970ae8734e0230335ff9ac58af6 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 11 Feb 2024 22:39:33 +0100 Subject: [PATCH 135/166] Added changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d06a807a..0e64e58f96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ _Unreleased_ - The venv sync marker is now only updated when a new virtualenv is created. #638 +- Lockfiles now contain annotations. #643 + ## 0.22.0 From 63c66b11b8e270bb997ba23e94afa4960061eb75 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 11 Feb 2024 22:40:14 +0100 Subject: [PATCH 136/166] Add annotations to lockfile and simplify workspace locking (#643) --- requirements-dev.lock | 38 ++++++++++++++++++++++++++++++++++++++ requirements.lock | 38 ++++++++++++++++++++++++++++++++++++++ rye/src/lock.rs | 37 +++++++++++++++++-------------------- 3 files changed, 93 insertions(+), 20 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 847c1aa1ab..5879576ddc 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -8,31 +8,69 @@ # with-sources: false -e file:. + # from workspace certifi==2023.5.7 + # via requests charset-normalizer==3.1.0 + # via requests click==8.1.3 + # via mkdocs colorama==0.4.6 + # via mkdocs-material ghp-import==2.1.0 + # via mkdocs idna==3.4 + # via requests jinja2==3.1.2 + # via mkdocs + # via mkdocs-material markdown==3.3.7 + # via mdx-gh-links + # via mkdocs + # via mkdocs-material + # via pymdown-extensions markupsafe==2.1.2 + # via jinja2 mdx-gh-links==0.3 + # via rye-dev mergedeep==1.3.4 + # via mkdocs mkdocs==1.4.3 + # via mkdocs-material + # via mkdocs-simple-hooks + # via rye-dev mkdocs-include-markdown-plugin==4.0.4 + # via rye-dev mkdocs-material==9.1.12 + # via rye-dev mkdocs-material-extensions==1.1.1 + # via mkdocs-material mkdocs-simple-hooks==0.1.5 + # via rye-dev mkdocs-version-annotations==1.0.0 + # via rye-dev packaging==23.1 + # via mkdocs pygments==2.15.1 + # via mkdocs-material pymdown-extensions==9.11 + # via mkdocs-material + # via rye-dev python-dateutil==2.8.2 + # via ghp-import pyyaml==6.0 + # via mkdocs + # via pymdown-extensions + # via pyyaml-env-tag pyyaml-env-tag==0.1 + # via mkdocs regex==2023.5.5 + # via mkdocs-material requests==2.30.0 + # via mkdocs-material six==1.16.0 + # via python-dateutil urllib3==2.0.2 + # via requests watchdog==3.0.0 + # via mkdocs diff --git a/requirements.lock b/requirements.lock index 847c1aa1ab..5879576ddc 100644 --- a/requirements.lock +++ b/requirements.lock @@ -8,31 +8,69 @@ # with-sources: false -e file:. + # from workspace certifi==2023.5.7 + # via requests charset-normalizer==3.1.0 + # via requests click==8.1.3 + # via mkdocs colorama==0.4.6 + # via mkdocs-material ghp-import==2.1.0 + # via mkdocs idna==3.4 + # via requests jinja2==3.1.2 + # via mkdocs + # via mkdocs-material markdown==3.3.7 + # via mdx-gh-links + # via mkdocs + # via mkdocs-material + # via pymdown-extensions markupsafe==2.1.2 + # via jinja2 mdx-gh-links==0.3 + # via rye-dev mergedeep==1.3.4 + # via mkdocs mkdocs==1.4.3 + # via mkdocs-material + # via mkdocs-simple-hooks + # via rye-dev mkdocs-include-markdown-plugin==4.0.4 + # via rye-dev mkdocs-material==9.1.12 + # via rye-dev mkdocs-material-extensions==1.1.1 + # via mkdocs-material mkdocs-simple-hooks==0.1.5 + # via rye-dev mkdocs-version-annotations==1.0.0 + # via rye-dev packaging==23.1 + # via mkdocs pygments==2.15.1 + # via mkdocs-material pymdown-extensions==9.11 + # via mkdocs-material + # via rye-dev python-dateutil==2.8.2 + # via ghp-import pyyaml==6.0 + # via mkdocs + # via pymdown-extensions + # via pyyaml-env-tag pyyaml-env-tag==0.1 + # via mkdocs regex==2023.5.5 + # via mkdocs-material requests==2.30.0 + # via mkdocs-material six==1.16.0 + # via python-dateutil urllib3==2.0.2 + # via requests watchdog==3.0.0 + # via mkdocs diff --git a/rye/src/lock.rs b/rye/src/lock.rs index d0f0239cf3..34900a1ab1 100644 --- a/rye/src/lock.rs +++ b/rye/src/lock.rs @@ -23,6 +23,8 @@ use crate::sources::PythonVersion; use crate::utils::{set_proxy_variables, CommandOutput}; static FILE_EDITABLE_RE: Lazy = Lazy::new(|| Regex::new(r"^-e (file://.*?)\s*$").unwrap()); +static DEP_COMMENT_RE: Lazy = + Lazy::new(|| Regex::new(r"^ # (?:(via)|(?:via (.*?))|(?: (.*?)))$").unwrap()); static REQUIREMENTS_HEADER: &str = r#"# generated by rye # use `rye lock` or `rye sync` to update this lockfile # @@ -86,7 +88,6 @@ pub fn update_workspace_lockfile( let features_by_project = collect_workspace_features(lock_options); let mut req_file = NamedTempFile::new()?; - let mut local_req_file = NamedTempFile::new()?; let mut local_projects = HashMap::new(); let mut projects = Vec::new(); @@ -97,7 +98,7 @@ pub fn update_workspace_lockfile( // virtual packages are not installed if !pyproject.is_virtual() { - writeln!(local_req_file, "-e {}{}", rel_url, applicable_extras)?; + writeln!(req_file, "-e {}{}", rel_url, applicable_extras)?; } local_projects.insert(pyproject.normalized_name()?, rel_url); @@ -118,15 +119,11 @@ pub fn update_workspace_lockfile( req_file.as_file_mut(), DependencyKind::Dev, )?; - dump_dependencies( - pyproject, - &local_projects, - local_req_file.as_file_mut(), - DependencyKind::Dev, - )?; } } + req_file.flush()?; + let exclusions = find_exclusions(&projects)?; generate_lockfile( output, @@ -137,17 +134,6 @@ pub fn update_workspace_lockfile( sources, lock_options, &exclusions, - &[], - )?; - generate_lockfile( - output, - py_ver, - &workspace.path(), - local_req_file.path(), - lockfile, - sources, - lock_options, - &exclusions, &["--pip-args=--no-deps"], )?; @@ -339,6 +325,7 @@ fn generate_lockfile( .arg("--strip-extras") .arg("--allow-unsafe") .arg("--no-header") + .arg("--annotate") .arg("--pip-args") .arg(format!( "--python-version=\"{}.{}\"", @@ -427,9 +414,19 @@ fn finalize_lockfile( && (x.version_or_url.is_none() || x.version_or_url == req.version_or_url) }) { // skip exclusions - writeln!(rv, "# excluded {}", line)?; + writeln!(rv, "# {} (excluded)", line)?; continue; } + } else if let Some(m) = DEP_COMMENT_RE.captures(line) { + if let Some(dep) = m.get(2).or_else(|| m.get(3)).map(|x| x.as_str()) { + if !dep.starts_with("-r ") { + // we cannot tell today based on the output where this comes from. This + // can show up because it's a root dependency, because it's a dev dependency + // or in some cases just because we declared it as a duplicate. + writeln!(rv, " # via {}", dep)?; + } + }; + continue; } writeln!(rv, "{}", line)?; } From a4b0016915d5d5b209deacd4571728caf815faf2 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 12 Feb 2024 10:08:42 +0100 Subject: [PATCH 137/166] Document limitations of virtual packages --- docs/guide/virtual.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/guide/virtual.md b/docs/guide/virtual.md index 7722183880..ee0533db13 100644 --- a/docs/guide/virtual.md +++ b/docs/guide/virtual.md @@ -26,6 +26,11 @@ When synching the project itself is never installed into the virtualenv as it's considered to be a valid package. Likewise you cannot publish virtual packages to PyPI or another index. +## Limitations + +Virtual projects can not have optional dependencies. These even if declared are not +installed. + ## Workspaces If a [workspace](../workspaces/) does not have a toplevel package it's From 798660905e3c604c5cf639b42523bb2ea0d702df Mon Sep 17 00:00:00 2001 From: Danny Goodall Date: Mon, 12 Feb 2024 13:28:50 +0000 Subject: [PATCH 138/166] Fix out of date Windows Developer Mode instructions (#645) --- docs/guide/faq.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/guide/faq.md b/docs/guide/faq.md index b5205cfebd..89185ed44f 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -38,7 +38,9 @@ support for symlinks is restricted to privileged accounts. The reason for this Symlinks were a late addition to Windows and some applications are not developed with them in mind which can cause misbehavior or in the worst case security issues in those applications. Symlinks support however is enabled when the "developer mode" is activated -on modern Windows versions. Here is how you can enable it: +on modern Windows versions. + +Enabling "developer mode" has changed in later version of Windows. For older versions: 1. Press ++windows+i++ to open the settings 2. In the settings dialog click on "Privacy & security" @@ -46,6 +48,14 @@ on modern Windows versions. Here is how you can enable it: 4. Enable the toggle "Developer Mode" 5. In the "Use developer features" dialog confirm by clicking "Yes". +In more modern versions: + +1. Press ++windows+i++ to open the settings +2. In the settings dialog click on "System" +3. In the "System" section click on "For developers" +4. Enable the toggle "Developer Mode" +5. In the "Use developer features" dialog confirm by clicking "Yes". + ??? question "What happens if I don't enable it?" Enabling symlinks is not strictly required as Rye automatically falls back to From ffd6b0898138bedff235f5f38636caf8b49b7519 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 13 Feb 2024 00:41:31 +0100 Subject: [PATCH 139/166] Update monotrail (#648) Fixes #624 Fixes #647 --- Cargo.lock | 6 +++--- rye/Cargo.toml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c95f3f96a..0ff5c5f4af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1219,7 +1219,7 @@ dependencies = [ [[package]] name = "monotrail-utils" version = "0.0.1" -source = "git+https://github.com/konstin/poc-monotrail?rev=136807e1fe87e9319e0223f76b602ba5db881322#136807e1fe87e9319e0223f76b602ba5db881322" +source = "git+https://github.com/konstin/poc-monotrail?rev=e0251f68c254f834180198b8677fcf85d4b6a844#e0251f68c254f834180198b8677fcf85d4b6a844" dependencies = [ "anyhow", "cpufeatures", @@ -1383,9 +1383,9 @@ dependencies = [ [[package]] name = "pep508_rs" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9d1320b78f4a5715b3ec914f32b5e85a50287ad923730e3cbf0255259432eb" +checksum = "910c513bea0f4f833122321c0f20e8c704e01de98692f6989c2ec21f43d88b1e" dependencies = [ "once_cell", "pep440_rs", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index be9bc3b951..875ff36ba3 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -33,7 +33,7 @@ nix = { version = "0.27.1", default-features = false, features = ["process"] } once_cell = "1.17.1" pathdiff = "0.2.1" pep440_rs = "0.4.0" -pep508_rs = "0.2.1" +pep508_rs = "0.3.0" regex = "1.8.1" same-file = "1.0.6" serde = { version = "1.0.160", features = ["derive"] } @@ -55,7 +55,7 @@ bzip2 = "0.4.4" zip = { version = "0.6.5", features = ["deflate"], default-features = false } self-replace = "1.3.5" configparser = "3.0.2" -monotrail-utils = { git = "https://github.com/konstin/poc-monotrail", rev = "136807e1fe87e9319e0223f76b602ba5db881322" } +monotrail-utils = { git = "https://github.com/konstin/poc-monotrail", rev = "e0251f68c254f834180198b8677fcf85d4b6a844" } python-pkginfo = { version = "0.6.0", features = ["serde"] } sysinfo = { version = "0.29.4", default-features = false, features = [] } home = "0.5.9" From 0fdcdda6c4660df943bd380dc937d55be8d2652e Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 13 Feb 2024 19:35:22 +0100 Subject: [PATCH 140/166] 0.23.0 --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e64e58f96..a7c89ea1b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. + + ## 0.23.0 -_Unreleased_ +Released on 2024-02-13 - When `behavior.venv-mark-sync-ignore` is set to `false` and the file system does not support extended attributes, no longer will a warning be printed. #633 @@ -16,8 +18,6 @@ _Unreleased_ - Lockfiles now contain annotations. #643 - - ## 0.22.0 Released on 2024-02-09 From 26e6d6cd1de3a2c055cd0c7a044d4b28154fc143 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 13 Feb 2024 19:36:14 +0100 Subject: [PATCH 141/166] 0.24.0 ready for dev --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7c89ea1b5..37a4ec6141 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.24.0 + +_Unreleased_ + ## 0.23.0 diff --git a/Cargo.lock b/Cargo.lock index 0ff5c5f4af..85583e5068 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1792,7 +1792,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.23.0" +version = "0.24.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 875ff36ba3..effe59c3b6 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.23.0" +version = "0.24.0" edition = "2021" license = "MIT" From 86a33030bf39d29488bebfa6c11691e65cc78e4f Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 15 Feb 2024 11:03:08 +0100 Subject: [PATCH 142/166] Replace show --installed-deps with list (#656) --- CHANGELOG.md | 2 ++ docs/guide/commands/list.md | 29 ++++++++++++++++++++++++++ docs/guide/commands/show.md | 18 +++------------- rye/src/cli/list.rs | 41 +++++++++++++++++++++++++++++++++++++ rye/src/cli/mod.rs | 16 ++------------- rye/src/cli/show.rs | 36 ++++++-------------------------- 6 files changed, 83 insertions(+), 59 deletions(-) create mode 100644 docs/guide/commands/list.md create mode 100644 rye/src/cli/list.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 37a4ec6141..3c97e8d8ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ that were not yet released. _Unreleased_ +- Added new `rye list` command and deprecated `rye show --installed-deps` which it replaces. #656 + ## 0.23.0 diff --git a/docs/guide/commands/list.md b/docs/guide/commands/list.md new file mode 100644 index 0000000000..b8a257729c --- /dev/null +++ b/docs/guide/commands/list.md @@ -0,0 +1,29 @@ +# `list` + ++++ 0.24.0 + +Prints a list of installed dependencies. + +## Example + +``` +$ rye list +asgiref==3.7.2 +blinker==1.7.0 +click==8.1.7 +Flask @ git+https://github.com/pallets/flask@4df377cfbfc1d15e962a61c18920b22aebc9aa41 +itsdangerous==2.1.2 +Jinja2==3.1.3 +MarkupSafe==2.1.4 +Werkzeug==3.0.1 +``` + +## Arguments + +*no arguments* + +## Options + +* `--pyproject`: Use this `pyproject.toml` file + +* `-h, --help`: Print help (see a summary with '-h') \ No newline at end of file diff --git a/docs/guide/commands/show.md b/docs/guide/commands/show.md index ffdb61bde4..419cce9189 100644 --- a/docs/guide/commands/show.md +++ b/docs/guide/commands/show.md @@ -17,27 +17,15 @@ venv python: cpython@3.9.18 virtual: false ``` -To print out the list of installed dependencies: - -``` -$ rye show --installed-deps -asgiref==3.7.2 -blinker==1.7.0 -click==8.1.7 -Flask @ git+https://github.com/pallets/flask@4df377cfbfc1d15e962a61c18920b22aebc9aa41 -itsdangerous==2.1.2 -Jinja2==3.1.3 -MarkupSafe==2.1.4 -Werkzeug==3.0.1 -``` - ## Arguments *no arguments* ## Options -* `--installed-deps`: Print the currently installed dependencies +* `--installed-deps`: Print the currently installed dependencies. + + This option is being replaced with [`rye list`](list.md) * `--pyproject`: Use this `pyproject.toml` file diff --git a/rye/src/cli/list.rs b/rye/src/cli/list.rs new file mode 100644 index 0000000000..afeb6fc49c --- /dev/null +++ b/rye/src/cli/list.rs @@ -0,0 +1,41 @@ +use std::path::PathBuf; +use std::process::Command; + +use anyhow::{bail, Error}; +use clap::Parser; + +use crate::bootstrap::ensure_self_venv; +use crate::consts::VENV_BIN; +use crate::pyproject::PyProject; +use crate::utils::{get_venv_python_bin, CommandOutput}; + +/// Prints the currently installed packages. +#[derive(Parser, Debug)] +pub struct Args { + /// Use this pyproject.toml file + #[arg(long, value_name = "PYPROJECT_TOML")] + pub(crate) pyproject: Option, +} + +pub fn execute(cmd: Args) -> Result<(), Error> { + let project = PyProject::load_or_discover(cmd.pyproject.as_deref())?; + let python = get_venv_python_bin(&project.venv_path()); + if !python.is_file() { + return Ok(()); + } + let self_venv = ensure_self_venv(CommandOutput::Normal)?; + + let status = Command::new(self_venv.join(VENV_BIN).join("pip")) + .arg("--python") + .arg(&python) + .arg("freeze") + .env("PYTHONWARNINGS", "ignore") + .env("PIP_DISABLE_PIP_VERSION_CHECK", "1") + .status()?; + + if !status.success() { + bail!("failed to print dependencies via pip"); + } + + Ok(()) +} diff --git a/rye/src/cli/mod.rs b/rye/src/cli/mod.rs index 4ed1f5247e..25a57e708e 100644 --- a/rye/src/cli/mod.rs +++ b/rye/src/cli/mod.rs @@ -11,6 +11,7 @@ mod fmt; mod init; mod install; mod lint; +mod list; mod lock; mod make_req; mod pin; @@ -70,20 +71,11 @@ enum Command { Rye(rye::Args), Uninstall(uninstall::Args), Version(version::Args), - #[command(hide = true)] List(list::Args), #[command(hide = true)] Shell(shell::Args), } -pub mod list { - /// There is no real list command yet. - /// - /// Use rye show --installed-deps instead - #[derive(clap::Parser, Debug)] - pub struct Args {} -} - pub mod shell { /// The shell command was removed. #[derive(clap::Parser, Debug)] @@ -136,11 +128,7 @@ pub fn execute() -> Result<(), Error> { Command::Rye(cmd) => rye::execute(cmd), Command::Uninstall(cmd) => uninstall::execute(cmd), Command::Version(cmd) => version::execute(cmd), - Command::List(..) => { - // until we have a proper list command, make it error with what the - // user should be using instead. - bail!("unknown command. Maybe you mean rye show --installed-deps"); - } + Command::List(cmd) => list::execute(cmd), Command::Shell(..) => { bail!( "unknown command. The shell command was removed. Activate the virtualenv instead with '{}' instead.", diff --git a/rye/src/cli/show.rs b/rye/src/cli/show.rs index d3903946b1..adaeeb0142 100644 --- a/rye/src/cli/show.rs +++ b/rye/src/cli/show.rs @@ -1,15 +1,11 @@ use std::path::Path; use std::path::PathBuf; -use std::process::Command; -use anyhow::{bail, Error}; +use anyhow::Error; use clap::Parser; use console::style; -use crate::bootstrap::ensure_self_venv; -use crate::consts::VENV_BIN; use crate::pyproject::{get_current_venv_python_version, PyProject}; -use crate::utils::{get_venv_python_bin, CommandOutput}; /// Prints the current state of the project. #[derive(Parser, Debug)] @@ -23,12 +19,14 @@ pub struct Args { } pub fn execute(cmd: Args) -> Result<(), Error> { - let project = PyProject::load_or_discover(cmd.pyproject.as_deref())?; - if cmd.installed_deps { - return print_installed_deps(&project); + warn!("--installed-deps is deprecated, use `rye list`"); + return crate::cli::list::execute(crate::cli::list::Args { + pyproject: cmd.pyproject, + }); } + let project = PyProject::load_or_discover(cmd.pyproject.as_deref())?; echo!( "project: {}", style(project.name().unwrap_or("")).yellow() @@ -89,25 +87,3 @@ pub fn execute(cmd: Args) -> Result<(), Error> { Ok(()) } - -fn print_installed_deps(project: &PyProject) -> Result<(), Error> { - let python = get_venv_python_bin(&project.venv_path()); - if !python.is_file() { - return Ok(()); - } - let self_venv = ensure_self_venv(CommandOutput::Normal)?; - - let status = Command::new(self_venv.join(VENV_BIN).join("pip")) - .arg("--python") - .arg(&python) - .arg("freeze") - .env("PYTHONWARNINGS", "ignore") - .env("PIP_DISABLE_PIP_VERSION_CHECK", "1") - .status()?; - - if !status.success() { - bail!("failed to print dependencies via pip"); - } - - Ok(()) -} From 259c8989634af922673bc94b25fbad082321ce6b Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 15 Feb 2024 20:42:46 +0100 Subject: [PATCH 143/166] Add uv (#657) --- CHANGELOG.md | 2 + rye/src/bootstrap.rs | 3 +- rye/src/cli/list.rs | 23 +++++-- rye/src/cli/rye.rs | 17 +++++ rye/src/config.rs | 16 +++++ rye/src/installer.rs | 24 +++++-- rye/src/lock.rs | 77 ++++++++++++++-------- rye/src/sync.rs | 152 +++++++++++++++++++++++++++---------------- 8 files changed, 217 insertions(+), 97 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c97e8d8ad..0cdb957e5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ _Unreleased_ - Added new `rye list` command and deprecated `rye show --installed-deps` which it replaces. #656 +- Added experimental support for `uv`. + ## 0.23.0 diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index e0abce6382..7b75845d67 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -37,7 +37,7 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques suffix: None, }; -const SELF_VERSION: u64 = 10; +const SELF_VERSION: u64 = 11; const SELF_REQUIREMENTS: &str = r#" build==1.0.3 @@ -57,6 +57,7 @@ unearth==0.14.0 urllib3==2.0.7 virtualenv==20.25.0 ruff==0.1.14 +uv==0.1.0 "#; static FORCED_TO_UPDATE: AtomicBool = AtomicBool::new(false); diff --git a/rye/src/cli/list.rs b/rye/src/cli/list.rs index afeb6fc49c..fe87ed51e4 100644 --- a/rye/src/cli/list.rs +++ b/rye/src/cli/list.rs @@ -5,6 +5,7 @@ use anyhow::{bail, Error}; use clap::Parser; use crate::bootstrap::ensure_self_venv; +use crate::config::Config; use crate::consts::VENV_BIN; use crate::pyproject::PyProject; use crate::utils::{get_venv_python_bin, CommandOutput}; @@ -25,13 +26,21 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } let self_venv = ensure_self_venv(CommandOutput::Normal)?; - let status = Command::new(self_venv.join(VENV_BIN).join("pip")) - .arg("--python") - .arg(&python) - .arg("freeze") - .env("PYTHONWARNINGS", "ignore") - .env("PIP_DISABLE_PIP_VERSION_CHECK", "1") - .status()?; + let status = if Config::current().use_uf() { + Command::new(self_venv.join(VENV_BIN).join("uv")) + .arg("pip") + .arg("freeze") + .env("VIRTUAL_ENV", project.venv_path().as_os_str()) + .status()? + } else { + Command::new(self_venv.join(VENV_BIN).join("pip")) + .arg("--python") + .arg(&python) + .arg("freeze") + .env("PYTHONWARNINGS", "ignore") + .env("PIP_DISABLE_PIP_VERSION_CHECK", "1") + .status()? + }; if !status.success() { bail!("failed to print dependencies via pip"); diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index c429b3a97f..db783694e9 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -441,6 +441,23 @@ fn perform_install( return Err(QuietExit(1).into()); } + // Use uv? + if config_doc + .get("behavior") + .and_then(|x| x.get("use-uv")) + .is_none() + && (matches!(mode, InstallMode::NoPrompts) + || dialoguer::Select::with_theme(tui_theme()) + .with_prompt("Select the preferred package installer") + .item("pip-tools (slow but stable)") + .item("uv (quick but experimental)") + .default(0) + .interact()? + == 1) + { + toml::ensure_table(config_doc, "behavior")["use-uv"] = toml_edit::value(true); + } + // If the global-python flag is not in the settings, ask the user if they want to turn // on global shims upon installation. if config_doc diff --git a/rye/src/config.rs b/rye/src/config.rs index d64a681247..856490ddb2 100644 --- a/rye/src/config.rs +++ b/rye/src/config.rs @@ -246,4 +246,20 @@ impl Config { Ok(rv) } + + /// Indicates if the experimental uv support should be used. + pub fn use_uf(&self) -> bool { + let yes = self + .doc + .get("behavior") + .and_then(|x| x.get("use-uv")) + .and_then(|x| x.as_bool()) + .unwrap_or(false); + if yes && cfg!(windows) { + warn!("uv enabled in config but not supported on windows"); + false + } else { + yes + } + } } diff --git a/rye/src/installer.rs b/rye/src/installer.rs index f7cf233f3f..25a529001a 100644 --- a/rye/src/installer.rs +++ b/rye/src/installer.rs @@ -127,14 +127,24 @@ pub fn install( requirement.name.as_str(), )?; - let mut cmd = Command::new(self_venv.join(VENV_BIN).join("pip")); - cmd.arg("--python") - .arg(&py) - .arg("install") - .env("PYTHONWARNINGS", "ignore") - .env("PIP_DISABLE_PIP_VERSION_CHECK", "1"); - sources.add_as_pip_args(&mut cmd); + let mut cmd = if Config::current().use_uf() { + let mut cmd = Command::new(self_venv.join(VENV_BIN).join("uv")); + cmd.arg("pip") + .arg("install") + .env("VIRTUAL_ENV", &target_venv_path) + .env("PYTHONWARNINGS", "ignore"); + cmd + } else { + let mut cmd = Command::new(self_venv.join(VENV_BIN).join("pip")); + cmd.arg("--python") + .arg(&py) + .arg("install") + .env("PYTHONWARNINGS", "ignore") + .env("PIP_DISABLE_PIP_VERSION_CHECK", "1"); + cmd + }; + sources.add_as_pip_args(&mut cmd); if output == CommandOutput::Verbose { cmd.arg("--verbose"); } else { diff --git a/rye/src/lock.rs b/rye/src/lock.rs index 34900a1ab1..2629c4e1af 100644 --- a/rye/src/lock.rs +++ b/rye/src/lock.rs @@ -15,6 +15,9 @@ use serde::Serialize; use tempfile::NamedTempFile; use url::Url; +use crate::bootstrap::ensure_self_venv; +use crate::config::Config; +use crate::consts::VENV_BIN; use crate::piptools::{get_pip_compile, get_pip_tools_version, PipToolsVersion}; use crate::pyproject::{ normalize_package_name, DependencyKind, ExpandedSources, PyProject, Workspace, @@ -134,7 +137,7 @@ pub fn update_workspace_lockfile( sources, lock_options, &exclusions, - &["--pip-args=--no-deps"], + true, )?; Ok(()) @@ -287,7 +290,7 @@ pub fn update_single_project_lockfile( sources, lock_options, &exclusions, - &[], + false, )?; Ok(()) @@ -303,7 +306,7 @@ fn generate_lockfile( sources: &ExpandedSources, lock_options: &LockOptions, exclusions: &HashSet, - extra_args: &[&str], + no_deps: bool, ) -> Result<(), Error> { let scratch = tempfile::tempdir()?; let requirements_file = scratch.path().join("requirements.txt"); @@ -313,36 +316,55 @@ fn generate_lockfile( fs::write(&requirements_file, b"")?; } - let pip_compile = get_pip_compile(py_ver, output)?; - let mut cmd = Command::new(pip_compile); - - // legacy pip tools requires some extra parameters - if get_pip_tools_version(py_ver) == PipToolsVersion::Legacy { - cmd.arg("--resolver=backtracking"); - } + let mut cmd = if Config::current().use_uf() { + let self_venv = ensure_self_venv(output)?; + let mut cmd = Command::new(self_venv.join(VENV_BIN).join("uv")); + cmd.arg("pip") + .arg("compile") + .arg("--no-header") + .arg(format!( + "--python-version={}.{}.{}", + py_ver.major, py_ver.minor, py_ver.patch + )); + if output == CommandOutput::Verbose { + cmd.arg("--verbose"); + } else if output == CommandOutput::Quiet { + cmd.arg("-q"); + } + cmd + } else { + let mut cmd = Command::new(get_pip_compile(py_ver, output)?); + // legacy pip tools requires some extra parameters + if get_pip_tools_version(py_ver) == PipToolsVersion::Legacy { + cmd.arg("--resolver=backtracking"); + } + cmd.arg("--strip-extras") + .arg("--allow-unsafe") + .arg("--no-header") + .arg("--annotate") + .arg("--pip-args") + .arg(format!( + "--python-version=\"{}.{}.{}\"{}", + py_ver.major, + py_ver.minor, + py_ver.patch, + if no_deps { " --no-deps" } else { "" } + )) + .arg(if output == CommandOutput::Verbose { + "--verbose" + } else { + "-q" + }); + cmd + }; - cmd.arg("--no-annotate") - .arg("--strip-extras") - .arg("--allow-unsafe") - .arg("--no-header") - .arg("--annotate") - .arg("--pip-args") - .arg(format!( - "--python-version=\"{}.{}\"", - py_ver.major, py_ver.minor - )) - .arg("-o") + cmd.arg("-o") .arg(&requirements_file) .arg(requirements_file_in) .current_dir(workspace_path) .env("PYTHONWARNINGS", "ignore") .env("PROJECT_ROOT", make_project_root_fragment(workspace_path)); - if output == CommandOutput::Verbose { - cmd.arg("--verbose"); - } else { - cmd.arg("-q"); - } for pkg in &lock_options.update { cmd.arg("--upgrade-package"); cmd.arg(pkg); @@ -354,7 +376,6 @@ fn generate_lockfile( cmd.arg("--pre"); } sources.add_as_pip_args(&mut cmd); - cmd.args(extra_args); set_proxy_variables(&mut cmd); let status = cmd.status().context("unable to run pip-compile")?; if !status.success() { @@ -427,6 +448,8 @@ fn finalize_lockfile( } }; continue; + } else if line.starts_with('#') { + continue; } writeln!(rv, "{}", line)?; } diff --git a/rye/src/sync.rs b/rye/src/sync.rs index 0874e4bc9d..732916858a 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -245,50 +245,66 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { if output != CommandOutput::Quiet { echo!("Installing dependencies"); } - let tempdir = tempdir()?; - let mut pip_sync_cmd = Command::new(get_pip_sync(&py_ver, output)?); - let root = pyproject.workspace_path(); - let py_path = get_venv_python_bin(&venv); - - // we need to run this after we have run the `get_pip_sync` command - // as this is what bootstraps or updates the pip tools installation. - // This is needed as on unix platforms we need to search the module path. - symlink_dir( - get_pip_module(&get_pip_tools_venv_path(&py_ver)) - .context("could not locate pip")?, - tempdir.path().join("pip"), - ) - .context("failed linking pip module into for pip-sync")?; - pip_sync_cmd - .env("PROJECT_ROOT", make_project_root_fragment(&root)) - .env("PYTHONPATH", tempdir.path()) - .current_dir(&root) - .arg("--python-executable") - .arg(&py_path) - .arg("--pip-args") - .arg("--no-deps"); + let tempdir = tempdir()?; + let mut sync_cmd = if Config::current().use_uf() { + let mut uv_sync_cmd = Command::new(self_venv.join(VENV_BIN).join("uv")); + uv_sync_cmd.arg("pip").arg("sync"); + let root = pyproject.workspace_path(); + + uv_sync_cmd + .env("PROJECT_ROOT", make_project_root_fragment(&root)) + .env("VIRTUAL_ENV", pyproject.venv_path().as_os_str()) + .current_dir(&root); + uv_sync_cmd + } else { + let mut pip_sync_cmd = Command::new(get_pip_sync(&py_ver, output)?); + let root = pyproject.workspace_path(); + let py_path = get_venv_python_bin(&venv); + + // we need to run this after we have run the `get_pip_sync` command + // as this is what bootstraps or updates the pip tools installation. + // This is needed as on unix platforms we need to search the module path. + symlink_dir( + get_pip_module(&get_pip_tools_venv_path(&py_ver)) + .context("could not locate pip")?, + tempdir.path().join("pip"), + ) + .context("failed linking pip module into for pip-sync")?; + + pip_sync_cmd + .env("PROJECT_ROOT", make_project_root_fragment(&root)) + .env("PYTHONPATH", tempdir.path()) + .current_dir(&root) + .arg("--python-executable") + .arg(&py_path) + .arg("--pip-args") + .arg("--no-deps"); + + if output != CommandOutput::Quiet { + pip_sync_cmd.env("PYTHONWARNINGS", "ignore"); + } else if output == CommandOutput::Verbose && env::var("PIP_VERBOSE").is_err() { + pip_sync_cmd.env("PIP_VERBOSE", "2"); + } + pip_sync_cmd + }; - sources.add_as_pip_args(&mut pip_sync_cmd); + sources.add_as_pip_args(&mut sync_cmd); if cmd.dev && dev_lockfile.is_file() { - pip_sync_cmd.arg(&dev_lockfile); + sync_cmd.arg(&dev_lockfile); } else { - pip_sync_cmd.arg(&lockfile); + sync_cmd.arg(&lockfile); } if output == CommandOutput::Verbose { - pip_sync_cmd.arg("--verbose"); - if env::var("PIP_VERBOSE").is_err() { - pip_sync_cmd.env("PIP_VERBOSE", "2"); - } - } else if output != CommandOutput::Quiet { - pip_sync_cmd.env("PYTHONWARNINGS", "ignore"); - } else { - pip_sync_cmd.arg("-q"); + sync_cmd.arg("--verbose"); + } else if output == CommandOutput::Quiet { + sync_cmd.arg("-q"); } - set_proxy_variables(&mut pip_sync_cmd); - let status = pip_sync_cmd.status().context("unable to run pip-sync")?; + set_proxy_variables(&mut sync_cmd); + let status = sync_cmd.status().context("unable to run pip-sync")?; + if !status.success() { bail!("Installation of dependencies failed"); } @@ -309,27 +325,44 @@ pub fn create_virtualenv( venv: &Path, prompt: &str, ) -> Result<(), Error> { - // create the venv folder first so we can manipulate some flags on it. - fs::create_dir_all(venv) - .with_context(|| format!("unable to create virtualenv folder '{}'", venv.display()))?; - - update_venv_sync_marker(output, venv); - let py_bin = get_toolchain_python_bin(py_ver)?; - let mut venv_cmd = Command::new(self_venv.join(VENV_BIN).join("virtualenv")); - if output == CommandOutput::Verbose { - venv_cmd.arg("--verbose"); + + let mut venv_cmd = if Config::current().use_uf() { + // try to kill the empty venv if there is one as uv can't work otherwise. + fs::remove_dir(venv).ok(); + let mut venv_cmd = Command::new(self_venv.join(VENV_BIN).join("uv")); + venv_cmd.arg("venv"); + if output == CommandOutput::Verbose { + venv_cmd.arg("--verbose"); + } else { + venv_cmd.arg("-q"); + } + venv_cmd.arg("-p"); + venv_cmd.arg(&py_bin); + venv_cmd } else { - venv_cmd.arg("-q"); - venv_cmd.env("PYTHONWARNINGS", "ignore"); - } - venv_cmd.arg("-p"); - venv_cmd.arg(&py_bin); - venv_cmd.arg("--no-seed"); - venv_cmd.arg("--prompt"); - venv_cmd.arg(prompt); - venv_cmd.arg("--"); - venv_cmd.arg(venv); + // create the venv folder first so we can manipulate some flags on it. + fs::create_dir_all(venv) + .with_context(|| format!("unable to create virtualenv folder '{}'", venv.display()))?; + + update_venv_sync_marker(output, venv); + let mut venv_cmd = Command::new(self_venv.join(VENV_BIN).join("virtualenv")); + if output == CommandOutput::Verbose { + venv_cmd.arg("--verbose"); + } else { + venv_cmd.arg("-q"); + venv_cmd.env("PYTHONWARNINGS", "ignore"); + } + venv_cmd.arg("-p"); + venv_cmd.arg(&py_bin); + venv_cmd.arg("--no-seed"); + venv_cmd.arg("--prompt"); + venv_cmd.arg(prompt); + venv_cmd + }; + + venv_cmd.arg("--").arg(venv); + let status = venv_cmd .status() .context("unable to invoke virtualenv command")?; @@ -337,6 +370,11 @@ pub fn create_virtualenv( bail!("failed to initialize virtualenv"); } + // uv can only do it now + if Config::current().use_uf() { + update_venv_sync_marker(output, venv); + } + // On UNIX systems Python is unable to find the tcl config that is placed // outside of the virtualenv. It also sometimes is entirely unable to find // the tcl config that comes from the standalone python builds. @@ -353,7 +391,11 @@ pub fn create_virtualenv( fn update_venv_sync_marker(output: CommandOutput, venv_path: &Path) { if let Err(err) = mark_path_sync_ignore(venv_path, Config::current().venv_mark_sync_ignore()) { if output != CommandOutput::Quiet && Config::current().venv_mark_sync_ignore() { - warn!("unable to mark virtualenv ignored for cloud sync: {}", err); + warn!( + "unable to mark virtualenv {} ignored for cloud sync: {}", + venv_path.display(), + err + ); } } } From 8d56aa18a408f523f3edfda46a9e29199a3a57e5 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 15 Feb 2024 20:43:35 +0100 Subject: [PATCH 144/166] 0.24.0 --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cdb957e5d..941a0a220d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,15 +3,15 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. + + ## 0.24.0 -_Unreleased_ +Released on 2024-02-15 - Added new `rye list` command and deprecated `rye show --installed-deps` which it replaces. #656 -- Added experimental support for `uv`. - - +- Added experimental support for `uv`. #657 ## 0.23.0 From 20ca688d3302855133af336c744b983a12ada61b Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 15 Feb 2024 20:44:05 +0100 Subject: [PATCH 145/166] 0.25.0 ready for dev --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- rye/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 941a0a220d..0a2a274a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file contains tracks the changes landing in Rye. It includes changes that were not yet released. +## 0.25.0 + +_Unreleased_ + ## 0.24.0 diff --git a/Cargo.lock b/Cargo.lock index 85583e5068..1e5f87b75e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1792,7 +1792,7 @@ dependencies = [ [[package]] name = "rye" -version = "0.24.0" +version = "0.25.0" dependencies = [ "age", "anyhow", diff --git a/rye/Cargo.toml b/rye/Cargo.toml index effe59c3b6..3878f91ad1 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rye" -version = "0.24.0" +version = "0.25.0" edition = "2021" license = "MIT" From ff130c4682616cc64cce5628637e825cfc923b1b Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Fri, 16 Feb 2024 00:00:22 +0000 Subject: [PATCH 146/166] config: require any of --get, --set, --set-int, --set-bool, --unset or print help (#660) --- rye/src/cli/config.rs | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/rye/src/cli/config.rs b/rye/src/cli/config.rs index 6782dda40c..9c878e8359 100644 --- a/rye/src/cli/config.rs +++ b/rye/src/cli/config.rs @@ -4,6 +4,7 @@ use std::sync::Arc; use anyhow::bail; use anyhow::Context; use anyhow::Error; +use clap::Args as ClapArgs; use clap::Parser; use clap::ValueEnum; use serde::Serialize; @@ -28,7 +29,21 @@ enum Format { /// Each of the set operations takes a key=value pair. All of these can /// be supplied multiple times. #[derive(Parser, Debug)] +#[command(arg_required_else_help(true))] pub struct Args { + #[command(flatten)] + action: ActionArgs, + /// Print the path to the config. + #[arg(long, conflicts_with = "format")] + show_path: bool, + /// Request parseable output format rather than lines. + #[arg(long)] + format: Option, +} + +#[derive(ClapArgs, Debug)] +#[group(required = true, multiple = true)] +pub struct ActionArgs { /// Reads a config key #[arg(long)] get: Vec, @@ -44,14 +59,7 @@ pub struct Args { /// Remove a config key. #[arg(long)] unset: Vec, - /// Print the path to the config. - #[arg(long, conflicts_with = "format")] - show_path: bool, - /// Request parseable output format rather than lines. - #[arg(long)] - format: Option, } - pub fn execute(cmd: Args) -> Result<(), Error> { let mut config = Config::current(); let doc = Arc::make_mut(&mut config).doc_mut(); @@ -63,9 +71,9 @@ pub fn execute(cmd: Args) -> Result<(), Error> { let mut read_as_json = BTreeMap::new(); let mut read_as_string = Vec::new(); - let reads = !cmd.get.is_empty(); + let reads = !cmd.action.get.is_empty(); - for item in cmd.get { + for item in cmd.action.get { let mut ptr = Some(doc.as_item()); for piece in item.split('.') { ptr = ptr.as_ref().and_then(|x| x.get(piece)); @@ -84,7 +92,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { let mut updates: Vec<(&str, Value)> = Vec::new(); - for item in &cmd.set { + for item in &cmd.action.set { if let Some((key, value)) = item.split_once('=') { updates.push((key, Value::from(value))); } else { @@ -92,7 +100,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } } - for item in &cmd.set_int { + for item in &cmd.action.set_int { if let Some((key, value)) = item.split_once('=') { updates.push(( key, @@ -107,7 +115,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } } - for item in &cmd.set_bool { + for item in &cmd.action.set_bool { if let Some((key, value)) = item.split_once('=') { updates.push(( key, @@ -122,7 +130,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } } - let modifies = !updates.is_empty() || !cmd.unset.is_empty(); + let modifies = !updates.is_empty() || !cmd.action.unset.is_empty(); if modifies && reads { bail!("cannot mix get and set operations"); } @@ -140,7 +148,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { *ptr = value(new_value); } - for key in cmd.unset { + for key in cmd.action.unset { let mut ptr = doc.as_item_mut(); if let Some((parent, key)) = key.rsplit_once('.') { for piece in parent.split('.') { From f0a709da533a180554e734af6cfa7a518d43cb48 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 16 Feb 2024 01:00:57 +0100 Subject: [PATCH 147/166] Added changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a2a274a47..a2f1f76765 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ that were not yet released. _Unreleased_ +- Improved the error message if `config` is invoked without arguments. #660 + ## 0.24.0 From fcc21ce3d04e9afc4a7b91d7fabc1f23a0855774 Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Fri, 16 Feb 2024 09:27:31 +0100 Subject: [PATCH 148/166] Fix a typo: The tool is called uv, not uf (#661) --- rye/src/cli/list.rs | 2 +- rye/src/config.rs | 2 +- rye/src/installer.rs | 2 +- rye/src/lock.rs | 2 +- rye/src/sync.rs | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rye/src/cli/list.rs b/rye/src/cli/list.rs index fe87ed51e4..04a5db2f9b 100644 --- a/rye/src/cli/list.rs +++ b/rye/src/cli/list.rs @@ -26,7 +26,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } let self_venv = ensure_self_venv(CommandOutput::Normal)?; - let status = if Config::current().use_uf() { + let status = if Config::current().use_uv() { Command::new(self_venv.join(VENV_BIN).join("uv")) .arg("pip") .arg("freeze") diff --git a/rye/src/config.rs b/rye/src/config.rs index 856490ddb2..86488f9828 100644 --- a/rye/src/config.rs +++ b/rye/src/config.rs @@ -248,7 +248,7 @@ impl Config { } /// Indicates if the experimental uv support should be used. - pub fn use_uf(&self) -> bool { + pub fn use_uv(&self) -> bool { let yes = self .doc .get("behavior") diff --git a/rye/src/installer.rs b/rye/src/installer.rs index 25a529001a..b051bc1bcf 100644 --- a/rye/src/installer.rs +++ b/rye/src/installer.rs @@ -127,7 +127,7 @@ pub fn install( requirement.name.as_str(), )?; - let mut cmd = if Config::current().use_uf() { + let mut cmd = if Config::current().use_uv() { let mut cmd = Command::new(self_venv.join(VENV_BIN).join("uv")); cmd.arg("pip") .arg("install") diff --git a/rye/src/lock.rs b/rye/src/lock.rs index 2629c4e1af..3fabdb2e2c 100644 --- a/rye/src/lock.rs +++ b/rye/src/lock.rs @@ -316,7 +316,7 @@ fn generate_lockfile( fs::write(&requirements_file, b"")?; } - let mut cmd = if Config::current().use_uf() { + let mut cmd = if Config::current().use_uv() { let self_venv = ensure_self_venv(output)?; let mut cmd = Command::new(self_venv.join(VENV_BIN).join("uv")); cmd.arg("pip") diff --git a/rye/src/sync.rs b/rye/src/sync.rs index 732916858a..ecdc7b80bf 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -247,7 +247,7 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { } let tempdir = tempdir()?; - let mut sync_cmd = if Config::current().use_uf() { + let mut sync_cmd = if Config::current().use_uv() { let mut uv_sync_cmd = Command::new(self_venv.join(VENV_BIN).join("uv")); uv_sync_cmd.arg("pip").arg("sync"); let root = pyproject.workspace_path(); @@ -327,7 +327,7 @@ pub fn create_virtualenv( ) -> Result<(), Error> { let py_bin = get_toolchain_python_bin(py_ver)?; - let mut venv_cmd = if Config::current().use_uf() { + let mut venv_cmd = if Config::current().use_uv() { // try to kill the empty venv if there is one as uv can't work otherwise. fs::remove_dir(venv).ok(); let mut venv_cmd = Command::new(self_venv.join(VENV_BIN).join("uv")); @@ -371,7 +371,7 @@ pub fn create_virtualenv( } // uv can only do it now - if Config::current().use_uf() { + if Config::current().use_uv() { update_venv_sync_marker(output, venv); } From 21aaafa698a47695b441e83aea0e22839be2db11 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 16 Feb 2024 14:49:24 +0100 Subject: [PATCH 149/166] Link changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2f1f76765..f2b081f117 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ _Unreleased_ - Improved the error message if `config` is invoked without arguments. #660 +- Bump `uv` to 0.1.2. #665 + ## 0.24.0 From 9e59ce3b7b3109100c6819d21daf7686c8a075cd Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 16 Feb 2024 14:49:32 +0100 Subject: [PATCH 150/166] update uv to 0.1.2 (#665) --- 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 7b75845d67..9792421d9a 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -37,7 +37,7 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques suffix: None, }; -const SELF_VERSION: u64 = 11; +const SELF_VERSION: u64 = 12; const SELF_REQUIREMENTS: &str = r#" build==1.0.3 @@ -57,7 +57,7 @@ unearth==0.14.0 urllib3==2.0.7 virtualenv==20.25.0 ruff==0.1.14 -uv==0.1.0 +uv==0.1.2 "#; static FORCED_TO_UPDATE: AtomicBool = AtomicBool::new(false); From 175e2ff871a5aff6add6e0367afa08ae57953b9a Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Sat, 17 Feb 2024 00:10:01 +0000 Subject: [PATCH 151/166] rye-devtools: find-downloads packaging and improvements (#644) --- pyproject.toml | 1 + requirements-dev.lock | 20 +- requirements.lock | 19 +- rye-devtools/.python-version | 1 + rye-devtools/pyproject.toml | 28 ++ rye-devtools/src/rye_devtools/__init__.py | 1 + .../src/rye_devtools/find_downloads.py | 429 ++++++++++++++++++ 7 files changed, 495 insertions(+), 4 deletions(-) create mode 100644 rye-devtools/.python-version create mode 100644 rye-devtools/pyproject.toml create mode 100644 rye-devtools/src/rye_devtools/__init__.py create mode 100644 rye-devtools/src/rye_devtools/find_downloads.py diff --git a/pyproject.toml b/pyproject.toml index 216cc60c51..43067e34af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,3 +29,4 @@ managed = true serve-docs = "mkdocs serve" [tool.rye.workspace] +members = ["rye-devtools"] diff --git a/requirements-dev.lock b/requirements-dev.lock index 5879576ddc..bc4c841d1c 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -8,8 +8,12 @@ # with-sources: false -e file:. - # from workspace +-e file:rye-devtools +anyio==4.2.0 + # via httpx certifi==2023.5.7 + # via httpcore + # via httpx # via requests charset-normalizer==3.1.0 # via requests @@ -19,8 +23,17 @@ colorama==0.4.6 # via mkdocs-material ghp-import==2.1.0 # via mkdocs +h11==0.14.0 + # via httpcore +httpcore==1.0.2 + # via httpx +httpx==0.26.0 + # via rye-devtools idna==3.4 + # via anyio + # via httpx # via requests +isort==5.13.2 jinja2==3.1.2 # via mkdocs # via mkdocs-material @@ -66,10 +79,13 @@ pyyaml-env-tag==0.1 # via mkdocs regex==2023.5.5 # via mkdocs-material -requests==2.30.0 +requests==2.31.0 # via mkdocs-material six==1.16.0 # via python-dateutil +sniffio==1.3.0 + # via anyio + # via httpx urllib3==2.0.2 # via requests watchdog==3.0.0 diff --git a/requirements.lock b/requirements.lock index 5879576ddc..040b165533 100644 --- a/requirements.lock +++ b/requirements.lock @@ -8,8 +8,12 @@ # with-sources: false -e file:. - # from workspace +-e file:rye-devtools +anyio==4.2.0 + # via httpx certifi==2023.5.7 + # via httpcore + # via httpx # via requests charset-normalizer==3.1.0 # via requests @@ -19,7 +23,15 @@ colorama==0.4.6 # via mkdocs-material ghp-import==2.1.0 # via mkdocs +h11==0.14.0 + # via httpcore +httpcore==1.0.2 + # via httpx +httpx==0.26.0 + # via rye-devtools idna==3.4 + # via anyio + # via httpx # via requests jinja2==3.1.2 # via mkdocs @@ -66,10 +78,13 @@ pyyaml-env-tag==0.1 # via mkdocs regex==2023.5.5 # via mkdocs-material -requests==2.30.0 +requests==2.31.0 # via mkdocs-material six==1.16.0 # via python-dateutil +sniffio==1.3.0 + # via anyio + # via httpx urllib3==2.0.2 # via requests watchdog==3.0.0 diff --git a/rye-devtools/.python-version b/rye-devtools/.python-version new file mode 100644 index 0000000000..371cfe355d --- /dev/null +++ b/rye-devtools/.python-version @@ -0,0 +1 @@ +3.11.1 diff --git a/rye-devtools/pyproject.toml b/rye-devtools/pyproject.toml new file mode 100644 index 0000000000..8dd51a15fc --- /dev/null +++ b/rye-devtools/pyproject.toml @@ -0,0 +1,28 @@ +[project] +name = "rye-devtools" +version = "1.0.0" +description = "Development tools for rye" +authors = [{ name = "Armin Ronacher", email = "armin.ronacher@active-4.com" }] +dependencies = [ + "httpx>=0.26.0", +] +requires-python = ">= 3.11" + +[project.scripts] +find-downloads = "rye_devtools.find_downloads:main" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.rye] +managed = true +dev-dependencies = [ + "isort>=5.13.2", +] + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["src/rye_devtools"] diff --git a/rye-devtools/src/rye_devtools/__init__.py b/rye-devtools/src/rye_devtools/__init__.py new file mode 100644 index 0000000000..a61a8196bf --- /dev/null +++ b/rye-devtools/src/rye_devtools/__init__.py @@ -0,0 +1 @@ +from . import find_downloads diff --git a/rye-devtools/src/rye_devtools/find_downloads.py b/rye-devtools/src/rye_devtools/find_downloads.py new file mode 100644 index 0000000000..6dc878489e --- /dev/null +++ b/rye-devtools/src/rye_devtools/find_downloads.py @@ -0,0 +1,429 @@ +"""This script is used to generate rye/src/downloads.inc. + +It find the latest python-build-standalone releases, sorts them by +various factors (arch, platform, flavor) and generates download +links to be included into rye at build time. In addition it maintains +a manual list of pypy downloads to be included into rye at build +time. +""" +import asyncio +import itertools +import re +import sys +import time +import unittest +from dataclasses import dataclass +from datetime import datetime, timezone +from enum import Enum +from itertools import chain +from typing import Callable, Optional, Self +from urllib.parse import unquote + +import httpx + + +def log(*args, **kwargs): + print(*args, file=sys.stderr, **kwargs) + +def batched(iterable, n): + "Batch data into tuples of length n. The last batch may be shorter." + # batched('ABCDEFG', 3) --> ABC DEF G + if n < 1: + raise ValueError('n must be at least one') + it = iter(iterable) + while batch := tuple(itertools.islice(it, n)): + yield batch + +TOKEN = open("token.txt").read().strip() +RELEASE_URL = "https://api.github.com/repos/indygreg/python-build-standalone/releases" +HEADERS = { + "X-GitHub-Api-Version": "2022-11-28", + "Authorization": "Bearer " + TOKEN, +} +FLAVOR_PREFERENCES = [ + "shared-pgo", + "shared-noopt", + "shared-noopt", + "pgo+lto", + "lto", + "pgo", +] +HIDDEN_FLAVORS = [ + "debug", + "noopt", + "install_only", +] +SPECIAL_TRIPLES = { + "macos": "x86_64-apple-darwin", + "linux64": "x86_64-unknown-linux-gnu", + "windows-amd64": "x86_64-pc-windows-msvc", + "windows-x86-shared-pgo": "i686-pc-windows-msvc-shared-pgo", + "windows-amd64-shared-pgo": "x86_64-pc-windows-msvc-shared-pgo", + "windows-x86": "i686-pc-windows-msvc", + "linux64-musl": "x86_64-unknown-linux-musl", +} + +# matches these: https://doc.rust-lang.org/std/env/consts/constant.ARCH.html +ARCH_MAPPING = { + "x86_64": "x86_64", + "x86": "x86", + "i686": "x86", + "aarch64": "aarch64", +} + +# matches these: https://doc.rust-lang.org/std/env/consts/constant.OS.html +PLATFORM_MAPPING = { + "darwin": "macos", + "windows": "windows", + "linux": "linux", +} + +ENV_MAPPING = { + "gnu": "gnu", + # We must ignore musl for now + # "musl": "musl", +} + + +@dataclass(frozen=True) +class PlatformTriple: + arch: str + platform: str + environment: Optional[str] + flavor: str + + @classmethod + def from_str(cls, triple: str) -> Optional[Self]: + """Parse a triple into a PlatformTriple object.""" + + # The parsing functions are all very similar and we could abstract them into a single function + # but I think it's clearer to keep them separate. + def match_flavor(triple): + for flavor in FLAVOR_PREFERENCES + HIDDEN_FLAVORS: + if flavor in triple: + return flavor + return "" + + def match_mapping(pieces: list[str], mapping: dict[str, str]): + for i in reversed(range(0, len(pieces))): + if pieces[i] in mapping: + return mapping[pieces[i]], pieces[:i] + return None, pieces + + # We split by '-' and match back to front to extract the flavor, env, platform and archk + arch, platform, env, flavor = None, None, None, None + + # Map, old, special triplets to proper triples for parsing, or + # return the triple if it's not a special one + triple = SPECIAL_TRIPLES.get(triple, triple) + pieces = triple.split("-") + flavor = match_flavor(triple) + env, pieces = match_mapping(pieces, ENV_MAPPING) + platform, pieces = match_mapping(pieces, PLATFORM_MAPPING) + arch, pieces = match_mapping(pieces, ARCH_MAPPING) + + if flavor is None or arch is None or platform is None: + return + + if env is None and platform == "linux": + return + + return cls(arch, platform, env, flavor) + + def grouped(self) -> tuple[str, str]: + # for now we only group by arch and platform, because rust's PythonVersion doesn't have a notion + # of environment. Flavor will never be used to sort download choices and must not be included in grouping. + return self.arch, self.platform + # return self.arch, self.platform, self.environment or "" + + +@dataclass(frozen=True, order=True) +class PythonVersion: + major: int + minor: int + patch: int + + @classmethod + def from_str(cls, version: str) -> Self: + return cls(*map(int, version.split(".", 3))) + + +@dataclass(frozen=True) +class IndygregDownload: + version: PythonVersion + triple: PlatformTriple + url: str + + FILENAME_RE = re.compile( + r"""(?x) + ^ + cpython-(?P\d+\.\d+\.\d+?) + (?:\+\d+)? + -(?P.*?) + (?:-[\dT]+)?\.tar\.(?:gz|zst) + $ + """ + ) + + @classmethod + def from_url(cls, url) -> Optional[Self]: + base_name = unquote(url.rsplit("/")[-1]) + if base_name.endswith(".sha256"): + return + + match = cls.FILENAME_RE.match(base_name) + if match is None: + return + + # Parse version string and triplet string + version_str, triple_str = match.groups() + version = PythonVersion.from_str(version_str) + triple = PlatformTriple.from_str(triple_str) + if triple is None: + return + + return cls(version, triple, url) + + async def sha256(self, client: httpx.AsyncClient) -> Optional[str]: + """We only fetch the sha256 when needed. This generally is AFTER we have + decided that the download will be part of rye's download set""" + resp = await fetch(client, self.url + ".sha256", headers=HEADERS) + if 200 <= resp.status_code < 400: + return resp.text.strip() + return None + + +async def fetch(client: httpx.AsyncClient, page: str, headers: dict[str, str]): + """Fetch a page from GitHub API with ratelimit awareness.""" + resp = await client.get(page, headers=headers, timeout=90) + if ( + resp.status_code in [403, 429] + and resp.headers.get("x-ratelimit-remaining") == "0" + ): + # See https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api?apiVersion=2022-11-28 + if (retry_after := resp.headers.get("retry-after")) is not None: + log("got retry-after header. retrying in {retry_after} seconds.") + time.sleep(int(retry_after)) + + return await fetch(client, page, headers) + + if (retry_at := resp.headers.get("x-ratelimit-reset")) is not None: + utc = datetime.now(timezone.utc).timestamp() + retry_after = int(retry_at) - int(utc) + + log("got x-ratelimit-reset header. retrying in {retry_after} seconds.") + time.sleep(max(int(retry_at) - int(utc), 0)) + + return await fetch(client, page, headers) + + log("got rate limited but no information how long. waiting for 2 minutes") + time.sleep(60 * 2) + return await fetch(client, page, headers) + return resp + + +async def fetch_indiygreg_downloads( + client: httpx.AsyncClient, + pages: int = 100, +) -> dict[PythonVersion, dict[PlatformTriple, list[IndygregDownload]]]: + """Fetch all the indygreg downloads from the release API.""" + results = {} + + for page in range(1, pages): + log(f"Fetching page {page}") + resp = await fetch(client, "%s?page=%d" % (RELEASE_URL, page), headers=HEADERS) + rows = resp.json() + if not rows: + break + for row in rows: + for asset in row["assets"]: + url = asset["browser_download_url"] + if (download := IndygregDownload.from_url(url)) is not None: + results.setdefault(download.version, {}).setdefault(download.triple.grouped(), []).append(download) + return results + + +def pick_best_download(downloads: list[IndygregDownload]) -> Optional[IndygregDownload]: + """Pick the best download from the list of downloads.""" + + def preference(download: IndygregDownload) -> int: + try: + return FLAVOR_PREFERENCES.index(download.triple.flavor) + except ValueError: + return len(FLAVOR_PREFERENCES) + 1 + + downloads.sort(key=preference) + return downloads[0] if downloads else None + +async def fetch_sha256s( + client: httpx.AsyncClient, + indys: dict[PythonVersion, list[IndygregDownload]], + n: int = 10, +) -> dict[str, str]: + # flatten + downloads = (download for downloads in indys.values() for download in downloads) + length = sum([len(downloads) for downloads in indys.values()]) + + completed = 0 + tasks = [] + for batch in batched(downloads, n=n): + log(f"fetching {n} sha256s: {completed}/{length} completed") + async with asyncio.TaskGroup() as tg: + for download in batch: + task = tg.create_task(download.sha256(client)) + tasks.append((download.url, task)) + completed += n + return {url: task.result() for url, task in tasks} + +def render( + indys: dict[PythonVersion, list[IndygregDownload]], + pypy: dict[PythonVersion, dict[PlatformTriple, str]], + sha256s: dict[str, str] +): + """Render downloads.inc""" + log("Generating code and fetching sha256 of all cpython downloads.") + log("This can be slow......") + + print("// generated code, do not edit") + print("use std::borrow::Cow;") + print("pub const PYTHON_VERSIONS: &[(PythonVersion, &str, Option<&str>)] = &[") + + for version, downloads in sorted(pypy.items(), key=lambda v: v[0], reverse=True): + for triple, url in sorted(downloads.items(), key=lambda v: v[0].grouped()): + print( + f' (PythonVersion {{ name: Cow::Borrowed("pypy"), arch: Cow::Borrowed("{triple.arch}"), os: Cow::Borrowed("{triple.platform}"), major: {version.major}, minor: {version.minor}, patch: {version.patch}, suffix: None }}, "{url}", None),' + ) + + for version, downloads in sorted(indys.items(), key=lambda v: v[0], reverse=True): + for download in sorted(downloads, key=lambda v: v.triple.grouped()): + if (sha256 := sha256s.get(download.url)) is not None: + sha256_str = f'Some("{sha256}")' + else: + sha256_str = "None" + print( + f' (PythonVersion {{ name: Cow::Borrowed("cpython"), arch: Cow::Borrowed("{download.triple.arch}"), os: Cow::Borrowed("{download.triple.platform}"), major: {version.major}, minor: {version.minor}, patch: {version.patch}, suffix: None }}, "{download.url}", {sha256_str}),' + ) + print("];") + + +async def async_main(): + log("Rye download creator started.") + log("Fetching indygreg downloads...") + + indys = {} + # For every version, pick the best download per triple + # and store it in the results + async with httpx.AsyncClient(follow_redirects=True) as client: + downloads = await fetch_indiygreg_downloads(client, 100) + for version, download_choices in downloads.items(): + # Create a dict[PlatformTriple, list[IndygregDownload]]] + # for each version + for triple, choices in download_choices.items(): + if (best_download := pick_best_download(choices)) is not None: + indys.setdefault(version, []).append(best_download) + + sha256s = await fetch_sha256s(client, indys, n=25) + render(indys, PYPY_DOWNLOADS, sha256s) + +def main(): + asyncio.run(async_main()) + +# These are manually maintained for now +PYPY_DOWNLOADS = { + PythonVersion(3, 10, 12): { + PlatformTriple( + arch="x86_64", platform="linux", environment="gnu", flavor="" + ): "https://downloads.python.org/pypy/pypy3.10-v7.3.12-linux64.tar.bz2", + PlatformTriple( + arch="aarch64", platform="linux", environment="gnu", flavor="" + ): "https://downloads.python.org/pypy/pypy3.10-v7.3.12-aarch64.tar.bz2", + PlatformTriple( + arch="x86_64", platform="macos", environment=None, flavor="" + ): "https://downloads.python.org/pypy/pypy3.10-v7.3.12-macos_x86_64.tar.bz2", + PlatformTriple( + arch="aarch64", platform="macos", environment=None, flavor="" + ): "https://downloads.python.org/pypy/pypy3.10-v7.3.12-macos_arm64.tar.bz2", + PlatformTriple( + arch="x86_64", platform="windows", environment=None, flavor="" + ): "https://downloads.python.org/pypy/pypy3.10-v7.3.12-win64.zip", + }, + PythonVersion(3, 9, 16): { + PlatformTriple( + arch="x86_64", platform="linux", environment="gnu", flavor="" + ): "https://downloads.python.org/pypy/pypy3.9-v7.3.11-linux64.tar.bz2", + PlatformTriple( + arch="aarch64", platform="linux", environment="gnu", flavor="" + ): "https://downloads.python.org/pypy/pypy3.9-v7.3.11-aarch64.tar.bz2", + PlatformTriple( + arch="x86_64", platform="macos", environment=None, flavor="" + ): "https://downloads.python.org/pypy/pypy3.9-v7.3.11-macos_x86_64.tar.bz2", + PlatformTriple( + arch="aarch64", platform="macos", environment=None, flavor="" + ): "https://downloads.python.org/pypy/pypy3.9-v7.3.11-macos_arm64.tar.bz2", + PlatformTriple( + arch="x86_64", platform="windows", environment=None, flavor="" + ): "https://downloads.python.org/pypy/pypy3.9-v7.3.11-win64.zip", + }, + PythonVersion(3, 8, 16): { + PlatformTriple( + arch="x86_64", platform="linux", environment="gnu", flavor="" + ): "https://downloads.python.org/pypy/pypy3.8-v7.3.11-linux64.tar.bz2", + PlatformTriple( + arch="aarch64", platform="linux", environment="gnu", flavor="" + ): "https://downloads.python.org/pypy/pypy3.8-v7.3.11-aarch64.tar.bz2", + PlatformTriple( + arch="x86_64", platform="macos", environment=None, flavor="" + ): "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_x86_64.tar.bz2", + PlatformTriple( + arch="aarch64", platform="macos", environment=None, flavor="" + ): "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_arm64.tar.bz2", + PlatformTriple( + arch="x86_64", platform="windows", environment=None, flavor="" + ): "https://downloads.python.org/pypy/pypy3.8-v7.3.11-win64.zip", + }, + PythonVersion(3, 7, 13): { + PlatformTriple( + arch="x86_64", platform="linux", environment="gnu", flavor="" + ): "https://downloads.python.org/pypy/pypy3.7-v7.3.9-linux64.tar.bz2", + PlatformTriple( + arch="aarch64", platform="linux", environment="gnu", flavor="" + ): "https://downloads.python.org/pypy/pypy3.7-v7.3.9-aarch64.tar.bz2", + PlatformTriple( + arch="x86_64", platform="macos", environment=None, flavor="" + ): "https://downloads.python.org/pypy/pypy3.7-v7.3.9-osx64.tar.bz2", + PlatformTriple( + arch="x86_64", platform="windows", environment=None, flavor="" + ): "https://downloads.python.org/pypy/pypy3.7-v7.3.9-win64.zip", + }, +} + +if __name__ == "__main__": + main() + + +class Tests(unittest.TestCase): + def test_parse_triplets(self): + expected = { + "aarch64-apple-darwin-lto": PlatformTriple("aarch64", "macos", None, "lto"), + "aarch64-unknown-linux-gnu-pgo+lto": PlatformTriple( + "aarch64", "linux", "gnu", "pgo+lto" + ), + # "x86_64-unknown-linux-musl-debug": PlatformTriple( + # "x86_64", "linux", "musl", "debug" + # ), + "aarch64-unknown-linux-gnu-debug-full": PlatformTriple( + "aarch64", "linux", "gnu", "debug" + ), + "x86_64-unknown-linux-gnu-debug": PlatformTriple( + "x86_64", "linux", "gnu", "debug" + ), + "linux64": PlatformTriple("x86_64", "linux", "gnu", ""), + "ppc64le-unknown-linux-gnu-noopt-full": None, + "x86_64_v3-unknown-linux-gnu-lto": None, + "x86_64-pc-windows-msvc-shared-pgo": PlatformTriple( + "x86_64", "windows", None, "shared-pgo" + ), + } + + for input, expected in expected.items(): + self.assertEqual(PlatformTriple.from_str(input), expected, input) From 219eb51a8d9510a5a8e4192372e4792380c04bb1 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 17 Feb 2024 01:16:27 +0100 Subject: [PATCH 152/166] Port rye add to uv (#667) --- CHANGELOG.md | 3 + rye/src/cli/add.rs | 309 ++++++++++++++++++++++++++++++--------------- rye/src/sources.rs | 11 ++ 3 files changed, 220 insertions(+), 103 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2b081f117..aea9219c38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ _Unreleased_ - Bump `uv` to 0.1.2. #665 +- When `uv` is enabled, `rye add` now uses `uv` instead of `unearth` + internally. #667 + ## 0.24.0 diff --git a/rye/src/cli/add.rs b/rye/src/cli/add.rs index 7ac6c3d745..238087a7d3 100644 --- a/rye/src/cli/add.rs +++ b/rye/src/cli/add.rs @@ -1,4 +1,5 @@ use std::env; +use std::io::Write; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use std::str::FromStr; @@ -14,6 +15,7 @@ use crate::bootstrap::ensure_self_venv; use crate::config::Config; use crate::consts::VENV_BIN; use crate::pyproject::{BuildSystem, DependencyKind, ExpandedSources, PyProject}; +use crate::sources::PythonVersion; use crate::utils::{format_requirement, set_proxy_variables, CommandOutput}; const PACKAGE_FINDER_SCRIPT: &str = r#" @@ -217,16 +219,11 @@ pub struct Args { pub fn execute(cmd: Args) -> Result<(), Error> { let output = CommandOutput::from_quiet_and_verbose(cmd.quiet, cmd.verbose); - let mut python_path = ensure_self_venv(output).context("error bootstrapping venv")?; - let mut added = Vec::new(); - python_path.push(VENV_BIN); - python_path.push("python"); + let self_venv = ensure_self_venv(output).context("error bootstrapping venv")?; + let python_path = self_venv.join(VENV_BIN).join("python"); let mut pyproject_toml = PyProject::discover()?; - let py_ver = match pyproject_toml.target_python_version() { - Some(ver) => ver.format_simple(), - None => "".to_string(), - }; + let py_ver = pyproject_toml.venv_python_version()?; let dep_kind = if cmd.dev { DependencyKind::Dev } else if cmd.excluded { @@ -245,111 +242,47 @@ pub fn execute(cmd: Args) -> Result<(), Error> { bail!("path/url/git/features is not compatible with passing multiple requirements: expected one requirement.") } - for str_requirement in cmd.requirements { - let mut requirement = Requirement::from_str(&str_requirement)?; + let mut requirements = Vec::new(); + for str_requirement in &cmd.requirements { + let mut requirement = Requirement::from_str(str_requirement)?; cmd.req_extras.apply_to_requirement(&mut requirement)?; + requirements.push(requirement); + } - // if we are excluding, we do not want a specific dependency version - // stored, so we just skip the unearth step - if !cmd.excluded { - let matches = find_best_matches( + if !cmd.excluded { + if Config::current().use_uv() { + resolve_requirements_with_uv( &pyproject_toml, - &python_path, - Some(&py_ver), - &requirement, + &self_venv, + &py_ver, + &mut requirements, cmd.pre, + output, + &default_operator, )?; - if matches.is_empty() { - let all_matches = - find_best_matches(&pyproject_toml, &python_path, None, &requirement, cmd.pre) - .unwrap_or_default(); - if all_matches.is_empty() { - // if we did not consider pre-releases, maybe we could find it by doing so. In - // that case give the user a helpful warning before erroring. - if !cmd.pre { - let all_pre_matches = find_best_matches( - &pyproject_toml, - &python_path, - None, - &requirement, - true, - ) - .unwrap_or_default(); - if let Some(pre) = all_pre_matches.into_iter().next() { - warn!( - "{} ({}) was found considering pre-releases. Pass --pre to allow use.", - pre.name, - pre.version.unwrap_or_default() - ); - } - bail!( - "did not find package '{}' without using pre-releases.", - format_requirement(&requirement) - ); - } else { - bail!( - "did not find package '{}'", - format_requirement(&requirement) - ); - } - } else { - if output != CommandOutput::Quiet { - echo!("Available package versions:"); - for pkg in all_matches { - echo!( - " {} ({}) requires Python {}", - pkg.name, - pkg.version.unwrap_or_default(), - pkg.link - .as_ref() - .and_then(|x| x.requires_python.as_ref()) - .map_or("unknown", |x| x as &str) - ); - } - echo!("A possible solution is to raise the version in `requires-python` in `pyproject.toml`."); - } - bail!( - "did not find a version of package '{}' compatible with this version of Python.", - format_requirement(&requirement) - ); - } - } - - let m = matches.into_iter().next().unwrap(); - if m.version.is_some() && requirement.version_or_url.is_none() { - let version = Version::from_str(m.version.as_ref().unwrap()) - .map_err(|msg| anyhow!("invalid version: {}", msg))?; - requirement.version_or_url = Some(VersionOrUrl::VersionSpecifier( - VersionSpecifiers::from_iter(Some( - VersionSpecifier::new( - // local versions or versions with only one component cannot - // use ~= but need to use ==. - match default_operator { - _ if version.is_local() => Operator::Equal, - Operator::TildeEqual if version.release.len() < 2 => { - Operator::GreaterThanEqual - } - ref other => other.clone(), - }, - Version::from_str(m.version.as_ref().unwrap()) - .map_err(|msg| anyhow!("invalid version: {}", msg))?, - false, - ) - .map_err(|msg| anyhow!("invalid version specifier: {}", msg))?, - )), - )); + } else { + for requirement in &mut requirements { + resolve_requirements_with_unearth( + &pyproject_toml, + &python_path, + &py_ver, + requirement, + cmd.pre, + output, + &default_operator, + )?; } - requirement.name = m.name; } + } - pyproject_toml.add_dependency(&requirement, &dep_kind)?; - added.push(requirement); + for requirement in &requirements { + pyproject_toml.add_dependency(requirement, &dep_kind)?; } pyproject_toml.save()?; if output != CommandOutput::Quiet { - for ref requirement in added { + for ref requirement in requirements { echo!( "Added {} as {} dependency", format_requirement(requirement), @@ -361,10 +294,106 @@ pub fn execute(cmd: Args) -> Result<(), Error> { Ok(()) } -fn find_best_matches( +fn resolve_requirements_with_unearth( + pyproject_toml: &PyProject, + python_path: &PathBuf, + py_ver: &PythonVersion, + requirement: &mut Requirement, + pre: bool, + output: CommandOutput, + default_operator: &Operator, +) -> Result<(), Error> { + let matches = find_best_matches_with_unearth( + pyproject_toml, + python_path, + Some(py_ver), + requirement, + pre, + )?; + if matches.is_empty() { + let all_matches = + find_best_matches_with_unearth(pyproject_toml, python_path, None, requirement, pre) + .unwrap_or_default(); + if all_matches.is_empty() { + // if we did not consider pre-releases, maybe we could find it by doing so. In + // that case give the user a helpful warning before erroring. + if !pre { + let all_pre_matches = find_best_matches_with_unearth( + pyproject_toml, + python_path, + None, + requirement, + true, + ) + .unwrap_or_default(); + if let Some(pre) = all_pre_matches.into_iter().next() { + warn!( + "{} ({}) was found considering pre-releases. Pass --pre to allow use.", + pre.name, + pre.version.unwrap_or_default() + ); + } + bail!( + "did not find package '{}' without using pre-releases.", + format_requirement(requirement) + ); + } else { + bail!("did not find package '{}'", format_requirement(requirement)); + } + } else { + if output != CommandOutput::Quiet { + echo!("Available package versions:"); + for pkg in all_matches { + echo!( + " {} ({}) requires Python {}", + pkg.name, + pkg.version.unwrap_or_default(), + pkg.link + .as_ref() + .and_then(|x| x.requires_python.as_ref()) + .map_or("unknown", |x| x as &str) + ); + } + echo!("A possible solution is to raise the version in `requires-python` in `pyproject.toml`."); + } + bail!( + "did not find a version of package '{}' compatible with this version of Python.", + format_requirement(requirement) + ); + } + } + let m = matches.into_iter().next().unwrap(); + if m.version.is_some() && requirement.version_or_url.is_none() { + let version = Version::from_str(m.version.as_ref().unwrap()) + .map_err(|msg| anyhow!("invalid version: {}", msg))?; + requirement.version_or_url = Some(VersionOrUrl::VersionSpecifier( + VersionSpecifiers::from_iter(Some( + VersionSpecifier::new( + // local versions or versions with only one component cannot + // use ~= but need to use ==. + match *default_operator { + _ if version.is_local() => Operator::Equal, + Operator::TildeEqual if version.release.len() < 2 => { + Operator::GreaterThanEqual + } + ref other => other.clone(), + }, + Version::from_str(m.version.as_ref().unwrap()) + .map_err(|msg| anyhow!("invalid version: {}", msg))?, + false, + ) + .map_err(|msg| anyhow!("invalid version specifier: {}", msg))?, + )), + )); + } + requirement.name = m.name; + Ok(()) +} + +fn find_best_matches_with_unearth( pyproject: &PyProject, python_path: &PathBuf, - py_ver: Option<&str>, + py_ver: Option<&PythonVersion>, requirement: &Requirement, pre: bool, ) -> Result, Error> { @@ -374,7 +403,10 @@ fn find_best_matches( unearth .arg("-c") .arg(PACKAGE_FINDER_SCRIPT) - .arg(py_ver.unwrap_or("")) + .arg(match py_ver { + Some(ver) => ver.format_simple(), + None => "".into(), + }) .arg(&format_requirement(requirement).to_string()) .arg(serde_json::to_string(&sources)?); if pre { @@ -393,3 +425,74 @@ fn find_best_matches( ); } } + +fn resolve_requirements_with_uv( + pyproject_toml: &PyProject, + self_venv: &Path, + py_ver: &PythonVersion, + requirements: &mut [Requirement], + pre: bool, + output: CommandOutput, + default_operator: &Operator, +) -> Result<(), Error> { + let mut cmd = Command::new(self_venv.join(VENV_BIN).join("uv")); + cmd.arg("pip") + .arg("compile") + .arg("--python-version") + .arg(py_ver.format_simple()) + .arg("--no-deps") + .arg("--no-header") + .arg("-") + .env("VIRTUAL_ENV", pyproject_toml.venv_path().as_os_str()); + if pre { + cmd.arg("--prerelease=allow"); + } + if output == CommandOutput::Quiet { + cmd.arg("-q"); + } + let mut child = cmd + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn()?; + let child_stdin = child.stdin.as_mut().unwrap(); + for requirement in &*requirements { + writeln!(child_stdin, "{}", requirement)?; + } + + let rv = child.wait_with_output()?; + if !rv.status.success() { + let log = String::from_utf8_lossy(&rv.stderr); + bail!("failed to resolve packages:\n{}", log); + } + + for (line, req) in String::from_utf8_lossy(&rv.stdout) + .lines() + .zip(requirements) + { + *req = line.parse()?; + if let Some(ref mut version_or_url) = req.version_or_url { + if let VersionOrUrl::VersionSpecifier(ref mut specs) = version_or_url { + *version_or_url = VersionOrUrl::VersionSpecifier(VersionSpecifiers::from_iter({ + let mut new_specs = Vec::new(); + for spec in specs.iter() { + let op = match *default_operator { + _ if spec.version().is_local() => Operator::Equal, + Operator::TildeEqual if spec.version().release.len() < 2 => { + Operator::GreaterThanEqual + } + ref other => other.clone(), + }; + new_specs.push( + VersionSpecifier::new(op, spec.version().clone(), false) + .map_err(|msg| anyhow!("invalid version specifier: {}", msg))?, + ); + } + new_specs + })); + } + } + } + + Ok(()) +} diff --git a/rye/src/sources.rs b/rye/src/sources.rs index f9e2f45901..72c680b2c5 100644 --- a/rye/src/sources.rs +++ b/rye/src/sources.rs @@ -144,6 +144,17 @@ impl From for Version { } } +impl PythonVersion { + /// Returns a simplified format of the version request. + pub fn format_simple(&self) -> String { + use std::fmt::Write; + let mut rv = format!("{}", self.major); + write!(rv, ".{}", self.minor).unwrap(); + write!(rv, ".{}", self.patch).unwrap(); + rv + } +} + /// Internal descriptor for a python version request. #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone)] pub struct PythonVersionRequest { From 6a96cf7d68aba5b6652ce002aeb630201fea476b Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 17 Feb 2024 01:32:49 +0100 Subject: [PATCH 153/166] Better wording for the shim wizard (#669) --- CHANGELOG.md | 2 ++ rye/src/cli/rye.rs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aea9219c38..290e205387 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ _Unreleased_ - When `uv` is enabled, `rye add` now uses `uv` instead of `unearth` internally. #667 +- The installer now has slightly better wording for what the shims are doing. #669 + ## 0.24.0 diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index db783694e9..55805d51d6 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -466,9 +466,9 @@ fn perform_install( .is_none() && (matches!(mode, InstallMode::NoPrompts) || dialoguer::Select::with_theme(tui_theme()) - .with_prompt("Determine Rye's python Shim behavior outside of Rye managed projects") - .item("Make Rye's own Python distribution available") - .item("Transparently pass through to non Rye (system, pyenv, etc.) Python") + .with_prompt("What should running `python` or `python3` do when you are not inside a Rye managed project?") + .item("Run a Python installed and managed by Rye") + .item("Run the old default Python (provided by your OS, pyenv, etc.)") .default(0) .interact()? == 0) From 16a4928a9cb6588f9c19d25a324a31578644c18d Mon Sep 17 00:00:00 2001 From: Chris Pryer <14341145+cnpryer@users.noreply.github.com> Date: Sat, 17 Feb 2024 06:26:41 -0500 Subject: [PATCH 154/166] Default to use opt-in behavior for `uv` during no-prompt installation (#672) --- 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 55805d51d6..8196088983 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -446,14 +446,14 @@ fn perform_install( .get("behavior") .and_then(|x| x.get("use-uv")) .is_none() - && (matches!(mode, InstallMode::NoPrompts) - || dialoguer::Select::with_theme(tui_theme()) - .with_prompt("Select the preferred package installer") - .item("pip-tools (slow but stable)") - .item("uv (quick but experimental)") - .default(0) - .interact()? - == 1) + && !matches!(mode, InstallMode::NoPrompts) + && dialoguer::Select::with_theme(tui_theme()) + .with_prompt("Select the preferred package installer") + .item("pip-tools (slow but stable)") + .item("uv (quick but experimental)") + .default(0) + .interact()? + == 1 { toml::ensure_table(config_doc, "behavior")["use-uv"] = toml_edit::value(true); } From 4e9336455f110ab37d4e81af4385daa4ad6434bb Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 17 Feb 2024 06:27:06 -0500 Subject: [PATCH 155/166] Docs: add config setting for uv. CLI: Standardize Python Capitalization, refine some CLI messages (#670) --- docs/guide/config.md | 4 ++++ rye/src/bootstrap.rs | 4 ++-- rye/src/cli/fetch.rs | 2 +- rye/src/cli/init.rs | 2 +- rye/src/cli/rye.rs | 6 +++--- rye/src/cli/shim.rs | 11 ++++++++--- rye/src/config.rs | 2 +- rye/src/pyproject.rs | 4 ++-- rye/src/sync.rs | 2 +- 9 files changed, 23 insertions(+), 14 deletions(-) diff --git a/docs/guide/config.md b/docs/guide/config.md index 7c8e3b8224..933532f1a2 100644 --- a/docs/guide/config.md +++ b/docs/guide/config.md @@ -81,6 +81,10 @@ force-rye-managed = false # virtual environments. global-python = false +# When set to `true` enables experimental support of uv as a replacement +# for pip-tools. Learn more about uv here: https://github.com/astral-sh/uv +use-uv = false + # Marks the managed .venv in a way that cloud based synchronization systems # like Dropbox and iCloud Files will not upload it. This defaults to true # as a .venv in cloud storage typically does not make sense. Set this to diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index 9792421d9a..fdc1a2975c 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -345,7 +345,7 @@ fn ensure_latest_self_toolchain(output: CommandOutput) -> Result Result<(), Error> { } }; - fetch(&version, output).context("error while fetching python installation")?; + fetch(&version, output).context("error while fetching Python installation")?; Ok(()) } diff --git a/rye/src/cli/init.rs b/rye/src/cli/init.rs index 8156791e6a..e87f4b4529 100644 --- a/rye/src/cli/init.rs +++ b/rye/src/cli/init.rs @@ -307,7 +307,7 @@ pub fn execute(cmd: Args) -> Result<(), Error> { .map_err(|msg| anyhow!("invalid version specifier: {}", msg))? .contains(&py.clone().into()) { - warn!("conflicted python version with project's requires-python, will auto fix it."); + warn!("conflicted Python version with project's requires-python, will auto fix it."); requires_python = format!(">= {}.{}", py.major, py.minor.unwrap_or_default()); } diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index 8196088983..5a966f0b63 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -386,7 +386,7 @@ fn perform_install( if matches!(mode, InstallMode::AutoInstall) { echo!(); echo!("Rye has detected that it's not installed on this computer yet and"); - echo!("automatically started the installer for you. For more information"); + echo!("automatically started the installer for you. For more information"); echo!( "read {}", style("https://rye-up.com/guide/installation/").yellow() @@ -424,7 +424,7 @@ fn perform_install( warn!("your Windows configuration does not support symlinks."); echo!(); echo!("It's strongly recommended that you enable developer mode in Windows to"); - echo!("enable symlinks. You need to enable this before continuing the setup."); + 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() @@ -594,7 +594,7 @@ fn perform_install( ); echo!(); } - echo!("For more information read https://mitsuhiko.github.io/rye/guide/installation"); + echo!("For more information read https://rye-up.com/guide/installation/"); } } #[cfg(windows)] diff --git a/rye/src/cli/shim.rs b/rye/src/cli/shim.rs index 71cd0bd40e..c74757f32e 100644 --- a/rye/src/cli/shim.rs +++ b/rye/src/cli/shim.rs @@ -236,7 +236,7 @@ fn get_shim_target( remove1 = true; ( PythonVersionRequest::from_str(rest) - .context("invalid python version requested from command line")?, + .context("invalid Python version requested from command line")?, false, ) } else if config.global_python() { @@ -317,9 +317,14 @@ pub fn execute_shim(args: &[OsString]) -> Result<(), Error> { match spawn_shim(args)? {} } else if is_python_shim(&shim_name) { if pyproject.is_some() { - bail!("target python binary '{}' not found in project. Most likely running 'rye sync' will resolve this.", shim_name); + bail!("Target Python binary '{}' not found in project. Most likely running 'rye sync' will resolve this.", shim_name); } else { - bail!("target python binary '{}' not found. You're outside of a project, consider enabling global shims: https://rye-up.com/guide/shims/#global-shims", shim_name); + bail!( + "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 + ); } } else { bail!("target shim binary '{}' not found", shim_name); diff --git a/rye/src/config.rs b/rye/src/config.rs index 86488f9828..86584ec3fa 100644 --- a/rye/src/config.rs +++ b/rye/src/config.rs @@ -256,7 +256,7 @@ impl Config { .and_then(|x| x.as_bool()) .unwrap_or(false); if yes && cfg!(windows) { - warn!("uv enabled in config but not supported on windows"); + warn!("uv is enabled in the configuration, but this feature is not currently supported on Windows"); false } else { yes diff --git a/rye/src/pyproject.rs b/rye/src/pyproject.rs index d311af74bc..06398f41e3 100644 --- a/rye/src/pyproject.rs +++ b/rye/src/pyproject.rs @@ -1126,7 +1126,7 @@ fn resolve_intended_venv_python_version( .or_else(|| Config::current().default_toolchain().ok()) .ok_or_else(|| { anyhow!( - "could not determine a target python version. Define requires-python in \ + "could not determine a target Python version. Define requires-python in \ pyproject.toml or use a .python-version file" ) })?; @@ -1139,7 +1139,7 @@ fn resolve_intended_venv_python_version( Ok(latest) } else { Err(anyhow!( - "Unable to determine target virtualenv python version" + "Unable to determine target virtualenv Python version" )) } } diff --git a/rye/src/sync.rs b/rye/src/sync.rs index ecdc7b80bf..c899c5b93a 100644 --- a/rye/src/sync.rs +++ b/rye/src/sync.rs @@ -132,7 +132,7 @@ pub fn sync(mut cmd: SyncOptions) -> Result<(), Error> { } } else if cmd.force { if cmd.output != CommandOutput::Quiet { - echo!("Forcing re-creation of non rye managed virtualenv"); + echo!("Forcing re-creation of non-rye managed virtualenv"); } recreate = true; } else if cmd.mode == SyncMode::PythonOnly { From e7be83797eeddb59c24a6fb4a0e10ca531c2ac89 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 17 Feb 2024 12:30:08 +0100 Subject: [PATCH 156/166] Enable uv on windows too (#675) --- CHANGELOG.md | 4 +++- rye/src/bootstrap.rs | 2 +- rye/src/config.rs | 11 ++--------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 290e205387..5e974af823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,13 +9,15 @@ _Unreleased_ - Improved the error message if `config` is invoked without arguments. #660 -- Bump `uv` to 0.1.2. #665 +- Bump `uv` to 0.1.3. #665, #675 - When `uv` is enabled, `rye add` now uses `uv` instead of `unearth` internally. #667 - The installer now has slightly better wording for what the shims are doing. #669 +- `uv` can now also be enabled on windows. #675 + ## 0.24.0 diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index fdc1a2975c..317f123301 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -57,7 +57,7 @@ unearth==0.14.0 urllib3==2.0.7 virtualenv==20.25.0 ruff==0.1.14 -uv==0.1.2 +uv==0.1.3 "#; static FORCED_TO_UPDATE: AtomicBool = AtomicBool::new(false); diff --git a/rye/src/config.rs b/rye/src/config.rs index 86584ec3fa..03c5ffb07f 100644 --- a/rye/src/config.rs +++ b/rye/src/config.rs @@ -249,17 +249,10 @@ impl Config { /// Indicates if the experimental uv support should be used. pub fn use_uv(&self) -> bool { - let yes = self - .doc + self.doc .get("behavior") .and_then(|x| x.get("use-uv")) .and_then(|x| x.as_bool()) - .unwrap_or(false); - if yes && cfg!(windows) { - warn!("uv is enabled in the configuration, but this feature is not currently supported on Windows"); - false - } else { - yes - } + .unwrap_or(false) } } From 45ca7b6a1d74441a0aaac2917ba15b8c3583eb00 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 17 Feb 2024 06:57:34 -0500 Subject: [PATCH 157/166] added tests for config.rs (#674) Co-authored-by: Armin Ronacher --- rye/src/config.rs | 149 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) diff --git a/rye/src/config.rs b/rye/src/config.rs index 03c5ffb07f..2438f2241e 100644 --- a/rye/src/config.rs +++ b/rye/src/config.rs @@ -256,3 +256,152 @@ impl Config { .unwrap_or(false) } } + +#[cfg(test)] +mod config_tests { + use super::*; + use std::fs::File; + use std::io::Write; + use tempfile::{tempdir, TempDir}; + + fn setup_config(contents: &str) -> (PathBuf, TempDir) { + let dir = tempdir().unwrap(); + let file_path = dir.path().join("config.toml"); + let mut file = File::create(&file_path).unwrap(); + writeln!(file, "{}", contents).unwrap(); + (file_path, dir) // Return the path and the TempDir to keep it alive + } + + #[test] + fn test_load_config() { + let (cfg_path, _temp_dir) = setup_config("[default]\nrequires-python = '>= 3.6'"); + + assert!( + cfg_path.exists(), + "Config file does not exist at {:?}", + cfg_path + ); + + let load_result = Config::from_path(&cfg_path); + assert!( + load_result.is_ok(), + "Failed to load config: {:?}", + load_result.err() + ); + + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + assert_eq!(cfg.default_requires_python(), ">= 3.6"); + } + + #[test] + fn test_default_requires_python() { + let (cfg_path, _temp_dir) = setup_config(""); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + assert_eq!(cfg.default_requires_python(), ">= 3.8"); + } + + #[test] + fn test_default_toolchain() { + let (cfg_path, _temp_dir) = setup_config("[default]\ntoolchain = '3.8'"); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + let toolchain = cfg.default_toolchain().unwrap(); + assert_eq!(toolchain.major, 3); + assert_eq!(toolchain.minor.unwrap(), 8); + } + #[test] + fn test_default_build_system() { + let (cfg_path, _temp_dir) = setup_config("[default]\nbuild-system = 'setuptools'"); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + assert_eq!(cfg.default_build_system(), Some(BuildSystem::Setuptools)); + } + + #[test] + fn test_default_license() { + let (cfg_path, _temp_dir) = setup_config("[default]\nlicense = 'MIT'"); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + assert_eq!(cfg.default_license(), Some("MIT".to_string())); + } + + #[test] + fn test_default_author() { + let (cfg_path, _temp_dir) = setup_config( + r#"[default] +author = "John Doe ""#, + ); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + let (name, email) = cfg.default_author(); + assert_eq!(name, Some("John Doe".to_string())); + assert_eq!(email, Some("john@example.com".to_string())); + } + + #[test] + fn test_global_python() { + let (cfg_path, _temp_dir) = setup_config("[behavior]\nglobal-python = true"); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + assert!(cfg.global_python()); + } + + #[test] + fn test_force_rye_managed() { + let (cfg_path, _temp_dir) = setup_config("[behavior]\nforce-rye-managed = true"); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + assert!(cfg.force_rye_managed()); + } + + #[test] + fn test_venv_mark_sync_ignore() { + let (cfg_path, _temp_dir) = setup_config("[behavior]\nvenv-mark-sync-ignore = false"); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + assert!(!cfg.venv_mark_sync_ignore()); + } + + #[test] + fn test_http_proxy_url() { + let (cfg_path, _temp_dir) = setup_config("[proxy]\nhttp = 'http://proxy.example.com'"); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + assert_eq!( + cfg.http_proxy_url(), + Some("http://proxy.example.com".to_string()) + ); + } + + #[test] + fn test_https_proxy_url() { + let (cfg_path, _temp_dir) = setup_config("[proxy]\nhttps = 'https://proxy.example.com'"); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + assert_eq!( + cfg.https_proxy_url(), + Some("https://proxy.example.com".to_string()) + ); + } + + #[test] + fn test_http_proxy_env_override() { + let (cfg_path, _temp_dir) = setup_config("[proxy]\nhttp = 'http://proxy.example.com'"); + std::env::set_var("http_proxy", "http://env-proxy.example.com"); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + assert_eq!( + cfg.http_proxy_url(), + Some("http://env-proxy.example.com".to_string()) + ); + std::env::remove_var("http_proxy"); // Clean up + } + + #[test] + fn test_sources_default_inclusion() { + let (cfg_path, _temp_dir) = setup_config(""); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + let sources = cfg.sources().expect("Failed to get sources"); + assert!(sources + .iter() + .any(|src| src.name == "default" && src.url == "https://pypi.org/simple/")); + } + + #[test] + fn test_use_uv() { + let (cfg_path, _temp_dir) = setup_config("[behavior]\nuse-uv = true"); + let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); + // Assuming cfg!(windows) is false in this test environment + assert!(cfg.use_uv()); + } +} From 3ac3170807b1360dd649626c9aa4928450b18d13 Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Sat, 17 Feb 2024 16:14:16 +0000 Subject: [PATCH 158/166] partially revert 45ca7b6a1d74441a0aaac2917ba15b8c3583eb00 (#678) --- rye/src/config.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/rye/src/config.rs b/rye/src/config.rs index 2438f2241e..dcb8a49768 100644 --- a/rye/src/config.rs +++ b/rye/src/config.rs @@ -375,18 +375,6 @@ author = "John Doe ""#, ); } - #[test] - fn test_http_proxy_env_override() { - let (cfg_path, _temp_dir) = setup_config("[proxy]\nhttp = 'http://proxy.example.com'"); - std::env::set_var("http_proxy", "http://env-proxy.example.com"); - let cfg = Config::from_path(&cfg_path).expect("Failed to load config"); - assert_eq!( - cfg.http_proxy_url(), - Some("http://env-proxy.example.com".to_string()) - ); - std::env::remove_var("http_proxy"); // Clean up - } - #[test] fn test_sources_default_inclusion() { let (cfg_path, _temp_dir) = setup_config(""); From 69e251ab3b36466279670b2c393853507fbb58ea Mon Sep 17 00:00:00 2001 From: Daniel Bauer <4690162+dnlbauer@users.noreply.github.com> Date: Sat, 17 Feb 2024 20:15:42 +0100 Subject: [PATCH 159/166] Replace deprecated `rye show --installed-deps` with `list` in documentation (#679) According to the CLI warning, `rye show --installed-deps` is deprecated in favor of `rye list`. This should be reflected in the manual. --- docs/guide/basics.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/guide/basics.md b/docs/guide/basics.md index a635101792..62099c82a2 100644 --- a/docs/guide/basics.md +++ b/docs/guide/basics.md @@ -78,6 +78,15 @@ Note that after `add` you need to run `sync` again to actually install it. If y want to add packages from custom indexes, you have to [configure the source](sources.md) first. +## Listing Dependencies + +You can invoke `rye list` to get a dump of all installed dependencies of your project. +Note that this only lists dependencies that are actually installed, so make sure to `sync` first. + +``` +rye list +``` + ## Remove a Dependency Use the `remove` command to remove a dependency from the project again. @@ -122,10 +131,8 @@ deactivate The `rye show` command can print out information about the project's state. By just running `rye show` you can see which Python version is used, where the -virtualenv is located and more. You can also invoke `rye show --installed-deps` -to get a dump of all installed dependencies. +virtualenv is located and more. ``` rye show -rye show --installed-deps ``` From d950ca25b032d59846b78aba3dfb1284e3d04505 Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Sat, 17 Feb 2024 22:34:26 +0000 Subject: [PATCH 160/166] Add --modify-path and --no-modify-path to self install (#664) --- rye/src/cli/rye.rs | 91 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 83 insertions(+), 8 deletions(-) diff --git a/rye/src/cli/rye.rs b/rye/src/cli/rye.rs index 5a966f0b63..e5e3d00750 100644 --- a/rye/src/cli/rye.rs +++ b/rye/src/cli/rye.rs @@ -96,6 +96,50 @@ pub struct InstallCommand { /// Use a specific toolchain version. #[arg(long)] toolchain_version: Option, + + #[command(flatten)] + mp: ModifyPath, +} + +#[derive(Parser, Debug)] +#[group(required = false, multiple = false)] +pub struct ModifyPath { + /// Always modify without asking the PATH environment variable. + #[arg(long)] + modify_path: bool, + /// Do not modify the PATH environment variable. + #[arg(long)] + no_modify_path: bool, +} + +#[derive(Debug, Copy, Clone)] +enum YesNoArg { + Yes, + No, + Ask, +} + +impl YesNoArg { + fn with_yes(&self, yes: bool) -> Self { + match (yes, self) { + (true, Self::Ask) => Self::Yes, + _ => *self, + } + } +} +impl From for YesNoArg { + fn from(other: ModifyPath) -> Self { + // Argument parsing logic is a bit complex here: + match (other.modify_path, other.no_modify_path) { + // 1. If --modify-path is set and --no-modify-path is not set, we always modify the path without prompting. + (true, false) => YesNoArg::Yes, + // 2. If --no-modify-path is set and --modify-path is not set, we never modify the path. + (false, true) => YesNoArg::No, + // 3. Otherwise we ask the user + (false, false) => YesNoArg::Ask, + (true, true) => unreachable!(), + } + } } #[derive(Debug, Copy, Clone)] @@ -263,6 +307,7 @@ fn install(args: InstallCommand) -> Result<(), Error> { }, args.toolchain.as_deref(), args.toolchain_version, + YesNoArg::from(args.mp).with_yes(args.yes), ) } @@ -351,6 +396,7 @@ fn perform_install( mode: InstallMode, toolchain_path: Option<&Path>, toolchain_version: Option, + modify_path: YesNoArg, ) -> Result<(), Error> { let mut config = Config::current(); let mut registered_toolchain: Option = None; @@ -547,11 +593,44 @@ fn perform_install( prompt_for_default_toolchain(registered_toolchain.unwrap(), config_doc)?; } + match modify_path { + YesNoArg::Yes => { + add_rye_to_path(&mode, shims.as_path(), false)?; + } + YesNoArg::No => { + echo!( + "Skipping PATH modification. You will need to add {} to your PATH manually.", + style(shims.display()).cyan() + ); + } + YesNoArg::Ask => { + add_rye_to_path(&mode, shims.as_path(), true)?; + } + } + + echo!(); + echo!("{}", style("All done!").green()); + + config.save()?; + + Ok(()) +} + +/// Add rye to the users path. +#[cfg_attr(windows, allow(unused_variables))] +fn add_rye_to_path(mode: &InstallMode, shims: &Path, ask: bool) -> Result<(), Error> { + let rye_home = env::var("RYE_HOME") + .map(Cow::Owned) + .unwrap_or(Cow::Borrowed(DEFAULT_HOME)); + let rye_home = Path::new(&*rye_home); + // For unices, we ask the user if they want rye to be added to PATH. + // If they choose to do so, we add the "env" script to .profile. + // See [`crate::utils::unix::add_to_path`]. #[cfg(unix)] { if !env::split_paths(&env::var_os("PATH").unwrap()) - .any(|x| same_file::is_same_file(x, &shims).unwrap_or(false)) + .any(|x| same_file::is_same_file(x, shims).unwrap_or(false)) { echo!(); echo!( @@ -562,6 +641,7 @@ fn perform_install( echo!("It is highly recommended that you add it."); if matches!(mode, InstallMode::NoPrompts) + || !ask || dialoguer::Confirm::with_theme(tui_theme()) .with_prompt(format!( "Should the installer add Rye to {} via .profile?", @@ -597,17 +677,12 @@ fn perform_install( echo!("For more information read https://rye-up.com/guide/installation/"); } } + // On Windows, we add the rye directory to the user's PATH unconditionally. #[cfg(windows)] { crate::utils::windows::add_to_programs(rye_home)?; crate::utils::windows::add_to_path(rye_home)?; } - - echo!(); - echo!("{}", style("All done!").green()); - - config.save()?; - Ok(()) } @@ -656,7 +731,7 @@ pub fn auto_self_install() -> Result { crate::request_continue_prompt(); } - perform_install(InstallMode::AutoInstall, None, None)?; + perform_install(InstallMode::AutoInstall, None, None, YesNoArg::Yes)?; Ok(true) } } From be929a82c5835fb3988f808087dcc1aa0a17c659 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 18 Feb 2024 23:06:53 +0100 Subject: [PATCH 161/166] Fix quiet flag not working for init (#686) --- CHANGELOG.md | 2 ++ rye/src/cli/init.rs | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e974af823..bbfbc16af0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ _Unreleased_ - `uv` can now also be enabled on windows. #675 +- Fixed the `-q` parameter not working for the `init` command. #686 + ## 0.24.0 diff --git a/rye/src/cli/init.rs b/rye/src/cli/init.rs index e87f4b4529..786fafb132 100644 --- a/rye/src/cli/init.rs +++ b/rye/src/cli/init.rs @@ -341,12 +341,13 @@ pub fn execute(cmd: Args) -> Result<(), Error> { fs::write(&license_file, rv)?; } + let output = CommandOutput::from_quiet_and_verbose(cmd.quiet, cmd.verbose); + // initialize with no metadata let mut metadata = Metadata::new(); // by default rye attempts to import metadata first. if !cmd.no_import { - let output = CommandOutput::from_quiet_and_verbose(cmd.quiet, cmd.verbose); let options = ImportOptions { output, requirements: cmd.requirements, @@ -524,13 +525,15 @@ pub fn execute(cmd: Args) -> Result<(), Error> { } } - echo!( - "{} Initialized {}project in {}", - style("success:").green(), - if is_virtual { "virtual " } else { "" }, - dir.display() - ); - echo!(" Run `rye sync` to get started"); + if output != CommandOutput::Quiet { + echo!( + "{} Initialized {}project in {}", + style("success:").green(), + if is_virtual { "virtual " } else { "" }, + dir.display() + ); + echo!(" Run `rye sync` to get started"); + } Ok(()) } From 67d2bc973b576996e2f8691b536a87ff51a83bf9 Mon Sep 17 00:00:00 2001 From: Jo <10510431+j178@users.noreply.github.com> Date: Mon, 19 Feb 2024 06:18:44 +0800 Subject: [PATCH 162/166] Remove unused ARCH argument from fetch (#681) --- CHANGELOG.md | 2 ++ docs/guide/commands/fetch.md | 4 ---- rye/src/cli/fetch.rs | 5 ----- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbfbc16af0..cc6ac6d2fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ _Unreleased_ - `uv` can now also be enabled on windows. #675 +- Removed the unsupported and un-used `arch` parameter from `fetch`. #681 + - Fixed the `-q` parameter not working for the `init` command. #686 diff --git a/docs/guide/commands/fetch.md b/docs/guide/commands/fetch.md index 625694640d..b1d1de9bef 100644 --- a/docs/guide/commands/fetch.md +++ b/docs/guide/commands/fetch.md @@ -29,10 +29,6 @@ success: Downloaded cpython@3.8.17 If no version is provided, the requested version will be fetched. -* `[ARCH]`: Overrides the architecture to fetch. - - When a non native architecture is fetched, the toolchain is installed under an alias. - ## Options * `-v, --verbose`: Enables verbose diagnostics diff --git a/rye/src/cli/fetch.rs b/rye/src/cli/fetch.rs index 70c52cc2b8..0f6f5d6816 100644 --- a/rye/src/cli/fetch.rs +++ b/rye/src/cli/fetch.rs @@ -15,11 +15,6 @@ pub struct Args { /// /// If no version is provided, the requested version will be fetched. version: Option, - /// Overrides the architecture to fetch. - /// - /// When a non native architecture is fetched, the toolchain is - /// installed under an alias. - arch: Option, /// Enables verbose diagnostics. #[arg(short, long)] verbose: bool, From 68a152a6d60454a999c7ddf139d454f32e9942fa Mon Sep 17 00:00:00 2001 From: Jo <10510431+j178@users.noreply.github.com> Date: Mon, 19 Feb 2024 06:18:59 +0800 Subject: [PATCH 163/166] Skip docs publish workflow on a fork or docs not changed (#684) --- .github/workflows/docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0a5b849201..f1f5c63f26 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,6 +1,8 @@ name: Publish docs via GitHub Pages on: push: + paths: + - 'docs/**' branches: - main @@ -14,6 +16,7 @@ jobs: - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@master + if: github.repository == 'mitsuhiko/rye' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CONFIG_FILE: mkdocs.yml From 78bf4d010d5e2e88ebce1ba636c7acec97fd454d Mon Sep 17 00:00:00 2001 From: Jo <10510431+j178@users.noreply.github.com> Date: Mon, 19 Feb 2024 06:20:13 +0800 Subject: [PATCH 164/166] Add suffix to PythonVersionRequest display (#682) --- rye/src/sources.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rye/src/sources.rs b/rye/src/sources.rs index 72c680b2c5..9f4dad4ee7 100644 --- a/rye/src/sources.rs +++ b/rye/src/sources.rs @@ -277,6 +277,9 @@ impl fmt::Display for PythonVersionRequest { write!(f, ".{}", minor)?; if let Some(ref patch) = self.patch { write!(f, ".{}", patch)?; + if let Some(ref suffix) = self.suffix { + write!(f, ".{}", suffix)?; + } } } Ok(()) From fe69262a6a7cb3fe08a176687b0b3cd88cfac8ab Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 19 Feb 2024 00:13:13 +0100 Subject: [PATCH 165/166] Added basic tests (#687) --- Cargo.lock | 60 ++++++++++++++ rye/Cargo.toml | 5 ++ rye/src/cli/add.rs | 3 + rye/src/lock.rs | 6 +- rye/tests/common/mod.rs | 168 ++++++++++++++++++++++++++++++++++++++++ rye/tests/test_sync.rs | 80 +++++++++++++++++++ 6 files changed, 321 insertions(+), 1 deletion(-) create mode 100644 rye/tests/common/mod.rs create mode 100644 rye/tests/test_sync.rs diff --git a/Cargo.lock b/Cargo.lock index 1e5f87b75e..0f032d6175 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -810,6 +810,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "fslock" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04412b8935272e3a9bae6f48c7bfff74c2911f60525404edfdd28e49884c3bfb" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1058,6 +1068,32 @@ dependencies = [ "generic-array", ] +[[package]] +name = "insta" +version = "1.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" +dependencies = [ + "console", + "lazy_static", + "linked-hash-map", + "regex", + "serde", + "similar", + "yaml-rust", +] + +[[package]] +name = "insta-cmd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809d3023d1d6e8d5c2206f199251f75cb26180e41f18cb0f22dd119161cb5127" +dependencies = [ + "insta", + "serde", + "serde_json", +] + [[package]] name = "instant" version = "0.1.12" @@ -1152,6 +1188,12 @@ dependencies = [ "serde_json", ] +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -1806,11 +1848,14 @@ dependencies = [ "decompress", "dialoguer", "flate2", + "fslock", "git-testament", "globset", "hex", "home", "indicatif", + "insta", + "insta-cmd", "junction", "license", "memchr", @@ -2005,6 +2050,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "similar" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" + [[package]] name = "slug" version = "0.1.5" @@ -2741,6 +2792,15 @@ dependencies = [ "rustix", ] +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + [[package]] name = "zerocopy" version = "0.7.32" diff --git a/rye/Cargo.toml b/rye/Cargo.toml index 3878f91ad1..79d0752a4c 100644 --- a/rye/Cargo.toml +++ b/rye/Cargo.toml @@ -71,3 +71,8 @@ winreg = "0.52.0" [target."cfg(windows)".build-dependencies] static_vcruntime = "2.0.0" + +[dev-dependencies] +fslock = "0.2.1" +insta = { version = "1.34.0", features = ["filters"] } +insta-cmd = "0.4.0" diff --git a/rye/src/cli/add.rs b/rye/src/cli/add.rs index 238087a7d3..8c8787258c 100644 --- a/rye/src/cli/add.rs +++ b/rye/src/cli/add.rs @@ -16,6 +16,7 @@ use crate::config::Config; use crate::consts::VENV_BIN; use crate::pyproject::{BuildSystem, DependencyKind, ExpandedSources, PyProject}; use crate::sources::PythonVersion; +use crate::sync::{sync, SyncOptions}; use crate::utils::{format_requirement, set_proxy_variables, CommandOutput}; const PACKAGE_FINDER_SCRIPT: &str = r#" @@ -251,6 +252,8 @@ pub fn execute(cmd: Args) -> Result<(), Error> { if !cmd.excluded { if Config::current().use_uv() { + sync(SyncOptions::python_only().pyproject(None)) + .context("failed to sync ahead of add")?; resolve_requirements_with_uv( &pyproject_toml, &self_venv, diff --git a/rye/src/lock.rs b/rye/src/lock.rs index 3fabdb2e2c..92f760cec4 100644 --- a/rye/src/lock.rs +++ b/rye/src/lock.rs @@ -4,7 +4,7 @@ use std::io::{BufWriter, Write}; use std::path::Path; use std::process::Command; use std::sync::Arc; -use std::{fmt, fs}; +use std::{env, fmt, fs}; use anyhow::{anyhow, bail, Context, Error}; use minijinja::render; @@ -331,6 +331,10 @@ fn generate_lockfile( } else if output == CommandOutput::Quiet { cmd.arg("-q"); } + // this primarily exists for testing + if let Ok(dt) = env::var("__RYE_UV_EXCLUDE_NEWER") { + cmd.arg("--exclude-newer").arg(dt); + } cmd } else { let mut cmd = Command::new(get_pip_compile(py_ver, output)?); diff --git a/rye/tests/common/mod.rs b/rye/tests/common/mod.rs new file mode 100644 index 0000000000..06bf8adfcb --- /dev/null +++ b/rye/tests/common/mod.rs @@ -0,0 +1,168 @@ +use std::ffi::OsStr; +use std::fs; +use std::path::{Path, PathBuf}; +use std::process::Command; + +use insta_cmd::get_cargo_bin; +use tempfile::TempDir; + +// Exclude any packages uploaded after this date. +pub static EXCLUDE_NEWER: &str = "2023-11-18T12:00:00Z"; + +pub const INSTA_FILTERS: &[(&str, &str)] = &[ + // general temp folders + ( + r"(\b[A-Z]:)?[\\/].*?[\\/]\.rye-tests---[^\\/]+[\\/]", + "[TEMP_PATH]/", + ), + // macos temp folder + (r"/var/folders/\S+?/T/\S+", "[TEMP_FILE]"), + // linux temp folders + (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"\\([\w\d.])", "/$1"), + (r"rye.exe", "rye"), +]; + +fn marked_tempdir() -> TempDir { + TempDir::with_prefix(".rye-tests---").unwrap() +} + +fn bootstrap_test_rye() -> PathBuf { + let home = get_cargo_bin("rye").parent().unwrap().join("rye-test-home"); + fs::create_dir_all(&home).ok(); + let lock_path = home.join("lock"); + let mut lock = fslock::LockFile::open(&lock_path).unwrap(); + lock.lock().unwrap(); + + // write config + let config_file = home.join("config.toml"); + if !config_file.is_file() { + fs::write( + home.join("config.toml"), + r#" +[behavior] +use-uv = true + +[default] +toolchain = "cpython@3.12.1" +"#, + ) + .unwrap(); + } + + // fetch the most important interpreters + for version in ["cpython@3.8.17", "cpython@3.11.7", "cpython@3.12.1"] { + if home.join("py").join(version).is_dir() { + continue; + } + let status = Command::new(get_bin()) + .env("RYE_HOME", &home) + .arg("fetch") + .arg(version) + .status() + .unwrap(); + assert!(status.success()); + } + + // make a dummy project to bootstrap it + if !home.join("self").is_dir() { + let t = marked_tempdir(); + Command::new(get_bin()) + .env("RYE_HOME", &home) + .current_dir(t.path()) + .arg("init") + .arg("--name=test-project") + .status() + .unwrap(); + Command::new(get_bin()) + .env("RYE_HOME", &home) + .current_dir(t.path()) + .arg("sync") + .status() + .unwrap(); + } + + lock.unlock().unwrap(); + + home +} + +pub fn get_bin() -> PathBuf { + get_cargo_bin("rye") +} + +pub struct Space { + #[allow(unused)] + tempdir: TempDir, + rye_home: PathBuf, + project_dir: PathBuf, +} + +impl Space { + pub fn new() -> Space { + let tempdir = marked_tempdir(); + let project_dir = tempdir.path().join("project"); + let rye_home = bootstrap_test_rye(); + fs::create_dir_all(&project_dir).unwrap(); + Space { + tempdir, + project_dir, + rye_home, + } + } + + pub fn cmd(&self, cmd: S) -> Command + where + S: AsRef, + { + let mut rv = Command::new(cmd); + rv.env("RYE_HOME", self.rye_home().as_os_str()); + rv.env("UV_CACHE_DIR", self.tempdir.path().join("uv-cache")); + rv.env("__RYE_UV_EXCLUDE_NEWER", EXCLUDE_NEWER); + rv.current_dir(self.project_path()); + rv + } + + pub fn rye_cmd(&self) -> Command { + self.cmd(get_bin()) + } + + pub fn init(&self, name: &str) { + let status = self + .cmd(get_bin()) + .arg("init") + .arg("--name") + .arg(name) + .arg("-q") + .current_dir(self.project_path()) + .status() + .unwrap(); + assert!(status.success()); + } + + pub fn rye_home(&self) -> &Path { + &self.rye_home + } + + pub fn project_path(&self) -> &Path { + &self.project_dir + } +} + +#[allow(unused_macros)] +macro_rules! rye_cmd_snapshot { + ($cmd:expr, @$snapshot:literal) => {{ + let mut settings = insta::Settings::clone_current(); + for (matcher, replacement) in $crate::common::INSTA_FILTERS { + settings.add_filter(matcher, *replacement); + } + let _guard = settings.bind_to_scope(); + insta_cmd::assert_cmd_snapshot!($cmd, @$snapshot); + }}; +} + +#[allow(unused_imports)] +pub(crate) use rye_cmd_snapshot; diff --git a/rye/tests/test_sync.rs b/rye/tests/test_sync.rs new file mode 100644 index 0000000000..ebd404c545 --- /dev/null +++ b/rye/tests/test_sync.rs @@ -0,0 +1,80 @@ +use crate::common::{rye_cmd_snapshot, Space}; + +mod common; + +#[test] +fn test_empty_sync() { + let space = Space::new(); + space.init("my-project"); + rye_cmd_snapshot!(space.rye_cmd().arg("sync"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + Initializing new virtualenv in [TEMP_PATH]/project/.venv + Python version: cpython@3.12.1 + Generating production lockfile: [TEMP_PATH]/project/requirements.lock + Generating dev lockfile: [TEMP_PATH]/project/requirements-dev.lock + Installing dependencies + Done! + + ----- stderr ----- + warning: Requirements file [TEMP_FILE] does not contain any dependencies + Built 1 editable in [EXECUTION_TIME] + Resolved 1 package in [EXECUTION_TIME] + warning: Requirements file [TEMP_FILE] does not contain any dependencies + Built 1 editable in [EXECUTION_TIME] + Resolved 1 package in [EXECUTION_TIME] + Built 1 editable in [EXECUTION_TIME] + Installed 1 package in [EXECUTION_TIME] + + my-project==0.1.0 (from file:[TEMP_PATH]/project) + "###); +} + +#[test] +fn test_add_and_sync() { + 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==3.0.0").arg("colorama"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + Initializing new virtualenv in [TEMP_PATH]/project/.venv + Python version: cpython@3.12.1 + Added colorama>=0.4.6 as regular dependency + Added flask>=3.0.0 as regular dependency + + ----- stderr ----- + "###); + rye_cmd_snapshot!(space.rye_cmd().arg("sync"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + 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 ----- + warning: Requirements file [TEMP_FILE] does not contain any dependencies + Built 1 editable in [EXECUTION_TIME] + Resolved 9 packages in [EXECUTION_TIME] + warning: Requirements file [TEMP_FILE] does not contain any dependencies + Built 1 editable in [EXECUTION_TIME] + Resolved 9 packages in [EXECUTION_TIME] + Built 1 editable in [EXECUTION_TIME] + Resolved 8 packages in [EXECUTION_TIME] + Downloaded 8 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 + "###); +} From 78c2f0a0f2469d033df3cae032261df427a2c7f7 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 19 Feb 2024 00:15:05 +0100 Subject: [PATCH 166/166] Configure rust-cache --- .github/workflows/clippy.yml | 1 + .github/workflows/docs.yml | 2 +- .github/workflows/rustfmt.yml | 1 + .github/workflows/tests.yml | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index fa1553cec5..e25e44e86e 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -12,5 +12,6 @@ jobs: with: toolchain: stable components: clippy, rustfmt + - uses: Swatinem/rust-cache@v2 - name: Run clippy run: make lint diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f1f5c63f26..4d89b67108 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout main uses: actions/checkout@v2 - + - uses: Swatinem/rust-cache@v2 - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@master if: github.repository == 'mitsuhiko/rye' diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index c4ff054695..7541e24dfe 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -12,5 +12,6 @@ jobs: with: toolchain: stable components: clippy, rustfmt + - uses: Swatinem/rust-cache@v2 - name: Run rustfmt run: make format-check diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7ef06700b2..6fe9383c3f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: stable + - uses: Swatinem/rust-cache@v2 - name: Check run: make check - name: Test @@ -26,6 +27,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: stable + - uses: Swatinem/rust-cache@v2 - name: Check run: make check - name: Test @@ -40,6 +42,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: stable + - uses: Swatinem/rust-cache@v2 - name: Check run: make check - name: Test