Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Rust crate ureq to v3 #15759

Closed
wants to merge 4 commits into from
Closed

Update Rust crate ureq to v3 #15759

wants to merge 4 commits into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 27, 2025

This PR contains the following updates:

Package Type Update Change
ureq workspace.dependencies major 2.9.6 -> 3.0.0

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

algesten/ureq (ureq)

v3.0.1

Compare Source

  • Fix excessive stack sizes (#​950)
    • Do not enable json by default (breaking, but it was a mistake) (#​948)

v3.0.0

Compare Source

  • Replace RequestBuilder Deref with explicit wrappers (#​944)
    • Remove dependency on url crate (#​943)
    • Feature Config::save_redirect_history (#​939)

Configuration

📅 Schedule: Branch creation - "before 4am on Monday" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the internal An internal refactor or improvement label Jan 27, 2025
@renovate renovate bot force-pushed the renovate/ureq-3.x branch from e92a4d6 to 6fde901 Compare January 27, 2025 14:07
@dhruvmanila dhruvmanila self-assigned this Jan 27, 2025
Copy link

codspeed-hq bot commented Jan 27, 2025

CodSpeed Performance Report

Merging #15759 will improve performances by 4.59%

Comparing renovate/ureq-3.x (b73e710) with main (d9a1034)

Summary

⚡ 1 improvements
✅ 31 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
lexer[numpy/globals.py] 30.5 µs 29.2 µs +4.59%

Copy link
Contributor

github-actions bot commented Jan 27, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.


let content = response.into_string()?;
let content = String::from_utf8_lossy(&response.body_mut().read_to_vec()?).to_string();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this just be

Suggested change
let content = String::from_utf8_lossy(&response.body_mut().read_to_vec()?).to_string();
let content = response.body_mut().read_to_string()?;

? Or are the semantics of String::from_utf8_lossy() important here?

Copy link
Member

@dhruvmanila dhruvmanila Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't really debugged why but it throws an error:

thread 'main' panicked at crates/ruff_benchmark/benches/formatter.rs:45:42:
called `Result::unwrap()` on an `Err` value: Request(Io(Error { kind: InvalidData, message: "stream did not contain valid UTF-8" }))

which seems unexpected given that read_to_string should convert incorrect UTF-8 chars to ? character.

This is for https://raw.githubusercontent.com/mozillazg/python-pinyin/9521e47d96e3583a5477f5e43a2e82d513f27a3f/pypinyin/standard.py

Cargo.lock Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like quite a few new dependencies :/ do you know if any might be avoidable?

Copy link
Member

@dhruvmanila dhruvmanila Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, it now switched to the http crate instead of implementing it's own Response and Request struct (https://github.com/algesten/ureq/blob/main/MIGRATE-2-to-3.md) plus added some more dependencies

@dhruvmanila
Copy link
Member

Not sure what's causing the perf regression, will look into it later.


assert!(
lexer.finish().is_empty(),
"Input to be valid python source code"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Input to be valid python source code"
"Input should be valid python source code"

@@ -121,7 +121,13 @@ impl TestFile {
// File not yet cached, download and cache it in the target directory
let response = ureq::get(url.as_str()).call()?;

let content = response.into_string()?;
// Using `with_config` here because without, the `loosy_utf8` results in invalid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Using `with_config` here because without, the `loosy_utf8` results in invalid
// Using `with_config` here because without, the `lossy_utf8` results in invalid

@MichaReiser
Copy link
Member

I plan to remove the entire download functionality and instead commit the files. It should simplify the benchmarks, reduce our dependencies and allow running benchmarks even when offline

@MichaReiser
Copy link
Member

See #15878

@MichaReiser MichaReiser closed this Feb 2, 2025
Copy link
Contributor Author

renovate bot commented Feb 2, 2025

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future 3.x releases. But if you manually upgrade to 3.x then Renovate will re-enable minor and patch updates automatically.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate renovate bot deleted the renovate/ureq-3.x branch February 2, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants