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

Support absolute url to override base url #10074

Merged
merged 16 commits into from
Dec 2, 2024
Merged

Conversation

vivodi
Copy link
Contributor

@vivodi vivodi commented Nov 30, 2024

What do these changes do?

Support absolute url in request to override base url in session.

session = ClientSession(base_url="http://example.com/foo/")

await session.request("GET", "http://abc.com/bar/")

Are there changes in behavior for the user?

Yes

Is it a substantial burden for the maintainers to support this?

No

Related issue number

Fixes #10027

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES/ folder
    • name it <issue_or_pr_num>.<type>.rst (e.g. 588.bugfix.rst)

    • if you don't have an issue number, change it to the pull request
      number after creating the PR

      • .bugfix: A bug fix for something the maintainers deemed an
        improper undesired behavior that got corrected to match
        pre-agreed expectations.
      • .feature: A new behavior, public APIs. That sort of stuff.
      • .deprecation: A declaration of future API removals and breaking
        changes in behavior.
      • .breaking: When something public is removed in a breaking way.
        Could be deprecated in an earlier release.
      • .doc: Notable updates to the documentation structure or build
        process.
      • .packaging: Notes for downstreams about unobvious side effects
        and tooling. Changes in the test invocation considerations and
        runtime assumptions.
      • .contrib: Stuff that affects the contributor experience. e.g.
        Running tests, building the docs, setting up the development
        environment.
      • .misc: Changes that are hard to assign to any of the above
        categories.
    • Make sure to use full sentences with correct case and punctuation,
      for example:

      Fixed issue with non-ascii contents in doctest text files
      -- by :user:`contributor-gh-handle`.

      Use the past tense or the present tense a non-imperative mood,
      referring to what's changed compared to the last released version
      of this project.

@vivodi vivodi requested a review from asvetlov as a code owner November 30, 2024 13:19
@vivodi vivodi marked this pull request as draft November 30, 2024 13:20
Copy link

codspeed-hq bot commented Nov 30, 2024

CodSpeed Performance Report

Merging #10074 will not alter performance

Comparing vivodi:patch-1 (1b560f2) with master (1fa237f)

Summary

✅ 44 untouched benchmarks

Copy link

codecov bot commented Nov 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.76%. Comparing base (1fa237f) to head (1b560f2).
Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10074      +/-   ##
==========================================
- Coverage   98.76%   98.76%   -0.01%     
==========================================
  Files         121      121              
  Lines       36860    36859       -1     
  Branches     4396     4396              
==========================================
- Hits        36403    36402       -1     
  Misses        311      311              
  Partials      146      146              
Flag Coverage Δ
CI-GHA 98.64% <100.00%> (-0.01%) ⬇️
OS-Linux 98.33% <100.00%> (-0.01%) ⬇️
OS-Windows 96.18% <ø> (ø)
OS-macOS 97.44% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 97.29% <100.00%> (-0.01%) ⬇️
Py-3.10.15 97.82% <100.00%> (-0.06%) ⬇️
Py-3.11.10 97.86% <100.00%> (-0.01%) ⬇️
Py-3.11.9 97.33% <100.00%> (-0.02%) ⬇️
Py-3.12.7 98.39% <100.00%> (-0.01%) ⬇️
Py-3.13.0 98.38% <100.00%> (-0.01%) ⬇️
Py-3.9.13 97.20% <100.00%> (-0.01%) ⬇️
Py-3.9.20 97.79% <100.00%> (-0.01%) ⬇️
Py-pypy7.3.16 97.35% <100.00%> (-0.01%) ⬇️
VM-macos 97.44% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 98.33% <100.00%> (-0.01%) ⬇️
VM-windows 96.18% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Nov 30, 2024
@vivodi vivodi marked this pull request as ready for review November 30, 2024 21:38
@vivodi vivodi requested a review from webknjaz as a code owner November 30, 2024 21:38
Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

Such a change would require tests to be included.

CHANGES/10074.feature.rst Outdated Show resolved Hide resolved
aiohttp/client.py Outdated Show resolved Hide resolved
docs/client_reference.rst Outdated Show resolved Hide resolved
@vivodi vivodi requested a review from webknjaz December 1, 2024 12:05
aiohttp/client.py Outdated Show resolved Hide resolved
@Dreamsorcerer Dreamsorcerer added the backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot label Dec 1, 2024
vivodi and others added 2 commits December 2, 2024 00:21
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
@vivodi vivodi requested a review from Dreamsorcerer December 1, 2024 16:40
Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

@bdraco bdraco merged commit f733258 into aio-libs:master Dec 2, 2024
40 checks passed
Copy link
Contributor

patchback bot commented Dec 2, 2024

Backport to 3.12: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.12/f733258ed9e5e71b7b97511f5654efd6799cac46/pr-10074

Backported as #10094

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Dec 2, 2024
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit f733258)
bdraco pushed a commit that referenced this pull request Dec 2, 2024
…base url (#10094)

**This is a backport of PR #10074 as merged into master
(f733258).**
Co-authored-by: vivodi <103735539+vivodi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AssertionError | assert not url.absolute raisedon a WSS URL
4 participants