File: environment-variables.rst

package info (click to toggle)
python-discovery 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 492 kB
  • sloc: python: 4,511; makefile: 9; sh: 8
file content (38 lines) | stat: -rw-r--r-- 1,193 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Environment Variables
======================

``PY_DISCOVERY_TIMEOUT``
------------------------

Controls the timeout for querying individual Python interpreters.

**Type:** Float (seconds)

**Default:** ``15``

**Description:**

When python-discovery verifies an interpreter candidate, it runs a subprocess to collect metadata
(version, architecture, platform, etc.). On slower systems—particularly Windows with antivirus
software or other tools—Python startup can exceed the default timeout.

Setting this variable extends the allowed time for each interpreter query.

**Examples:**

.. code-block:: bash

   # Allow interpreters 30 seconds to respond
   export PY_DISCOVERY_TIMEOUT=30

   # Or pass in Python
   import os
   os.environ["PY_DISCOVERY_TIMEOUT"] = "30"

**Notes:**

- The timeout applies per candidate, not to the entire discovery process
- If a candidate times out, it is skipped and discovery continues with the next one
- Setting the value too low may skip legitimate interpreters
- Setting it too high increases discovery time when encountering problematic interpreters
- The value is read from the environment dict passed to :func:`~python_discovery.get_interpreter`