Skip to content

Commit e21cd2e

Browse files
Secrusneersighted
andcommitted
Add experimental POETRY_REQUESTS_TIMEOUT option
Co-authored-by: Bjorn Neergaard <[email protected]>
1 parent ede3eca commit e21cd2e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/faq.md

+7
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,10 @@ RUN poetry install --no-dev
223223

224224
The two key options we are using here are `--no-root` (skips installing the project source) and `--no-directory` (skips installing any local directory path dependencies, you can omit this if you don't have any).
225225
[More information on the options available for `poetry install`]({{< relref "cli#install" >}}).
226+
227+
228+
### My requests are timing out!
229+
230+
Poetry's default HTTP request timeout is 15 seconds, the same as `pip`.
231+
Similar to `PIP_REQUESTS_TIMEOUT`, the **experimental** environment variable `POETRY_REQUESTS_TIMEOUT`
232+
can be set to alter this value.

src/poetry/utils/constants.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from __future__ import annotations
22

3+
import os
4+
35

46
# Timeout for HTTP requests using the requests library.
5-
REQUESTS_TIMEOUT = 15
7+
REQUESTS_TIMEOUT = int(os.getenv("POETRY_REQUESTS_TIMEOUT", 15))
68

79
RETRY_AFTER_HEADER = "retry-after"
810

0 commit comments

Comments
 (0)