Skip to content

Commit 08ef75a

Browse files
authored
move around
1 parent aa4a13b commit 08ef75a

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

builder/main.py

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,26 @@
3535
from platformio.package.version import pepver_to_semver
3636
from platformio.util import get_serial_ports
3737

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+
3858

3959
def add_to_pythonpath(path):
4060
"""
@@ -59,15 +79,6 @@ def add_to_pythonpath(path):
5979
sys.path.insert(0, normalized_path)
6080

6181

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-
7182
def setup_python_paths(env):
7283
"""
7384
Setup Python paths based on the actual Python executable being used.
@@ -112,18 +123,6 @@ def setup_python_paths(env):
112123
setup_python_paths(env)
113124

114125

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-
127126
def get_packages_to_install(deps, installed_packages):
128127
"""
129128
Generator for Python packages that need to be installed.

0 commit comments

Comments
 (0)