Skip to content

Make index publisher HTTP timeout configurable#2244

Open
Jatin-Shihora wants to merge 1 commit intopypa:masterfrom
Jatin-Shihora:fix/2158-configurable-index-timeout
Open

Make index publisher HTTP timeout configurable#2244
Jatin-Shihora wants to merge 1 commit intopypa:masterfrom
Jatin-Shihora:fix/2158-configurable-index-timeout

Conversation

@Jatin-Shihora
Copy link
Copy Markdown

@Jatin-Shihora Jatin-Shihora commented Apr 17, 2026

Closes #2158 and #761

Adds a configurable HTTP timeout for the index publisher. This allows users on slow networks, such as those behind a VPN, to override the hardcoded 10 second default without needing to patch the source.

Configuration (in order of precedence)

  • --timeout CLI flag on hatch publish
  • HATCH_INDEX_TIMEOUT environment variable
  • timeout key in:
    • [publish.index]
    • [publish.index.repos.*] in config.toml

If unset, the behavior falls back to the existing default of DEFAULT_TIMEOUT = 10

I have made this PR only affect the publish path, that is the download_file() helper in utils/network.py, which is used by hatch python install, also relies on DEFAULT_TIMEOUT. That can be addressed separately in a follow-up if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Making TIMEOUT used by pip install configurable

1 participant