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 basic Proxy support #631

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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