ruyi 0.43.0a20251017__tar.gz → 0.44.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.
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/PKG-INFO +6 -3
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/README.md +2 -1
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/pyproject.toml +4 -2
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/cli/main.py +20 -13
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/cli/oobe.py +3 -7
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/cli/self_cli.py +1 -2
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/config/__init__.py +4 -8
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/mux/venv/maker.py +52 -2
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/pluginhost/unsandboxed.py +1 -1
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/resource_bundle/data.py +1 -1
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/install.py +20 -22
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/telemetry/aggregate.py +5 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/telemetry/provider.py +229 -87
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/telemetry/store.py +68 -15
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/telemetry/telemetry_cli.py +23 -5
- ruyi-0.44.0/ruyi/utils/__init__.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/version.py +1 -1
- ruyi-0.43.0a20251017/ruyi/mux/venv/__init__.py +0 -12
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/LICENSE-Apache.txt +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/__init__.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/__main__.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/cli/__init__.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/cli/builtin_commands.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/cli/cmd.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/cli/completer.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/cli/completion.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/cli/config_cli.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/cli/user_input.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/cli/version_cli.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/config/editor.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/config/errors.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/config/news.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/config/schema.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/device/__init__.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/device/provision.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/device/provision_cli.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/log/__init__.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/mux/__init__.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/mux/runtime.py +0 -0
- {ruyi-0.43.0a20251017/ruyi/pluginhost → ruyi-0.44.0/ruyi/mux/venv}/__init__.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/mux/venv/emulator_cfg.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/mux/venv/venv_cli.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/mux/venv_cfg.py +0 -0
- {ruyi-0.43.0a20251017/ruyi/ruyipkg → ruyi-0.44.0/ruyi/pluginhost}/__init__.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/pluginhost/api.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/pluginhost/ctx.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/pluginhost/paths.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/pluginhost/plugin_cli.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/py.typed +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/resource_bundle/__init__.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/resource_bundle/__main__.py +0 -0
- {ruyi-0.43.0a20251017/ruyi/telemetry → ruyi-0.44.0/ruyi/ruyipkg}/__init__.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/admin_checksum.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/admin_cli.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/atom.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/augmented_pkg.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/canonical_dump.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/checksum.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/cli_completion.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/distfile.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/entity.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/entity_cli.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/entity_provider.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/fetcher.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/host.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/install_cli.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/list.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/list_cli.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/list_filter.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/msg.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/news.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/news_cli.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/news_store.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/pkg_manifest.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/profile.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/profile_cli.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/protocols.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/repo.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/state.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/unpack.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/unpack_method.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/ruyipkg/update_cli.py +0 -0
- {ruyi-0.43.0a20251017/ruyi/utils → ruyi-0.44.0/ruyi/telemetry}/__init__.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/telemetry/event.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/telemetry/scope.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/ar.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/ci.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/frontmatter.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/git.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/global_mode.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/l10n.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/markdown.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/mounts.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/node_info.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/nuitka.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/porcelain.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/prereqs.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/ssl_patch.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/templating.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/toml.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/url.py +0 -0
- {ruyi-0.43.0a20251017 → ruyi-0.44.0}/ruyi/utils/xdg_basedir.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ruyi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.44.0
|
|
4
4
|
Summary: Package manager for RuyiSDK
|
|
5
5
|
License: Apache License
|
|
6
6
|
Version 2.0, January 2004
|
|
@@ -217,6 +217,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
217
217
|
Classifier: Programming Language :: Python :: 3.11
|
|
218
218
|
Classifier: Programming Language :: Python :: 3.12
|
|
219
219
|
Classifier: Programming Language :: Python :: 3.13
|
|
220
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
220
221
|
Classifier: Topic :: Software Development :: Build Tools
|
|
221
222
|
Classifier: Topic :: Software Development :: Embedded Systems
|
|
222
223
|
Classifier: Topic :: System :: Software Distribution
|
|
@@ -225,7 +226,8 @@ Requires-Dist: argcomplete (>=2.0.0)
|
|
|
225
226
|
Requires-Dist: arpy
|
|
226
227
|
Requires-Dist: fastjsonschema (>=2.15.1)
|
|
227
228
|
Requires-Dist: jinja2 (>=3,<4)
|
|
228
|
-
Requires-Dist: pygit2 (>=1.6)
|
|
229
|
+
Requires-Dist: pygit2 (>=1.6) ; python_version >= "3.11"
|
|
230
|
+
Requires-Dist: pygit2 (>=1.6,<1.19) ; python_version < "3.11"
|
|
229
231
|
Requires-Dist: pyyaml (>=5.4)
|
|
230
232
|
Requires-Dist: requests (>=2,<3)
|
|
231
233
|
Requires-Dist: rich (>=11.2.0)
|
|
@@ -406,7 +408,8 @@ described below.
|
|
|
406
408
|
There are 3 telemetry modes available:
|
|
407
409
|
|
|
408
410
|
* `local`: data will be collected but not uploaded without user action.
|
|
409
|
-
* `off`: data will
|
|
411
|
+
* `off`: data will neither be collected nor uploaded, except for a one-time
|
|
412
|
+
upload of `ruyi`'s version number on first run.
|
|
410
413
|
* `on`: data will be collected and periodically uploaded.
|
|
411
414
|
|
|
412
415
|
By default the `local` mode is active from `ruyi` 0.42.0 (inclusive) on, which
|
|
@@ -163,7 +163,8 @@ described below.
|
|
|
163
163
|
There are 3 telemetry modes available:
|
|
164
164
|
|
|
165
165
|
* `local`: data will be collected but not uploaded without user action.
|
|
166
|
-
* `off`: data will
|
|
166
|
+
* `off`: data will neither be collected nor uploaded, except for a one-time
|
|
167
|
+
upload of `ruyi`'s version number on first run.
|
|
167
168
|
* `on`: data will be collected and periodically uploaded.
|
|
168
169
|
|
|
169
170
|
By default the `local` mode is active from `ruyi` 0.42.0 (inclusive) on, which
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ruyi"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.44.0"
|
|
8
8
|
description = "Package manager for RuyiSDK"
|
|
9
9
|
keywords = ["ruyi", "ruyisdk"]
|
|
10
10
|
license = { file = "LICENSE-Apache.txt" }
|
|
@@ -22,6 +22,7 @@ classifiers = [
|
|
|
22
22
|
"Programming Language :: Python :: 3.11",
|
|
23
23
|
"Programming Language :: Python :: 3.12",
|
|
24
24
|
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Programming Language :: Python :: 3.14",
|
|
25
26
|
"Topic :: Software Development :: Build Tools",
|
|
26
27
|
"Topic :: Software Development :: Embedded Systems",
|
|
27
28
|
"Topic :: System :: Software Distribution",
|
|
@@ -33,7 +34,8 @@ dependencies = [
|
|
|
33
34
|
"arpy",
|
|
34
35
|
"fastjsonschema>=2.15.1",
|
|
35
36
|
"jinja2 (>=3, <4)",
|
|
36
|
-
"pygit2>=1.6",
|
|
37
|
+
"pygit2 (>=1.6, <1.19); python_version<'3.11'",
|
|
38
|
+
"pygit2>=1.6; python_version>='3.11'",
|
|
37
39
|
"pyyaml>=5.4",
|
|
38
40
|
"requests (>=2, <3)",
|
|
39
41
|
"rich>=11.2.0",
|
|
@@ -39,11 +39,11 @@ def main(gm: GlobalModeProvider, gc: GlobalConfig, argv: list[str]) -> int:
|
|
|
39
39
|
if not gm.is_cli_autocomplete:
|
|
40
40
|
oobe = OOBE(gc)
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
tm = gc.telemetry
|
|
43
|
+
tm.check_first_run_status()
|
|
44
|
+
tm.init_installation(False)
|
|
45
|
+
atexit.register(tm.flush)
|
|
46
|
+
oobe.handlers.append(tm.oobe_prompt)
|
|
47
47
|
|
|
48
48
|
oobe.maybe_prompt()
|
|
49
49
|
|
|
@@ -59,12 +59,11 @@ def main(gm: GlobalModeProvider, gc: GlobalConfig, argv: list[str]) -> int:
|
|
|
59
59
|
from ..mux.runtime import mux_main
|
|
60
60
|
|
|
61
61
|
# record an invocation and the command name being proxied to
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
)
|
|
62
|
+
gc.telemetry.record(
|
|
63
|
+
TelemetryScope(None),
|
|
64
|
+
"cli:mux-invocation-v1",
|
|
65
|
+
target=os.path.basename(gm.argv0),
|
|
66
|
+
)
|
|
68
67
|
|
|
69
68
|
return mux_main(gm, gc, argv)
|
|
70
69
|
|
|
@@ -127,8 +126,16 @@ def main(gm: GlobalModeProvider, gc: GlobalConfig, argv: list[str]) -> int:
|
|
|
127
126
|
except AttributeError:
|
|
128
127
|
pass
|
|
129
128
|
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
tm = gc.telemetry
|
|
130
|
+
tm.print_telemetry_notice()
|
|
131
|
+
|
|
132
|
+
# Do not record `ruyi telemetry --cron-upload` invocations.
|
|
133
|
+
skip_recording_invocation = telemetry_key == "telemetry" and getattr(
|
|
134
|
+
args,
|
|
135
|
+
"cron_upload",
|
|
136
|
+
False,
|
|
137
|
+
)
|
|
138
|
+
if not skip_recording_invocation:
|
|
132
139
|
tm.record(
|
|
133
140
|
TelemetryScope(None),
|
|
134
141
|
"cli:invocation-v1",
|
|
@@ -30,13 +30,9 @@ class OOBE:
|
|
|
30
30
|
]
|
|
31
31
|
|
|
32
32
|
def is_first_run(self) -> bool:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
# we may revisit this later if it turns out users want OOBE tips even
|
|
37
|
-
# if they know how to disable telemetry (hence more likely to be power
|
|
38
|
-
# users)
|
|
39
|
-
return False
|
|
33
|
+
# We now always have our first-run indicator because of the minimal
|
|
34
|
+
# telemetry mode.
|
|
35
|
+
return self._gc.telemetry.is_first_run
|
|
40
36
|
|
|
41
37
|
def should_prompt(self) -> bool:
|
|
42
38
|
from ..utils.global_mode import is_env_var_truthy
|
|
@@ -241,8 +241,7 @@ def _do_reset(
|
|
|
241
241
|
|
|
242
242
|
# do not record any telemetry data if we're purging it
|
|
243
243
|
if all_state or telemetry:
|
|
244
|
-
|
|
245
|
-
tm.discard_events(True)
|
|
244
|
+
cfg.telemetry.discard_events(True)
|
|
246
245
|
|
|
247
246
|
if all_state:
|
|
248
247
|
status("removing state data")
|
|
@@ -297,17 +297,13 @@ class GlobalConfig:
|
|
|
297
297
|
def telemetry_root(self) -> os.PathLike[Any]:
|
|
298
298
|
return pathlib.Path(self.ensure_state_dir()) / "telemetry"
|
|
299
299
|
|
|
300
|
-
@property
|
|
301
|
-
def telemetry(self) -> "TelemetryProvider | None":
|
|
302
|
-
return None if self.telemetry_mode == "off" else self._telemetry_provider
|
|
303
|
-
|
|
304
300
|
@cached_property
|
|
305
|
-
def
|
|
306
|
-
"""Do not access directly; use the ``telemetry`` property instead."""
|
|
307
|
-
|
|
301
|
+
def telemetry(self) -> "TelemetryProvider":
|
|
308
302
|
from ..telemetry.provider import TelemetryProvider
|
|
309
303
|
|
|
310
|
-
|
|
304
|
+
# for allowing minimal uploads when telemetry is off
|
|
305
|
+
minimal_mode = self.telemetry_mode == "off"
|
|
306
|
+
return TelemetryProvider(self, minimal_mode)
|
|
311
307
|
|
|
312
308
|
@property
|
|
313
309
|
def telemetry_mode(self) -> str:
|
|
@@ -9,14 +9,46 @@ from typing import Any, Final, Iterator, TypedDict
|
|
|
9
9
|
from ...config import GlobalConfig
|
|
10
10
|
from ...log import RuyiLogger, humanize_list
|
|
11
11
|
from ...ruyipkg.atom import Atom
|
|
12
|
-
from ...ruyipkg.pkg_manifest import EmulatorProgDecl
|
|
12
|
+
from ...ruyipkg.pkg_manifest import BoundPackageManifest, EmulatorProgDecl
|
|
13
13
|
from ...ruyipkg.profile import ProfileProxy
|
|
14
14
|
from ...utils.global_mode import ProvidesGlobalMode
|
|
15
15
|
from ...utils.templating import render_template_str
|
|
16
|
-
from . import ConfiguredTargetTuple
|
|
17
16
|
from .emulator_cfg import ResolvedEmulatorProg
|
|
18
17
|
|
|
19
18
|
|
|
19
|
+
class ConfiguredTargetTuple(TypedDict):
|
|
20
|
+
target: str
|
|
21
|
+
toolchain_root: PathLike[Any]
|
|
22
|
+
toolchain_sysroot: PathLike[Any] | None
|
|
23
|
+
toolchain_flags: str
|
|
24
|
+
binutils_flavor: str
|
|
25
|
+
cc_flavor: str
|
|
26
|
+
gcc_install_dir: PathLike[Any] | None
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class VenvPackageInfo(TypedDict):
|
|
30
|
+
repo_id: str
|
|
31
|
+
category: str
|
|
32
|
+
name: str
|
|
33
|
+
version: str
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class VenvMetadata(TypedDict):
|
|
37
|
+
emulator_pkgs: dict[str, VenvPackageInfo]
|
|
38
|
+
extra_pkgs: list[VenvPackageInfo]
|
|
39
|
+
sysroot_pkg: VenvPackageInfo | None
|
|
40
|
+
toolchain_pkgs: dict[str, VenvPackageInfo]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _venv_pkg_info_from_pkg(pkg: BoundPackageManifest) -> VenvPackageInfo:
|
|
44
|
+
return VenvPackageInfo(
|
|
45
|
+
repo_id=pkg.repo_id,
|
|
46
|
+
category=pkg.category,
|
|
47
|
+
name=pkg.name,
|
|
48
|
+
version=pkg.ver,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
20
52
|
def do_make_venv(
|
|
21
53
|
config: GlobalConfig,
|
|
22
54
|
host: str,
|
|
@@ -50,6 +82,12 @@ def do_make_venv(
|
|
|
50
82
|
seen_target_tuples: set[str] = set()
|
|
51
83
|
targets: list[ConfiguredTargetTuple] = []
|
|
52
84
|
warn_differing_target_arch = False
|
|
85
|
+
venv_metadata = VenvMetadata(
|
|
86
|
+
emulator_pkgs={},
|
|
87
|
+
extra_pkgs=[],
|
|
88
|
+
sysroot_pkg=None,
|
|
89
|
+
toolchain_pkgs={},
|
|
90
|
+
)
|
|
53
91
|
|
|
54
92
|
for tc_atom_str in tc_atoms_str:
|
|
55
93
|
tc_atom = Atom.parse(tc_atom_str)
|
|
@@ -97,6 +135,7 @@ def do_make_venv(
|
|
|
97
135
|
if with_sysroot:
|
|
98
136
|
if tc_sysroot_relpath := tc_pm.toolchain_metadata.included_sysroot:
|
|
99
137
|
tc_sysroot_dir = pathlib.Path(toolchain_root) / tc_sysroot_relpath
|
|
138
|
+
venv_metadata["sysroot_pkg"] = _venv_pkg_info_from_pkg(tc_pm)
|
|
100
139
|
else:
|
|
101
140
|
if sysroot_atom_str is None:
|
|
102
141
|
logger.F(
|
|
@@ -156,6 +195,8 @@ def do_make_venv(
|
|
|
156
195
|
)
|
|
157
196
|
return 1
|
|
158
197
|
|
|
198
|
+
venv_metadata["sysroot_pkg"] = _venv_pkg_info_from_pkg(gcc_pkg_pm)
|
|
199
|
+
|
|
159
200
|
# derive flags for (the quirks of) this toolchain
|
|
160
201
|
tc_flags = profile.get_common_flags(tc_pm.toolchain_metadata.quirks)
|
|
161
202
|
|
|
@@ -177,6 +218,7 @@ def do_make_venv(
|
|
|
177
218
|
logger.D(f"configuration for {target_tuple}: {configured_target}")
|
|
178
219
|
targets.append(configured_target)
|
|
179
220
|
seen_target_tuples.add(target_tuple)
|
|
221
|
+
venv_metadata["toolchain_pkgs"][target_tuple] = _venv_pkg_info_from_pkg(tc_pm)
|
|
180
222
|
|
|
181
223
|
# record the target architecture for use in emulator package matching
|
|
182
224
|
if not target_arch:
|
|
@@ -236,6 +278,8 @@ def do_make_venv(
|
|
|
236
278
|
logger.F("cannot find the installed directory for the emulator")
|
|
237
279
|
return 1
|
|
238
280
|
|
|
281
|
+
venv_metadata["emulator_pkgs"][target_arch] = _venv_pkg_info_from_pkg(emu_pm)
|
|
282
|
+
|
|
239
283
|
# Now resolve extra commands to provide in the venv.
|
|
240
284
|
extra_cmds: dict[str, str] = {}
|
|
241
285
|
if extra_cmd_atoms_str:
|
|
@@ -276,6 +320,8 @@ def do_make_venv(
|
|
|
276
320
|
return 1
|
|
277
321
|
cmd_root = pathlib.Path(cmd_root)
|
|
278
322
|
|
|
323
|
+
venv_metadata["extra_pkgs"].append(_venv_pkg_info_from_pkg(extra_cmd_pm))
|
|
324
|
+
|
|
279
325
|
for cmd, cmd_rel_path in extra_cmds_decl.items():
|
|
280
326
|
# resolve the command path
|
|
281
327
|
cmd_path = (cmd_root / cmd_rel_path).resolve()
|
|
@@ -305,6 +351,7 @@ def do_make_venv(
|
|
|
305
351
|
emu_progs,
|
|
306
352
|
emu_root,
|
|
307
353
|
extra_cmds,
|
|
354
|
+
venv_metadata,
|
|
308
355
|
override_name,
|
|
309
356
|
)
|
|
310
357
|
maker.provision()
|
|
@@ -350,6 +397,7 @@ class VenvMaker:
|
|
|
350
397
|
emulator_progs: list[EmulatorProgDecl] | None,
|
|
351
398
|
emulator_root: PathLike[Any] | None,
|
|
352
399
|
extra_cmds: dict[str, str] | None,
|
|
400
|
+
metadata: VenvMetadata,
|
|
353
401
|
override_name: str | None = None,
|
|
354
402
|
) -> None:
|
|
355
403
|
self.gc = gc
|
|
@@ -359,6 +407,7 @@ class VenvMaker:
|
|
|
359
407
|
self.emulator_progs = emulator_progs
|
|
360
408
|
self.emulator_root = emulator_root
|
|
361
409
|
self.extra_cmds = extra_cmds or {}
|
|
410
|
+
self.metadata = metadata
|
|
362
411
|
self.override_name = override_name
|
|
363
412
|
|
|
364
413
|
self.bindir = self.venv_root / "bin"
|
|
@@ -415,6 +464,7 @@ class VenvMaker:
|
|
|
415
464
|
env_data = {
|
|
416
465
|
"profile": self.profile.id,
|
|
417
466
|
"sysroot": self.sysroot_destdir(None),
|
|
467
|
+
"metadata": self.metadata,
|
|
418
468
|
}
|
|
419
469
|
self.render_and_write(
|
|
420
470
|
venv_root / "ruyi-venv.toml",
|
|
@@ -148,7 +148,7 @@ class UnsandboxedRuyiPluginLoader(BasePluginLoader[UnsandboxedModuleDict]):
|
|
|
148
148
|
@staticmethod
|
|
149
149
|
def source_to_code(
|
|
150
150
|
data: "Buffer | str | ast.Module",
|
|
151
|
-
path: "
|
|
151
|
+
path: "str | os.PathLike[str]" = "<string>",
|
|
152
152
|
) -> CodeType:
|
|
153
153
|
mod_ast: ast.Module
|
|
154
154
|
if isinstance(data, ast.Module):
|
|
@@ -11,7 +11,7 @@ RESOURCES: Final = {
|
|
|
11
11
|
"prompt.venv-created.txt.jinja": b"eNp1kTFvwkAMhff7FV7YStjbqWLqwMZSISSOO4dYJOfIvoRGiP9eXwR0KTedbOv5e8/bBmEkyYNvAZP9OHWYMpBC4gsEQZ8xVs598wCdn8CHTKPVgDIcJ1AeJFA6QTYh3/fCvVBp3+eIE2gQ6k0ylSG3Owli2h8p7VZ7iCQYMsv0Bj5FiPjUN3FKI5+L+EGGiZZ/zUPlroslUA06qTBnWNyc+4RaUJtHbdUL1vRTrPhWGYxtJDUgjHeW/5xX7mt270dPrT+25iTPszW3LV8KTe9z8+4c2LubuV6fILeb2ZrpMEUDLGDbFyHPWIE7VLhQbsDCjtOy8xFhvfFnhMzchsYbbU0tupLQBtUiDcKq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+iUa5UX1YzgOi9gaXMVgi+ENsDlwn7Ku+a6FAZKCVUhoOJ6JSqr3JVaya2Q1X1XbfutNN+eBYUyHfzffCwiATrs6oV6EcToDdHBDRiHz9SjMyAxnt1iw9jHkwCd2G+4PsQk", # fmt: skip
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -168,17 +168,16 @@ def do_install_atoms(
|
|
|
168
168
|
for s in sv.render_known_issues(pm.repo.messages, config.lang_code):
|
|
169
169
|
logger.I(s)
|
|
170
170
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
)
|
|
171
|
+
config.telemetry.record(
|
|
172
|
+
TelemetryScope(mr.repo_id),
|
|
173
|
+
"repo:package-install-v1",
|
|
174
|
+
atom=a_str,
|
|
175
|
+
host=canonicalized_host,
|
|
176
|
+
pkg_category=pm.category,
|
|
177
|
+
pkg_kinds=pm.kind,
|
|
178
|
+
pkg_name=pm.name,
|
|
179
|
+
pkg_version=pm.ver,
|
|
180
|
+
)
|
|
182
181
|
|
|
183
182
|
if pm.binary_metadata is not None:
|
|
184
183
|
ret = _do_install_binary_pkg(
|
|
@@ -478,17 +477,16 @@ def do_uninstall_atoms(
|
|
|
478
477
|
for a_str, pm in pms_to_uninstall:
|
|
479
478
|
pkg_name = pm.name_for_installation
|
|
480
479
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
)
|
|
480
|
+
config.telemetry.record(
|
|
481
|
+
TelemetryScope(mr.repo_id),
|
|
482
|
+
"repo:package-uninstall-v1",
|
|
483
|
+
atom=a_str,
|
|
484
|
+
host=canonicalized_host,
|
|
485
|
+
pkg_category=pm.category,
|
|
486
|
+
pkg_kinds=pm.kind,
|
|
487
|
+
pkg_name=pm.name,
|
|
488
|
+
pkg_version=pm.ver,
|
|
489
|
+
)
|
|
492
490
|
|
|
493
491
|
if pm.binary_metadata is not None:
|
|
494
492
|
ret = _do_uninstall_binary_pkg(
|
|
@@ -18,8 +18,13 @@ class UploadPayload(TypedDict):
|
|
|
18
18
|
fmt: int
|
|
19
19
|
nonce: str
|
|
20
20
|
ruyi_version: str
|
|
21
|
+
report_uuid: "NotRequired[str]"
|
|
22
|
+
"""Optional field in case the client wishes to report this, and nothing
|
|
23
|
+
else. If `installation` is present, this field is ignored."""
|
|
21
24
|
installation: "NotRequired[NodeInfo | None]"
|
|
25
|
+
"""More detailed installation info that the client has user consent to report."""
|
|
22
26
|
events: list[AggregatedTelemetryEvent]
|
|
27
|
+
"""Aggregated telemetry events that the client has user consent to upload."""
|
|
23
28
|
|
|
24
29
|
|
|
25
30
|
def stringify_param_val(v: object) -> str:
|