unity-devkit 0.3.4.dev252__py3-none-any.whl → 0.3.5.dev257__py3-none-any.whl
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.
- unity_devkit/check_unity_lock.py +68 -0
- {unity_devkit-0.3.4.dev252.dist-info → unity_devkit-0.3.5.dev257.dist-info}/METADATA +1 -1
- {unity_devkit-0.3.4.dev252.dist-info → unity_devkit-0.3.5.dev257.dist-info}/RECORD +5 -4
- {unity_devkit-0.3.4.dev252.dist-info → unity_devkit-0.3.5.dev257.dist-info}/WHEEL +1 -1
- {unity_devkit-0.3.4.dev252.dist-info → unity_devkit-0.3.5.dev257.dist-info}/entry_points.txt +1 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Annotated, Any
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from .projects import discover_projects
|
|
8
|
+
|
|
9
|
+
app = typer.Typer(add_completion=False, pretty_exceptions_show_locals=False)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@app.command()
|
|
13
|
+
def check_unity_lock(project: Annotated[str | None, typer.Option(help="Limit to a specific project.")] = None) -> None:
|
|
14
|
+
config = discover_projects()
|
|
15
|
+
|
|
16
|
+
if project is not None and project not in config:
|
|
17
|
+
raise typer.BadParameter(f"Unknown project '{project}'. Valid: {', '.join(config)}")
|
|
18
|
+
|
|
19
|
+
projects = {project: config[project]} if project else config
|
|
20
|
+
failures: list[str] = []
|
|
21
|
+
|
|
22
|
+
for name, project_config in projects.items():
|
|
23
|
+
print(f"Checking {name} ({project_config.path / 'Packages' / 'packages-lock.json'})...")
|
|
24
|
+
failures.extend(check_project_lock(name, project_config.path))
|
|
25
|
+
|
|
26
|
+
if failures:
|
|
27
|
+
for failure in failures:
|
|
28
|
+
print(f" {failure}")
|
|
29
|
+
|
|
30
|
+
raise SystemExit(
|
|
31
|
+
"packages-lock.json disagrees with Packages/manifest.json — run 'uv run lock-unity' "
|
|
32
|
+
"to regenerate the lock, then commit it."
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
print("Every packages-lock.json agrees with its manifest.")
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def check_project_lock(name: str, project_path: Path) -> list[str]:
|
|
39
|
+
packages_directory = project_path / "Packages"
|
|
40
|
+
manifest_path = packages_directory / "manifest.json"
|
|
41
|
+
lock_path = packages_directory / "packages-lock.json"
|
|
42
|
+
|
|
43
|
+
if not manifest_path.is_file():
|
|
44
|
+
return [f"{name}: {manifest_path} does not exist"]
|
|
45
|
+
|
|
46
|
+
if not lock_path.is_file():
|
|
47
|
+
return [f"{name}: {lock_path} does not exist — run 'uv run lock-unity' to generate it."]
|
|
48
|
+
|
|
49
|
+
try:
|
|
50
|
+
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
|
|
51
|
+
lock = json.loads(lock_path.read_text(encoding="utf-8"))
|
|
52
|
+
except json.JSONDecodeError as error:
|
|
53
|
+
return [f"{name}: unparseable manifest/lock JSON: {error.msg} at line {error.lineno}"]
|
|
54
|
+
|
|
55
|
+
requirements: dict[str, Any] = manifest.get("dependencies", {})
|
|
56
|
+
locked: dict[str, Any] = lock.get("dependencies", {})
|
|
57
|
+
|
|
58
|
+
failures: list[str] = []
|
|
59
|
+
|
|
60
|
+
for package, requirement in sorted(requirements.items()):
|
|
61
|
+
entry = locked.get(package)
|
|
62
|
+
|
|
63
|
+
if entry is None:
|
|
64
|
+
failures.append(f"{name}: '{package}' ({requirement}) is absent from packages-lock.json")
|
|
65
|
+
elif entry.get("version") != requirement:
|
|
66
|
+
failures.append(f"{name}: '{package}' manifest wants {requirement}, lock recorded {entry.get('version')}")
|
|
67
|
+
|
|
68
|
+
return failures
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
unity_devkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
unity_devkit/build_unity.py,sha256=saKXpZSEz-OMxwu1PHHInYtU1t2qtiu8VOpONoO-emA,6750
|
|
3
|
+
unity_devkit/check_unity_lock.py,sha256=FJSsEmk2vmpdRGyAOYEqDytu8gcbfPekYOBvX9smW2w,2501
|
|
3
4
|
unity_devkit/compile_check_unity.py,sha256=E3olw0uh9-_F6ocJLgLIcOHaje_fnXj1BEfxbeGa8Ns,2537
|
|
4
5
|
unity_devkit/identity.py,sha256=8uuIU49EEX3FPA3FRBW6XFZZijRBcb3trEQmz0hbiL4,364
|
|
5
6
|
unity_devkit/install.py,sha256=2KJ3WT3Ljc5dwh-hDlxi7Qem0-Atl7iyG3ZiY9LjIdo,7776
|
|
@@ -12,7 +13,7 @@ unity_devkit/projects.py,sha256=PO5plIj-mn8KkKOUhGRRIL_sDdd6ohl12neS2poILhs,2665
|
|
|
12
13
|
unity_devkit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
14
|
unity_devkit/test_unity.py,sha256=SpeWnV2hpdZBaGsstL8RTO50C2HEAcvantzBQYeaTpE,1075
|
|
14
15
|
unity_devkit/upm_cache.py,sha256=s4-Op9aIebcjk5pFTciSomHfAAR8KDp2nMzIZlC5icg,1158
|
|
15
|
-
unity_devkit-0.3.
|
|
16
|
-
unity_devkit-0.3.
|
|
17
|
-
unity_devkit-0.3.
|
|
18
|
-
unity_devkit-0.3.
|
|
16
|
+
unity_devkit-0.3.5.dev257.dist-info/METADATA,sha256=kghly_qoSEXhqdHENuWUITHVyZNwJ4QLMooWEcHLsG0,315
|
|
17
|
+
unity_devkit-0.3.5.dev257.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
18
|
+
unity_devkit-0.3.5.dev257.dist-info/entry_points.txt,sha256=QgnvRYXFbq3QUd93EGqFyYuE1xfW1jGA7fE99D4uKwg,524
|
|
19
|
+
unity_devkit-0.3.5.dev257.dist-info/RECORD,,
|
{unity_devkit-0.3.4.dev252.dist-info → unity_devkit-0.3.5.dev257.dist-info}/entry_points.txt
RENAMED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
activate-unity-license = unity_devkit.license:activate_app
|
|
3
3
|
build-unity = unity_devkit.build_unity:app
|
|
4
4
|
build-unity-matrix = unity_devkit.matrix:build_app
|
|
5
|
+
check-unity-lock = unity_devkit.check_unity_lock:app
|
|
5
6
|
compile-check-unity = unity_devkit.compile_check_unity:app
|
|
6
7
|
compile-check-unity-matrix = unity_devkit.matrix:compile_check_app
|
|
7
8
|
install = unity_devkit.install:app
|