Skip to content

Commit

Permalink
Merge branch 'main' into sync-uv-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Dec 9, 2024
2 parents 266a82e + ade913e commit 17cf9b9
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 35 deletions.
4 changes: 2 additions & 2 deletions rye/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques
suffix: None,
};

const SELF_VERSION: u64 = 25;
const SELF_VERSION: u64 = 26;

pub const SELF_REQUIREMENTS: &str = r#"
build==1.2.1
Expand All @@ -51,7 +51,7 @@ twine==5.1.1
unearth==0.14.0
urllib3==2.0.7
virtualenv==20.25.0
ruff==0.7.0
ruff==0.8.2
"#;

static FORCED_TO_UPDATE: AtomicBool = AtomicBool::new(false);
Expand Down
2 changes: 1 addition & 1 deletion rye/src/pyproject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub enum DependencyKind<'a> {
Optional(Cow<'a, str>),
}

impl<'a> fmt::Display for DependencyKind<'a> {
impl fmt::Display for DependencyKind<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
DependencyKind::Normal => f.write_str("regular"),
Expand Down
30 changes: 30 additions & 0 deletions rye/src/sources/generated/python_downloads.inc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion rye/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ pub fn get_short_executable_name(path: &Path) -> String {
pub fn format_requirement(req: &Requirement) -> impl fmt::Display + '_ {
struct Helper<'x>(&'x Requirement);

impl<'x> fmt::Display for Helper<'x> {
impl fmt::Display for Helper<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0.name)?;
if let Some(extras) = &self.0.extras {
Expand Down
4 changes: 2 additions & 2 deletions rye/src/uv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,8 @@ impl ReadWriteVenv {
}

/// Resolves the given requirement and returns the resolved requirement.
/// This will spawn `uv` and read from it's stdout.
///
/// This will spawn `uv` and read from its stdout.
pub fn resolve(
&self,
py_version: &PythonVersion,
Expand Down
4 changes: 2 additions & 2 deletions rye/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ toolchain = "[email protected]"
// build info to make sure we cover our grounds here.
for (version, build_info) in [
("[email protected]", false),
("[email protected].10", true),
("[email protected].6", false),
("[email protected].11", true),
("[email protected].8", false),
("[email protected]", false),
] {
if home.join("py").join(version).is_dir() {
Expand Down
12 changes: 6 additions & 6 deletions rye/tests/test_add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn test_add_flask() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Added flask>=3.0.0 as regular dependency
Added colorama>=0.4.6 as regular dependency
Reusing already existing virtualenv
Expand Down Expand Up @@ -59,7 +59,7 @@ fn test_add_flask_dotenv() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Added flask[dotenv]>=3.0.0 as regular dependency
Added colorama>=0.4.6 as regular dependency
Reusing already existing virtualenv
Expand Down Expand Up @@ -112,7 +112,7 @@ fn test_add_from_find_links() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Added tqdm>=4.66.1 as regular dependency
Added colorama>=0.4.6 as regular dependency
Reusing already existing virtualenv
Expand Down Expand Up @@ -150,7 +150,7 @@ fn test_add_flask_wrong_venv_exported() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Added flask==3.0.0 as regular dependency
Added colorama>=0.4.6 as regular dependency
Reusing already existing virtualenv
Expand Down Expand Up @@ -185,7 +185,7 @@ fn test_add_explicit_version_or_url() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Added werkzeug==3.0.0 as regular dependency
Reusing already existing virtualenv
Generating production lockfile: [TEMP_PATH]/project/requirements.lock
Expand Down Expand Up @@ -234,7 +234,7 @@ fn test_add_dev() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Added flask>=3.0.0 as dev dependency
Added colorama>=0.4.6 as dev dependency
Reusing already existing virtualenv
Expand Down
2 changes: 1 addition & 1 deletion rye/tests/test_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn test_dotenv() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Generating production lockfile: [TEMP_PATH]/project/requirements.lock
Generating dev lockfile: [TEMP_PATH]/project/requirements-dev.lock
Installing dependencies
Expand Down
6 changes: 3 additions & 3 deletions rye/tests/test_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn test_init_lib() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Generating production lockfile: [TEMP_PATH]/project/requirements.lock
Generating dev lockfile: [TEMP_PATH]/project/requirements-dev.lock
Installing dependencies
Expand Down Expand Up @@ -71,7 +71,7 @@ fn test_init_default() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Generating production lockfile: [TEMP_PATH]/project/requirements.lock
Generating dev lockfile: [TEMP_PATH]/project/requirements-dev.lock
Installing dependencies
Expand Down Expand Up @@ -121,7 +121,7 @@ fn test_init_script() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Generating production lockfile: [TEMP_PATH]/project/requirements.lock
Generating dev lockfile: [TEMP_PATH]/project/requirements-dev.lock
Installing dependencies
Expand Down
2 changes: 1 addition & 1 deletion rye/tests/test_scripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn test_basic_script() {
----- stderr -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
"###);

rye_cmd_snapshot!(space.rye_cmd().arg("run"), @r###"
Expand Down
2 changes: 1 addition & 1 deletion rye/tests/test_self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fn test_version() {
rye [VERSION]
commit: [COMMIT]
platform: [PLATFORM]
self-python: [email protected].6
self-python: [email protected].8
symlink support: true
uv enabled: true
Expand Down
14 changes: 7 additions & 7 deletions rye/tests/test_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn test_empty_sync() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Generating production lockfile: [TEMP_PATH]/project/requirements.lock
Generating dev lockfile: [TEMP_PATH]/project/requirements-dev.lock
Installing dependencies
Expand Down Expand Up @@ -54,7 +54,7 @@ fn test_add_and_sync_no_auto_sync() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Added flask==3.0.0 as regular dependency
Added colorama>=0.4.6 as regular dependency
Expand Down Expand Up @@ -96,7 +96,7 @@ fn test_add_autosync() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Added flask==3.0.0 as regular dependency
Added colorama>=0.4.6 as regular dependency
Reusing already existing virtualenv
Expand Down Expand Up @@ -139,7 +139,7 @@ fn test_autosync_remember() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Generating production lockfile: [TEMP_PATH]/project/requirements.lock
Generating dev lockfile: [TEMP_PATH]/project/requirements-dev.lock
Installing dependencies
Expand Down Expand Up @@ -302,7 +302,7 @@ fn test_exclude_hashes() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Generating production lockfile: [TEMP_PATH]/project/requirements.lock
Generating dev lockfile: [TEMP_PATH]/project/requirements-dev.lock
Installing dependencies
Expand Down Expand Up @@ -353,7 +353,7 @@ fn test_lockfile() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Added anyio==4.0.0 as regular dependency
Reusing already existing virtualenv
Generating production lockfile: [TEMP_PATH]/project/requirements.lock
Expand Down Expand Up @@ -429,7 +429,7 @@ fn test_generate_hashes() {
exit_code: 0
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Generating production lockfile: [TEMP_PATH]/project/requirements.lock
Generating dev lockfile: [TEMP_PATH]/project/requirements-dev.lock
Installing dependencies
Expand Down
8 changes: 4 additions & 4 deletions rye/tests/test_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ fn test_basic_tool_behavior() {
exit_code: 1
----- stdout -----
Initializing new virtualenv in [TEMP_PATH]/project/.venv
Python version: [email protected].6
Python version: [email protected].8
Generating production lockfile: [TEMP_PATH]/project/requirements.lock
Generating dev lockfile: [TEMP_PATH]/project/requirements-dev.lock
Installing dependencies
Done!
Running tests for foo ([TEMP_PATH]/project)
============================= test session starts =============================
platform [PLATFORM] -- Python 3.12.6, pytest-7.4.3, pluggy-1.3.0
platform [PLATFORM] -- Python 3.12.8, pytest-7.4.3, pluggy-1.3.0
rootdir: [TEMP_PATH]/project
collected 2 items
Expand Down Expand Up @@ -108,7 +108,7 @@ fn test_basic_tool_behavior() {
----- stdout -----
Running tests for child-dep ([TEMP_PATH]/project/child-dep)
============================= test session starts =============================
platform [PLATFORM] -- Python 3.12.6, pytest-7.4.3, pluggy-1.3.0
platform [PLATFORM] -- Python 3.12.8, pytest-7.4.3, pluggy-1.3.0
rootdir: [TEMP_PATH]/project/child-dep
collected 2 items
Expand All @@ -128,7 +128,7 @@ fn test_basic_tool_behavior() {
Running tests for foo ([TEMP_PATH]/project)
============================= test session starts =============================
platform [PLATFORM] -- Python 3.12.6, pytest-7.4.3, pluggy-1.3.0
platform [PLATFORM] -- Python 3.12.8, pytest-7.4.3, pluggy-1.3.0
rootdir: [TEMP_PATH]/project
collected 2 items
Expand Down
8 changes: 4 additions & 4 deletions rye/tests/test_tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn test_basic_tool_behavior() {
- pycowsay
----- stderr -----
Using Python 3.11.10 environment at [RYE_HOME]/tools/pycowsay
Using Python 3.11.11 environment at [RYE_HOME]/tools/pycowsay
Resolved 1 package in [EXECUTION_TIME]
Prepared 1 package in [EXECUTION_TIME]
Installed 1 package in [EXECUTION_TIME]
Expand Down Expand Up @@ -69,7 +69,7 @@ fn test_basic_tool_behavior() {
success: true
exit_code: 0
----- stdout -----
pycowsay 0.0.0.2 ([email protected].10)
pycowsay 0.0.0.2 ([email protected].11)
----- stderr -----
"###);
Expand All @@ -79,13 +79,13 @@ fn test_basic_tool_behavior() {
.env("UV_CACHE_DIR", cache_dir.path())
.arg("toolchain")
.arg("remove")
.arg("[email protected].10"), @r###"
.arg("[email protected].11"), @r###"
success: false
exit_code: 1
----- stdout -----
----- stderr -----
error: toolchain [email protected].10 is still in use by tool pycowsay
error: toolchain [email protected].11 is still in use by tool pycowsay
"###);

rye_cmd_snapshot!(
Expand Down

0 comments on commit 17cf9b9

Please sign in to comment.