pyalamake 2.2.2__tar.gz → 2.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyalamake-2.2.2/src/pyalamake.egg-info → pyalamake-2.3.0}/PKG-INFO +1 -1
- {pyalamake-2.2.2 → pyalamake-2.3.0}/pyproject.toml +1 -1
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/constants_version.py +1 -1
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/osal.py +15 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/package_cpip.py +6 -3
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_arduino.py +30 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0/src/pyalamake.egg-info}/PKG-INFO +1 -1
- {pyalamake-2.2.2 → pyalamake-2.3.0}/LICENSE.txt +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/MANIFEST.in +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/README.md +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/setup.cfg +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/__init__.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/arduino_shared.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/boards.json +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/compile_cmd_json.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/gbl.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/list_param.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/makefile_variables.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/package_opengl.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/path_handle.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/pyalamake.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/svc.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_arduino_core.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_base.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_base_min.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_c.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_c_cpp_base.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_c_cpp_lib_base.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_c_lib.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_cpp.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_cpp_lib.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_gtest.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_manual.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake/target_swig.py +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake.egg-info/SOURCES.txt +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake.egg-info/dependency_links.txt +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake.egg-info/requires.txt +0 -0
- {pyalamake-2.2.2 → pyalamake-2.3.0}/src/pyalamake.egg-info/top_level.txt +0 -0
|
@@ -338,3 +338,18 @@ class Osal:
|
|
|
338
338
|
|
|
339
339
|
# do not fix_path()
|
|
340
340
|
return libs
|
|
341
|
+
|
|
342
|
+
# --------------------
|
|
343
|
+
## run a command
|
|
344
|
+
# @param cmd (list) the command to run
|
|
345
|
+
# @return rc, output lines
|
|
346
|
+
@classmethod
|
|
347
|
+
def run_cmd(cls, cmd):
|
|
348
|
+
result = subprocess.run(
|
|
349
|
+
cmd,
|
|
350
|
+
capture_output=True, # Capture stdout and stderr
|
|
351
|
+
text=True, # Decode output as string
|
|
352
|
+
check=True,
|
|
353
|
+
) # Raise error for non-zero exit codes
|
|
354
|
+
# print(f'@@@ osal.run_cmd rc={result.returncode} stdout: {result.stdout.strip()}')
|
|
355
|
+
return result.returncode, result.stdout.strip()
|
|
@@ -15,12 +15,15 @@ class PackageCpip:
|
|
|
15
15
|
pkgname = pkgname.replace('cpip.', '')
|
|
16
16
|
svc.log.line(f'finding cpip package: {pkgname}')
|
|
17
17
|
|
|
18
|
-
if not svc.osal.isdir(os.path.join('tools', 'xplat_utils')): # pragma: no cover ;
|
|
18
|
+
if not svc.osal.isdir(os.path.join('tools', 'xplat_utils')): # pragma: no cover ; for defense only
|
|
19
19
|
svc.abort('xplat_utils is not installed, aborting')
|
|
20
20
|
|
|
21
|
-
from tools.xplat_utils import
|
|
21
|
+
from tools.xplat_utils.zpm_utils import ZpmUtils
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
utils = ZpmUtils()
|
|
24
|
+
utils.load_svc('do_cpip')
|
|
25
|
+
|
|
26
|
+
pkginfo = utils.cpip_get(pkgname)
|
|
24
27
|
if pkginfo is None:
|
|
25
28
|
svc.abort(f'could not find info for cpip package: {pkgname}')
|
|
26
29
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
1
3
|
from .path_handle import PathHandle
|
|
2
4
|
from .svc import svc
|
|
3
5
|
from .target_base import TargetBase
|
|
@@ -79,12 +81,40 @@ class TargetArduino(TargetBase):
|
|
|
79
81
|
if lib == 'Servo':
|
|
80
82
|
svc.log.line(f'adding arduino library: {lib}')
|
|
81
83
|
path = PathHandle(f'{self._shared.library_root}/Servo/src')
|
|
84
|
+
self._check_library_installed(path, lib)
|
|
82
85
|
self.add_sources(f'{path.fixed}/avr/Servo.cpp') # pylint: disable=E1101
|
|
83
86
|
self.add_include_directories(path.fixed) # pylint: disable=E1101
|
|
84
87
|
self.add_compile_options('-DARDUINO_ARCH_AVR') # pylint: disable=E1101
|
|
85
88
|
else:
|
|
86
89
|
svc.abort(f'{self.target} target_arduino: unknown arduino library: {lib}')
|
|
87
90
|
|
|
91
|
+
# --------------------
|
|
92
|
+
## check if an arduino library is installed
|
|
93
|
+
#
|
|
94
|
+
# @param exp_path the expected path to the library
|
|
95
|
+
# @param lib the library to check
|
|
96
|
+
# @return None
|
|
97
|
+
def _check_library_installed(self, exp_path, lib):
|
|
98
|
+
# svc.log.dbg(f'@@@@ path:{path.fixed} isdir:{os.path.isdir(path.fixed)}')
|
|
99
|
+
if os.path.isdir(exp_path.fixed):
|
|
100
|
+
return
|
|
101
|
+
|
|
102
|
+
svc.log.highlight(f'arduino library: "{lib}" installing...')
|
|
103
|
+
rc, lines = svc.osal.run_cmd(['arduino-cli', 'lib', 'update-index'])
|
|
104
|
+
if rc != 0:
|
|
105
|
+
svc.log.output(lines)
|
|
106
|
+
svc.abort(f'arduino-cli update-index failed for "{lib}, rc={rc}')
|
|
107
|
+
|
|
108
|
+
rc, lines = svc.osal.run_cmd(['arduino-cli', 'lib', 'install', lib])
|
|
109
|
+
if rc != 0:
|
|
110
|
+
svc.log.output(lines)
|
|
111
|
+
svc.abort(f'arduino-cli install failed for "{lib}", rc={rc}')
|
|
112
|
+
|
|
113
|
+
if not os.path.isdir(exp_path.fixed):
|
|
114
|
+
svc.abort(f'arduino library install failed: "{lib}"')
|
|
115
|
+
|
|
116
|
+
svc.log.ok(f'arduino library: "{lib}" installed')
|
|
117
|
+
|
|
88
118
|
# --------------------
|
|
89
119
|
## check various aspects of parameters
|
|
90
120
|
#
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|