ruyi 0.42.0a20251013__tar.gz → 0.42.0b20251014__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.
Files changed (101) hide show
  1. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/PKG-INFO +1 -1
  2. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/pyproject.toml +1 -1
  3. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/profile.py +148 -1
  4. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/repo.py +2 -1
  5. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/LICENSE-Apache.txt +0 -0
  6. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/README.md +0 -0
  7. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/__init__.py +0 -0
  8. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/__main__.py +0 -0
  9. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/cli/__init__.py +0 -0
  10. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/cli/builtin_commands.py +0 -0
  11. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/cli/cmd.py +0 -0
  12. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/cli/completer.py +0 -0
  13. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/cli/completion.py +0 -0
  14. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/cli/config_cli.py +0 -0
  15. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/cli/main.py +0 -0
  16. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/cli/oobe.py +0 -0
  17. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/cli/self_cli.py +0 -0
  18. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/cli/user_input.py +0 -0
  19. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/cli/version_cli.py +0 -0
  20. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/config/__init__.py +0 -0
  21. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/config/editor.py +0 -0
  22. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/config/errors.py +0 -0
  23. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/config/news.py +0 -0
  24. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/config/schema.py +0 -0
  25. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/device/__init__.py +0 -0
  26. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/device/provision.py +0 -0
  27. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/device/provision_cli.py +0 -0
  28. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/log/__init__.py +0 -0
  29. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/mux/__init__.py +0 -0
  30. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/mux/runtime.py +0 -0
  31. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/mux/venv/__init__.py +0 -0
  32. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/mux/venv/emulator_cfg.py +0 -0
  33. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/mux/venv/maker.py +0 -0
  34. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/mux/venv/venv_cli.py +0 -0
  35. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/mux/venv_cfg.py +0 -0
  36. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/pluginhost/__init__.py +0 -0
  37. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/pluginhost/api.py +0 -0
  38. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/pluginhost/ctx.py +0 -0
  39. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/pluginhost/paths.py +0 -0
  40. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/pluginhost/plugin_cli.py +0 -0
  41. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/pluginhost/unsandboxed.py +0 -0
  42. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/py.typed +0 -0
  43. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/resource_bundle/__init__.py +0 -0
  44. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/resource_bundle/__main__.py +0 -0
  45. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/resource_bundle/data.py +0 -0
  46. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/__init__.py +0 -0
  47. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/admin_checksum.py +0 -0
  48. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/admin_cli.py +0 -0
  49. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/atom.py +0 -0
  50. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/augmented_pkg.py +0 -0
  51. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/canonical_dump.py +0 -0
  52. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/checksum.py +0 -0
  53. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/cli_completion.py +0 -0
  54. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/distfile.py +0 -0
  55. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/entity.py +0 -0
  56. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/entity_cli.py +0 -0
  57. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/entity_provider.py +0 -0
  58. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/fetcher.py +0 -0
  59. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/host.py +0 -0
  60. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/install.py +0 -0
  61. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/install_cli.py +0 -0
  62. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/list.py +0 -0
  63. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/list_cli.py +0 -0
  64. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/list_filter.py +0 -0
  65. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/msg.py +0 -0
  66. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/news.py +0 -0
  67. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/news_cli.py +0 -0
  68. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/news_store.py +0 -0
  69. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/pkg_manifest.py +0 -0
  70. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/profile_cli.py +0 -0
  71. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/protocols.py +0 -0
  72. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/state.py +0 -0
  73. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/unpack.py +0 -0
  74. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/unpack_method.py +0 -0
  75. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/ruyipkg/update_cli.py +0 -0
  76. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/telemetry/__init__.py +0 -0
  77. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/telemetry/aggregate.py +0 -0
  78. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/telemetry/event.py +0 -0
  79. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/telemetry/node_info.py +0 -0
  80. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/telemetry/provider.py +0 -0
  81. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/telemetry/scope.py +0 -0
  82. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/telemetry/store.py +0 -0
  83. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/telemetry/telemetry_cli.py +0 -0
  84. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/__init__.py +0 -0
  85. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/ar.py +0 -0
  86. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/ci.py +0 -0
  87. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/frontmatter.py +0 -0
  88. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/git.py +0 -0
  89. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/global_mode.py +0 -0
  90. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/l10n.py +0 -0
  91. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/markdown.py +0 -0
  92. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/mounts.py +0 -0
  93. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/nuitka.py +0 -0
  94. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/porcelain.py +0 -0
  95. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/prereqs.py +0 -0
  96. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/ssl_patch.py +0 -0
  97. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/templating.py +0 -0
  98. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/toml.py +0 -0
  99. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/url.py +0 -0
  100. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/utils/xdg_basedir.py +0 -0
  101. {ruyi-0.42.0a20251013 → ruyi-0.42.0b20251014}/ruyi/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ruyi
3
- Version: 0.42.0a20251013
3
+ Version: 0.42.0b20251014
4
4
  Summary: Package manager for RuyiSDK
5
5
  License: Apache License
6
6
  Version 2.0, January 2004
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [project]
6
6
  name = "ruyi"
7
- version = "0.42.0-alpha.20251013"
7
+ version = "0.42.0-beta.20251014"
8
8
  description = "Package manager for RuyiSDK"
9
9
  keywords = ["ruyi", "ruyisdk"]
10
10
  license = { file = "LICENSE-Apache.txt" }
@@ -1,7 +1,21 @@
1
1
  from os import PathLike
2
- from typing import Any, Iterable, TypeGuard, cast
2
+ from typing import (
3
+ Any,
4
+ Iterable,
5
+ Mapping,
6
+ Protocol,
7
+ Sequence,
8
+ TypedDict,
9
+ TypeGuard,
10
+ TYPE_CHECKING,
11
+ cast,
12
+ )
13
+
14
+ if TYPE_CHECKING:
15
+ from typing_extensions import NotRequired
3
16
 
4
17
  from ..pluginhost.ctx import PluginHostContext, SupportsEvalFunction
18
+ from .entity_provider import BaseEntityProvider
5
19
  from .pkg_manifest import EmulatorFlavor
6
20
 
7
21
 
@@ -206,3 +220,136 @@ class ProfileProxy:
206
220
  sysroot: PathLike[Any] | None,
207
221
  ) -> dict[str, str] | None:
208
222
  return self._provider.get_env_config_for_emu_flavor(self._id, flavor, sysroot)
223
+
224
+
225
+ #
226
+ # Protocols
227
+ #
228
+
229
+
230
+ # MetadataRepo is defined in repo.py, but we don't want to import repo.py here
231
+ # to avoid circular import. Instead, we just describe the methods and properties
232
+ # that we need from MetadataRepo with a Protocol.
233
+ class ProvidesProfiles(Protocol):
234
+ def get_supported_arches(self) -> list[str]: ...
235
+ def get_profile_for_arch(self, arch: str, name: str) -> ProfileProxy | None: ...
236
+ def iter_profiles_for_arch(self, arch: str) -> Iterable[ProfileProxy]: ...
237
+
238
+
239
+ #
240
+ # Entity type and schema for profile entities
241
+ #
242
+
243
+ PROFILE_V1_ENTITY_TYPE = "profile-v1"
244
+ PROFILE_V1_ENTITY_TYPE_SCHEMA = {
245
+ "$schema": "http://json-schema.org/draft-07/schema#",
246
+ "required": ["profile-v1"],
247
+ "properties": {
248
+ "profile-v1": {
249
+ "type": "object",
250
+ "properties": {
251
+ "id": {"type": "string"},
252
+ "display_name": {"type": "string"},
253
+ "name": {"type": "string"},
254
+ "arch": {"type": "string"},
255
+ "needed_toolchain_quirks": {
256
+ "type": "array",
257
+ "items": {"type": "string"},
258
+ },
259
+ "toolchain_common_flags_str": {"type": "string"},
260
+ },
261
+ "required": [
262
+ "id",
263
+ "display_name",
264
+ "name",
265
+ "arch",
266
+ "needed_toolchain_quirks",
267
+ "toolchain_common_flags_str",
268
+ ],
269
+ },
270
+ "related": {
271
+ "type": "array",
272
+ "description": "List of related entity references",
273
+ "items": {"type": "string", "pattern": "^.+:.+"},
274
+ },
275
+ "unique_among_type_during_traversal": {
276
+ "type": "boolean",
277
+ "description": "Whether this entity should be unique among all entities of the same type during traversal",
278
+ },
279
+ },
280
+ }
281
+
282
+
283
+ class ProfileV1EntityData(TypedDict):
284
+ id: str
285
+ display_name: str
286
+ name: str
287
+ arch: str
288
+ needed_toolchain_quirks: list[str]
289
+ toolchain_common_flags_str: str
290
+
291
+
292
+ ProfileV1Entity = TypedDict(
293
+ "ProfileV1Entity",
294
+ {
295
+ "profile-v1": ProfileV1EntityData,
296
+ "related": "NotRequired[list[str]]",
297
+ "unique_among_type_during_traversal": "NotRequired[bool]",
298
+ },
299
+ total=False,
300
+ )
301
+
302
+
303
+ class ProfileEntityProvider(BaseEntityProvider):
304
+ def __init__(self, provider: ProvidesProfiles) -> None:
305
+ super().__init__()
306
+ self._provider = provider
307
+
308
+ def discover_schemas(self) -> dict[str, object]:
309
+ return {
310
+ PROFILE_V1_ENTITY_TYPE: PROFILE_V1_ENTITY_TYPE_SCHEMA,
311
+ }
312
+
313
+ def load_entities(
314
+ self,
315
+ entity_types: Sequence[str],
316
+ ) -> Mapping[str, Mapping[str, Mapping[str, Any]]]:
317
+ result: dict[str, Mapping[str, Mapping[str, Any]]] = {}
318
+ for ty in entity_types:
319
+ if ty == PROFILE_V1_ENTITY_TYPE:
320
+ result[ty] = _load_profile_v1_entities(self._provider)
321
+ return result
322
+
323
+
324
+ def _load_profile_v1_entities(provider: ProvidesProfiles) -> dict[str, ProfileV1Entity]:
325
+ result: dict[str, ProfileV1Entity] = {}
326
+ for arch in provider.get_supported_arches():
327
+ result.update(_load_profile_v1_entities_for_arch(provider, arch))
328
+ return result
329
+
330
+
331
+ def _load_profile_v1_entities_for_arch(
332
+ provider: ProvidesProfiles,
333
+ arch: str,
334
+ ) -> dict[str, ProfileV1Entity]:
335
+ result: dict[str, ProfileV1Entity] = {}
336
+ for profile in provider.iter_profiles_for_arch(arch):
337
+ full_name = profile.id
338
+ relations = [f"arch:{arch}"]
339
+
340
+ needed_toolchain_quirks = sorted(profile.need_quirks)
341
+
342
+ result[profile.id] = {
343
+ "profile-v1": {
344
+ "id": profile.id,
345
+ "display_name": full_name,
346
+ "name": profile.id,
347
+ "arch": profile.arch,
348
+ "needed_toolchain_quirks": needed_toolchain_quirks,
349
+ "toolchain_common_flags_str": profile.get_common_flags(
350
+ needed_toolchain_quirks,
351
+ ),
352
+ },
353
+ "related": relations,
354
+ }
355
+ return result
@@ -34,7 +34,7 @@ from .pkg_manifest import (
34
34
  InputPackageManifestType,
35
35
  is_prerelease,
36
36
  )
37
- from .profile import PluginProfileProvider, ProfileProxy
37
+ from .profile import PluginProfileProvider, ProfileEntityProvider, ProfileProxy
38
38
  from .protocols import ProvidesPackageManifests
39
39
 
40
40
  if sys.version_info >= (3, 11):
@@ -234,6 +234,7 @@ class MetadataRepo(ProvidesPackageManifests):
234
234
  gc.logger,
235
235
  FSEntityProvider(gc.logger, pathlib.Path(self.root) / "entities"),
236
236
  MetadataRepoEntityProvider(self),
237
+ ProfileEntityProvider(self),
237
238
  )
238
239
  self._plugin_host_ctx = PluginHostContext.new(gc.logger, self.plugin_root)
239
240
  self._plugin_fn_evaluator = self._plugin_host_ctx.make_evaluator()
File without changes