Skip to content

Commit

Permalink
Add basic Proxy support. (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein authored Oct 16, 2024
1 parent 67de942 commit 39cfa10
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions changelogs/fragments/631-proxy-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
minor_changes:
- "Use Proxy configuration settings from the environment. Check out the
`aiohttp documentation on Proxy support <https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support>`__
for information on which environment variables are supported
(https://github.com/ansible-community/antsibull-build/pull/631)."
2 changes: 1 addition & 1 deletion src/antsibull_build/announcements.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ async def get_data(
end_of_life:
Whether this is the last release for this major release train
"""
async with ClientSession() as aio_session:
async with ClientSession(trust_env=True) as aio_session:
client = PyPIClient(aio_session)
try:
release = await client.get_release("ansible", ansible_version)
Expand Down
4 changes: 2 additions & 2 deletions src/antsibull_build/build_ansible_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def download_collections(
collection_cache: str | None = None,
) -> dict[str, str]:
requestors = {}
async with aiohttp.ClientSession() as aio_session:
async with aiohttp.ClientSession(trust_env=True) as aio_session:
lib_ctx = app_context.lib_ctx.get()
async with asyncio_pool.AioPool(size=lib_ctx.thread_max) as pool:
downloader = CollectionDownloader(
Expand All @@ -96,7 +96,7 @@ async def _get_ansible_core_path(
download_dir: StrPath, ansible_core_version: PypiVer | str
) -> Path:
flog = mlog.fields(func="_get_ansible_core_path")
async with aiohttp.ClientSession() as aio_session:
async with aiohttp.ClientSession(trust_env=True) as aio_session:
ansible_core_tarball = Path(
await get_ansible_core(
aio_session, str(ansible_core_version), str(download_dir)
Expand Down
2 changes: 1 addition & 1 deletion src/antsibull_build/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ async def collect_changelogs(
):
lib_ctx = app_context.lib_ctx.get()
with tempfile.TemporaryDirectory() as tmp_dir:
async with aiohttp.ClientSession() as aio_session:
async with aiohttp.ClientSession(trust_env=True) as aio_session:
if galaxy_context is None:
galaxy_context = await GalaxyContext.create(aio_session)
async with asyncio_pool.AioPool(size=lib_ctx.thread_max) as pool:
Expand Down
2 changes: 1 addition & 1 deletion src/antsibull_build/utils/galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ async def create_galaxy_context() -> GalaxyContext:
"""
Create a Galaxy context.
"""
async with aiohttp.ClientSession() as aio_session:
async with aiohttp.ClientSession(trust_env=True) as aio_session:
return await GalaxyContext.create(aio_session)
2 changes: 1 addition & 1 deletion src/antsibull_build/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ async def get_version_info(
requestors = {}
lib_ctx = app_context.lib_ctx.get()
async with (
aiohttp.ClientSession() as aio_session,
aiohttp.ClientSession(trust_env=True) as aio_session,
asyncio_pool.AioPool(size=lib_ctx.thread_max) as pool,
):
pypi_client = AnsibleCorePyPiClient(
Expand Down

0 comments on commit 39cfa10

Please sign in to comment.