-
-
Notifications
You must be signed in to change notification settings - Fork 743
Closed as not planned
Description
Enhancement Request
Current Behavior
The _setup_certifi_env
function in builder/penv_setup.py
currently imports certifi directly from the host system and uses certifi.where()
to get the certificate path.
Proposed Enhancement
Modify the function to:
- Accept an optional
python_exe
parameter - First attempt to get the certifi path from the virtual environment using the provided Python executable
- Fall back to the host system's certifi if the virtual environment approach fails
- Provide better error handling throughout the process
Technical Benefits
- Ensures certificate handling is consistent with the virtual environment setup
- Reduces dependency on host system packages
- Aligns with the project's goal of isolating the Python environment
- Provides more robust error handling
Reference
- PR: penv setup moved in platform pioarduino/platform-espressif32#296
- Requested by: @Jason2866
Current Implementation
def _setup_certifi_env(env):
"""Setup certifi environment variables with optional SCons integration."""
try:
import certifi
except ImportError:
print("Info: certifi not available; skipping CA environment setup.")
return
cert_path = certifi.where()
# ... sets environment variables
Proposed Enhancement
The enhancement would modify the function signature to accept a python_exe
parameter and attempt to get certifi from the virtual environment first, with graceful fallback to the host system approach.
Metadata
Metadata
Assignees
Labels
No labels