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

Add host_subcomponent property #1159

Merged
merged 21 commits into from
Sep 26, 2024
Merged

Add host_subcomponent property #1159

merged 21 commits into from
Sep 26, 2024

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Sep 26, 2024

Returns the https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2 host subcomponent. The only current practical difference between raw_host and host_subcomponent is that IPv6 addresses are returned bracketed.

We can also use this in aiohttp at https://github.com/aio-libs/aiohttp/blob/d7cd0613472fd4d9940e37f1c55921f6a1515324/aiohttp/client_reqrep.py#L359 and https://github.com/aio-libs/aiohttp/blob/d7cd0613472fd4d9940e37f1c55921f6a1515324/aiohttp/client_reqrep.py#L609

Split from #1158 for #1157

Note that we CANNOT use self._val.hostname here because it returns the non-bracketed host

yarl/_url.py Outdated Show resolved Hide resolved
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Sep 26, 2024
docs/api.rst Outdated Show resolved Hide resolved
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.46%. Comparing base (ecb100d) to head (33433fb).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1159      +/-   ##
==========================================
+ Coverage   95.45%   95.46%   +0.01%     
==========================================
  Files          30       30              
  Lines        4792     4807      +15     
  Branches      425      428       +3     
==========================================
+ Hits         4574     4589      +15     
  Misses        192      192              
  Partials       26       26              
Flag Coverage Δ
CI-GHA 95.42% <100.00%> (+0.01%) ⬆️
MyPy 41.40% <77.77%> (+0.10%) ⬆️
OS-Linux 99.35% <85.71%> (-0.06%) ⬇️
OS-Windows 99.44% <85.71%> (-0.06%) ⬇️
OS-macOS 99.06% <85.71%> (-0.05%) ⬇️
Py-3.10.11 98.96% <85.71%> (-0.05%) ⬇️
Py-3.10.15 99.19% <85.71%> (-0.05%) ⬇️
Py-3.11.10 99.19% <85.71%> (-0.05%) ⬇️
Py-3.11.9 98.96% <85.71%> (-0.05%) ⬇️
Py-3.12.6 99.19% <85.71%> (-0.05%) ⬇️
Py-3.13.0-rc.2 99.19% <85.71%> (-0.05%) ⬇️
Py-3.8.10 98.90% <85.71%> (-0.05%) ⬇️
Py-3.8.18 99.14% <85.71%> (-0.05%) ⬇️
Py-3.9.13 98.90% <85.71%> (-0.05%) ⬇️
Py-3.9.20 99.14% <85.71%> (-0.05%) ⬇️
Py-pypy7.3.11 99.19% <85.71%> (-0.06%) ⬇️
Py-pypy7.3.16 99.19% <85.71%> (-0.06%) ⬇️
Py-pypy7.3.17 99.22% <85.71%> (-0.06%) ⬇️
VM-macos-latest 99.06% <85.71%> (-0.05%) ⬇️
VM-ubuntu-latest 99.35% <85.71%> (-0.06%) ⬇️
VM-windows-latest 99.44% <85.71%> (-0.06%) ⬇️
pytest 99.35% <85.71%> (-0.06%) ⬇️

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.

@bdraco bdraco marked this pull request as ready for review September 26, 2024 21:41
@bdraco bdraco enabled auto-merge (squash) September 26, 2024 21:41
@bdraco bdraco merged commit 7d013d2 into master Sep 26, 2024
46 of 49 checks passed
@bdraco bdraco deleted the host_subcomp branch September 26, 2024 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

1 participant