35
35
from platformio .package .version import pepver_to_semver
36
36
from platformio .util import get_serial_ports
37
37
38
+ # Python dependencies required for the build process
39
+ python_deps = {
40
+ "uv" : ">=0.1.0" ,
41
+ "pyyaml" : ">=6.0.2" ,
42
+ "rich-click" : ">=1.8.6" ,
43
+ "zopfli" : ">=0.2.2" ,
44
+ "intelhex" : ">=2.3.0" ,
45
+ "rich" : ">=14.0.0" ,
46
+ "esp-idf-size" : ">=1.6.1"
47
+ }
48
+
49
+ # Initialize environment and configuration
50
+ env = DefaultEnvironment ()
51
+ platform = env .PioPlatform ()
52
+ projectconfig = env .GetProjectConfig ()
53
+ terminal_cp = locale .getpreferredencoding ().lower ()
54
+
55
+ # Framework directory path
56
+ FRAMEWORK_DIR = platform .get_package_dir ("framework-arduinoespressif32" )
57
+
38
58
39
59
def add_to_pythonpath (path ):
40
60
"""
@@ -59,15 +79,6 @@ def add_to_pythonpath(path):
59
79
sys .path .insert (0 , normalized_path )
60
80
61
81
62
- # Initialize environment and configuration
63
- env = DefaultEnvironment ()
64
- platform = env .PioPlatform ()
65
- projectconfig = env .GetProjectConfig ()
66
- terminal_cp = locale .getpreferredencoding ().lower ()
67
-
68
- # Framework directory path
69
- FRAMEWORK_DIR = platform .get_package_dir ("framework-arduinoespressif32" )
70
-
71
82
def setup_python_paths (env ):
72
83
"""
73
84
Setup Python paths based on the actual Python executable being used.
@@ -112,18 +123,6 @@ def setup_python_paths(env):
112
123
setup_python_paths (env )
113
124
114
125
115
- # Python dependencies required for the build process
116
- python_deps = {
117
- "uv" : ">=0.1.0" ,
118
- "pyyaml" : ">=6.0.2" ,
119
- "rich-click" : ">=1.8.6" ,
120
- "zopfli" : ">=0.2.2" ,
121
- "intelhex" : ">=2.3.0" ,
122
- "rich" : ">=14.0.0" ,
123
- "esp-idf-size" : ">=1.6.1"
124
- }
125
-
126
-
127
126
def get_packages_to_install (deps , installed_packages ):
128
127
"""
129
128
Generator for Python packages that need to be installed.
0 commit comments