unity-devkit 0.1.2__tar.gz → 0.1.4__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.
- unity_devkit-0.1.4/.gitattributes +1 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/.github/workflows/ci.yml +3 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/.github/workflows/release.yml +1 -1
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/PKG-INFO +1 -1
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/pyproject.toml +1 -1
- unity_devkit-0.1.4/ruff.base.toml +198 -0
- unity_devkit-0.1.4/ruff.toml +5 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/src/unity_devkit/build_unity.py +11 -10
- unity_devkit-0.1.2/ruff.toml +0 -95
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/.gitignore +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/AGENTS.md +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/CLAUDE.md +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/LICENSE +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/NOTICE +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/README.md +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/publish-config.json +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/src/unity_devkit/__init__.py +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/src/unity_devkit/compile_unity.py +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/src/unity_devkit/install.py +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/src/unity_devkit/license.py +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/src/unity_devkit/license_restore.py +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/src/unity_devkit/lock_unity.py +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/src/unity_devkit/matrix.py +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/src/unity_devkit/projects.py +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/src/unity_devkit/py.typed +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/src/unity_devkit/test_unity.py +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/src/unity_devkit/unity.py +0 -0
- {unity_devkit-0.1.2 → unity_devkit-0.1.4}/uv.lock +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruff.base.toml -text
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Org-canonical ruff configuration, hosted in python-devkit.
|
|
2
|
+
# Consuming repos carry this file verbatim as ruff.base.toml, written by the
|
|
3
|
+
# sync-ruff verb (uvx --from python-devkit sync-ruff) and drift-gated in CI.
|
|
4
|
+
# Never edit a synced copy: change this canonical, release python-devkit, and
|
|
5
|
+
# re-run sync-ruff in each consuming repo.
|
|
6
|
+
target-version = "py313"
|
|
7
|
+
line-length = 120
|
|
8
|
+
preview = true
|
|
9
|
+
required-version = ">=0.14.11"
|
|
10
|
+
|
|
11
|
+
[lint]
|
|
12
|
+
select = ["ALL"]
|
|
13
|
+
ignore = [
|
|
14
|
+
# ── Temporarily ignored (inline noqas exist for these rules but are redundant
|
|
15
|
+
# while the rules are globally ignored — RUF100 suppresses the "unused noqa" warning
|
|
16
|
+
# until we un-ignore each ticket's rules)
|
|
17
|
+
"RUF100",
|
|
18
|
+
|
|
19
|
+
# ── Permanently ignored ──────────────────────────────────────────────
|
|
20
|
+
# Type annotations — basedpyright strict mode handles this
|
|
21
|
+
"ANN",
|
|
22
|
+
# EM101 (string literal in exception) — the msg = ... indirection adds verbosity without benefit
|
|
23
|
+
"EM101",
|
|
24
|
+
# TRY003 (raise vanilla args) — requires custom exception class for every raise site;
|
|
25
|
+
# the real problem (interpolation) is caught by EM102/EM103
|
|
26
|
+
"TRY003",
|
|
27
|
+
# A003 (class attribute shadowing) — class attributes via self.x never conflict with builtins
|
|
28
|
+
"A003",
|
|
29
|
+
# Function complexity counting — C901 already covers structural complexity;
|
|
30
|
+
# these counting rules are largely redundant
|
|
31
|
+
"PLR0911",
|
|
32
|
+
"PLR0912",
|
|
33
|
+
"PLR0913",
|
|
34
|
+
"PLR0914",
|
|
35
|
+
"PLR0915",
|
|
36
|
+
"PLR0917",
|
|
37
|
+
|
|
38
|
+
# ── Temporarily ignored (will enable when conventions are established) ─
|
|
39
|
+
# Docstrings — project policy is "no docstrings" for now
|
|
40
|
+
"D",
|
|
41
|
+
# Copyright notices — not yet established
|
|
42
|
+
"CPY",
|
|
43
|
+
# Docstring formatting — blocked on D
|
|
44
|
+
"DOC",
|
|
45
|
+
# TODO/FIXME comment formatting
|
|
46
|
+
"TD",
|
|
47
|
+
"FIX",
|
|
48
|
+
|
|
49
|
+
# The "Ticket N" blocks below are the transitional cleanup slices tracked
|
|
50
|
+
# by PLE-248 (Enforce the deferred ruff rules):
|
|
51
|
+
# https://linear.app/plerionplatforms/issue/PLE-248
|
|
52
|
+
# Ticket 3 (T201, print → logging) is tracked by PLE-336:
|
|
53
|
+
# https://linear.app/plerionplatforms/issue/PLE-336
|
|
54
|
+
# Lifting a rule = remove it here in python-devkit's canonical config,
|
|
55
|
+
# release, and run sync-ruff in every consuming repo.
|
|
56
|
+
|
|
57
|
+
# ── Ticket 1: Auto-fix formatting & type modernization ───────────────
|
|
58
|
+
# Zero risk. Purely mechanical, all auto-fixable via ruff --fix.
|
|
59
|
+
"COM812", # missing trailing commas
|
|
60
|
+
"I001", # import sorting
|
|
61
|
+
"ISC003", # explicit string concatenation
|
|
62
|
+
"RUF031", # parenthesized tuple in subscript
|
|
63
|
+
"TC001", # move import into TYPE_CHECKING block
|
|
64
|
+
"TC002", # move third-party import into TYPE_CHECKING block
|
|
65
|
+
"TC003", # move stdlib import into TYPE_CHECKING block
|
|
66
|
+
"TC006", # move typing import into TYPE_CHECKING block (PEP 695)
|
|
67
|
+
"TC008", # move import into TYPE_CHECKING block (quoted annotation)
|
|
68
|
+
"UP006", # use X instead of typing.X
|
|
69
|
+
"UP007", # use X | Y instead of Union
|
|
70
|
+
"UP011", # unnecessary parentheses to functools.lru_cache
|
|
71
|
+
"UP015", # unnecessary open mode parameters
|
|
72
|
+
"UP017", # use datetime.UTC alias
|
|
73
|
+
"UP034", # extraneous parentheses
|
|
74
|
+
"UP035", # deprecated import (use collections.abc, etc.)
|
|
75
|
+
"UP040", # use PEP 695 type alias
|
|
76
|
+
"UP042", # use PEP 695 type parameters
|
|
77
|
+
"UP045", # use X | None instead of Optional
|
|
78
|
+
|
|
79
|
+
# ── Ticket 2: Auto-fix code simplifications ──────────────────────────
|
|
80
|
+
# Very low risk. Auto-fixable with trivial semantic changes.
|
|
81
|
+
"C401", # unnecessary generator — use set/dict comprehension
|
|
82
|
+
"C416", # unnecessary comprehension — use list/dict
|
|
83
|
+
"ERA001", # commented-out code
|
|
84
|
+
"FURB101", # read-text can replace open+read
|
|
85
|
+
"FURB103", # write-text can replace open+write
|
|
86
|
+
"FURB110", # use ternary instead of try/except for default
|
|
87
|
+
"FURB113", # use list.extend instead of repeated append
|
|
88
|
+
"FURB118", # use operator module instead of lambda
|
|
89
|
+
"LOG004", # use __name__ as logger name
|
|
90
|
+
"PERF401", # use list comprehension instead of manual append
|
|
91
|
+
"PIE810", # unnecessary spread of single-element starred
|
|
92
|
+
"PLC0207", # use a single __all__ definition
|
|
93
|
+
"PLC1901", # compare to empty string using falsy check
|
|
94
|
+
"PLR1711", # useless return at end of function
|
|
95
|
+
"PLR6104", # use augmented assignment
|
|
96
|
+
"PLR6201", # use a set literal for membership test
|
|
97
|
+
"PLW1510", # subprocess.run without explicit check= argument
|
|
98
|
+
"PLW1514", # open without explicit encoding
|
|
99
|
+
"PT001", # use @pytest.fixture over @pytest.fixture()
|
|
100
|
+
"PT018", # composite assertion — split into multiple asserts
|
|
101
|
+
"PTH101", # os.chmod → Path.chmod
|
|
102
|
+
"PTH111", # os.path.expanduser → Path.expanduser
|
|
103
|
+
"PTH112", # os.path.isdir → Path.is_dir
|
|
104
|
+
"PTH118", # os.path.join → Path /
|
|
105
|
+
"PTH123", # open() → Path.open()
|
|
106
|
+
"PTH201", # pathlib.Path(".")
|
|
107
|
+
"RET501", # unnecessary explicit return None
|
|
108
|
+
"RET504", # unnecessary assignment before return
|
|
109
|
+
"RET505", # unnecessary else after return
|
|
110
|
+
"RET506", # unnecessary else after raise
|
|
111
|
+
"RET507", # unnecessary else after continue
|
|
112
|
+
"RSE102", # unnecessary parentheses on raised exception
|
|
113
|
+
"RUF005", # consider spread operator instead of concatenation
|
|
114
|
+
"RUF010", # use explicit conversion flag in f-string
|
|
115
|
+
"RUF015", # prefer next() over single-element slice
|
|
116
|
+
"RUF029", # function is declared async but has no await
|
|
117
|
+
"RUF052", # local variable is assigned but never used (underscore prefix)
|
|
118
|
+
"RUF056", # unnecessary default value for keyword argument
|
|
119
|
+
"SIM102", # collapsible if statements
|
|
120
|
+
"SIM105", # use contextlib.suppress instead of try/except/pass
|
|
121
|
+
"SIM115", # use context manager for opening files
|
|
122
|
+
"SIM117", # use single with statement for multiple context managers
|
|
123
|
+
"SIM118", # use key in dict instead of key in dict.keys()
|
|
124
|
+
"TID252", # prefer absolute imports over relative
|
|
125
|
+
|
|
126
|
+
# ── Ticket 3: print → logging ────────────────────────────────────────
|
|
127
|
+
# All code should use logging, including CLI scripts.
|
|
128
|
+
"T201", # print found
|
|
129
|
+
|
|
130
|
+
# ── Ticket 4: Exception message interpolation ────────────────────────
|
|
131
|
+
# Remove f-strings from exception messages — use string literals.
|
|
132
|
+
"EM102", # f-string in exception message
|
|
133
|
+
|
|
134
|
+
# ── Ticket 5: Missing __init__.py + shebangs ─────────────────────────
|
|
135
|
+
# Add __init__.py to installable packages; remove vestigial shebangs.
|
|
136
|
+
"INP001", # implicit namespace package — add __init__.py
|
|
137
|
+
"EXE001", # shebang present but file not executable
|
|
138
|
+
|
|
139
|
+
# ── Ticket 6: Type ignore specificity ────────────────────────────────
|
|
140
|
+
# Replace blanket type: ignore with specific error codes.
|
|
141
|
+
"PGH003", # blanket type: ignore
|
|
142
|
+
|
|
143
|
+
# ── Ticket 7: Boolean trap refactoring ───────────────────────────────
|
|
144
|
+
# Change function signatures — callers must update too.
|
|
145
|
+
"FBT001", # boolean positional argument
|
|
146
|
+
"FBT002", # boolean default value in function definition
|
|
147
|
+
"FBT003", # boolean positional value in call
|
|
148
|
+
|
|
149
|
+
# ── Ticket 8: Exception handling patterns ────────────────────────────
|
|
150
|
+
# Behavioral changes to error handling.
|
|
151
|
+
"B020", # loop variable overwritten by except
|
|
152
|
+
"B903", # generator should use yield from
|
|
153
|
+
"B904", # raise without from inside except
|
|
154
|
+
"B905", # zip() without strict= parameter
|
|
155
|
+
"BLE001", # blind except Exception
|
|
156
|
+
"S101", # assert outside tests
|
|
157
|
+
"TRY002", # create custom exception class
|
|
158
|
+
"TRY300", # try/except/return — move return into else
|
|
159
|
+
|
|
160
|
+
# ── Ticket 9: Complexity, naming & refactoring ───────────────────────
|
|
161
|
+
# Structural changes requiring judgment.
|
|
162
|
+
"A001", # builtin shadowing (dir, bytes)
|
|
163
|
+
"ARG001", # unused function argument
|
|
164
|
+
"ARG002", # unused method argument
|
|
165
|
+
"C901", # function too complex
|
|
166
|
+
"E501", # line too long
|
|
167
|
+
"N802", # function name should be lowercase
|
|
168
|
+
"N806", # variable in function should be lowercase
|
|
169
|
+
"N815", # mixed-case variable in class scope
|
|
170
|
+
"N818", # exception name should end in Error
|
|
171
|
+
"PLC0415", # import not at top level
|
|
172
|
+
"PLE0704", # bare raise not inside except handler
|
|
173
|
+
"PLR1702", # too many nested blocks
|
|
174
|
+
"PLR2004", # magic value used in comparison
|
|
175
|
+
"PLR6301", # method could be function or static method
|
|
176
|
+
"PLW0603", # global statement
|
|
177
|
+
"PLW2901", # loop variable overwritten
|
|
178
|
+
"RUF001", # ambiguous unicode — replace with ASCII
|
|
179
|
+
"RUF003", # ambiguous unicode in comment
|
|
180
|
+
"S106", # possible hardcoded password
|
|
181
|
+
"S108", # probable insecure temp file/dir usage
|
|
182
|
+
"S110", # try/except/pass on broad exception
|
|
183
|
+
"S202", # use of tarfile.extractall
|
|
184
|
+
# S404/S603: prerequisite — bash.py needs env, stderr=STDOUT merge, and no-raise-with-capture
|
|
185
|
+
# before context_sha.py, deptry_check.py, test_context_sha.py, list_debug_targets.py can migrate
|
|
186
|
+
"S404", # suspicious subprocess import
|
|
187
|
+
"S603", # subprocess call with non-literal
|
|
188
|
+
"S606", # starting process without shell
|
|
189
|
+
"S607", # starting process with partial path
|
|
190
|
+
]
|
|
191
|
+
|
|
192
|
+
[lint.per-file-ignores]
|
|
193
|
+
# Tests use assert as the standard pytest mechanism; fixtures take arguments
|
|
194
|
+
# that pytest consumes implicitly; pytest-style test classes need no self use
|
|
195
|
+
"**/tests/**" = ["S101", "ARG001", "ARG002", "PLR6301"]
|
|
196
|
+
|
|
197
|
+
[lint.flake8-builtins]
|
|
198
|
+
ignorelist = ["id", "map"]
|
|
@@ -4,6 +4,7 @@ import json
|
|
|
4
4
|
import os
|
|
5
5
|
import shutil
|
|
6
6
|
from pathlib import Path
|
|
7
|
+
from typing import Annotated
|
|
7
8
|
|
|
8
9
|
import typer
|
|
9
10
|
from pydantic_settings import BaseSettings
|
|
@@ -28,16 +29,16 @@ app = typer.Typer(add_completion=False, pretty_exceptions_show_locals=False)
|
|
|
28
29
|
|
|
29
30
|
@app.command()
|
|
30
31
|
def main(
|
|
31
|
-
project: str
|
|
32
|
-
project_path: Path
|
|
33
|
-
platform: str
|
|
34
|
-
cache_key: str
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
build_env:
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
project: Annotated[str, typer.Option(help="Project name")],
|
|
33
|
+
project_path: Annotated[Path, typer.Option(help="Path to Unity project")],
|
|
34
|
+
platform: Annotated[str, typer.Option(help="Target platform")],
|
|
35
|
+
cache_key: Annotated[str, typer.Option(help="Cache key prefix")],
|
|
36
|
+
registry: Annotated[str, typer.Option(help="OCI registry path")],
|
|
37
|
+
run_number: Annotated[int, typer.Option(help="CI run number")] = 0,
|
|
38
|
+
branch: Annotated[str, typer.Option(help="Git branch name")] = "dev",
|
|
39
|
+
build_env: Annotated[
|
|
40
|
+
str, typer.Option(help="Newline-separated KEY=VALUE pairs injected into the Unity build process environment")
|
|
41
|
+
] = "",
|
|
41
42
|
) -> None:
|
|
42
43
|
for line in build_env.splitlines():
|
|
43
44
|
entry = line.strip()
|
unity_devkit-0.1.2/ruff.toml
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
target-version = "py313"
|
|
2
|
-
line-length = 120
|
|
3
|
-
preview = true
|
|
4
|
-
|
|
5
|
-
[lint]
|
|
6
|
-
select = ["ALL"]
|
|
7
|
-
ignore = [
|
|
8
|
-
# ── Permanent ─────────────────────────────────────────────────────────
|
|
9
|
-
# Type annotations — basedpyright strict mode handles this
|
|
10
|
-
"ANN",
|
|
11
|
-
# No docstrings, no copyright headers
|
|
12
|
-
"D",
|
|
13
|
-
"DOC",
|
|
14
|
-
"CPY",
|
|
15
|
-
# TODO/FIXME comment formatting
|
|
16
|
-
"TD",
|
|
17
|
-
"FIX",
|
|
18
|
-
# Exception message ergonomics — literal-indirection and custom-class churn without benefit
|
|
19
|
-
"EM101",
|
|
20
|
-
"EM102",
|
|
21
|
-
"TRY003",
|
|
22
|
-
# Class attribute names never conflict with builtins via self.x
|
|
23
|
-
"A003",
|
|
24
|
-
# Function-size counters — C901 already covers structural complexity
|
|
25
|
-
"PLR0911",
|
|
26
|
-
"PLR0912",
|
|
27
|
-
"PLR0913",
|
|
28
|
-
"PLR0914",
|
|
29
|
-
"PLR0915",
|
|
30
|
-
"PLR0917",
|
|
31
|
-
# Typer's Option/Argument in argument defaults is typer's standard API pattern
|
|
32
|
-
"B008",
|
|
33
|
-
# Boolean parameters read fine as keyword-only flags here
|
|
34
|
-
"FBT001",
|
|
35
|
-
"FBT002",
|
|
36
|
-
"FBT003",
|
|
37
|
-
# Relative imports are the intra-package convention
|
|
38
|
-
"TID252",
|
|
39
|
-
# Formatter-owned; enforced by `ruff format`
|
|
40
|
-
"COM812",
|
|
41
|
-
"I001",
|
|
42
|
-
# Magic values in comparisons are readable in this CLI
|
|
43
|
-
"PLR2004",
|
|
44
|
-
# The formatter owns wrapping; long string literals and URLs stay on one line
|
|
45
|
-
"E501",
|
|
46
|
-
# src-layout tests need no __init__.py
|
|
47
|
-
"INP001",
|
|
48
|
-
# Runtime-used typing imports stay at module level
|
|
49
|
-
"TC001",
|
|
50
|
-
"TC002",
|
|
51
|
-
"TC003",
|
|
52
|
-
# Small literal tuples read fine in membership tests
|
|
53
|
-
"PLR6201",
|
|
54
|
-
|
|
55
|
-
# ── Deferred to PLE-248 — Enforce the deferred ruff rules
|
|
56
|
-
# https://linear.app/plerionplatforms/issue/PLE-248
|
|
57
|
-
# Mirrors placeframe's root ruff.toml transitional Ticket-N blocks; lifting
|
|
58
|
-
# a rule here should happen alongside lifting it from placeframe's ruff.toml.
|
|
59
|
-
"TC006", # move import into TYPE_CHECKING block (quoted annotation) — Ticket 1
|
|
60
|
-
"UP015", # unnecessary open mode parameters — Ticket 1
|
|
61
|
-
"FURB101", # read-text can replace open+read — Ticket 2
|
|
62
|
-
"FURB103", # write-text can replace open+write — Ticket 2
|
|
63
|
-
"FURB113", # use list.extend instead of repeated append — Ticket 2
|
|
64
|
-
"PLW1514", # open/read_text without explicit encoding — Ticket 2
|
|
65
|
-
"PTH101", # os.chmod → Path.chmod — Ticket 2
|
|
66
|
-
"PTH112", # os.path.isdir → Path.is_dir — Ticket 2
|
|
67
|
-
"PTH118", # os.path.join → Path / — Ticket 2
|
|
68
|
-
"PTH123", # open() → Path.open() — Ticket 2
|
|
69
|
-
"RET504", # unnecessary assignment before return — Ticket 2
|
|
70
|
-
"RET505", # unnecessary else after return — Ticket 2
|
|
71
|
-
"RUF005", # consider spread operator instead of concatenation — Ticket 2
|
|
72
|
-
"SIM102", # collapsible if statements — Ticket 2
|
|
73
|
-
"SIM115", # use context manager for opening files — Ticket 2
|
|
74
|
-
"SIM117", # use single with statement for multiple context managers — Ticket 2
|
|
75
|
-
"B904", # raise ... from inside except — Ticket 8
|
|
76
|
-
"BLE001", # blind except Exception — Ticket 8
|
|
77
|
-
"TRY300", # try/except/return — move return into else — Ticket 8
|
|
78
|
-
"C901", # function too complex — Ticket 9
|
|
79
|
-
"PLC0415", # import not at top level — Ticket 9
|
|
80
|
-
"PLW0603", # global statement — Ticket 9
|
|
81
|
-
"PLW2901", # loop variable overwritten — Ticket 9
|
|
82
|
-
"PTH201", # do not pass "." explicitly to Path — Ticket 2
|
|
83
|
-
"S103", # bad-file-permissions (0o755 on executable) — Ticket 9
|
|
84
|
-
"S108", # hardcoded temp file / directory — Ticket 9
|
|
85
|
-
"S404", # suspicious subprocess import — Ticket 9
|
|
86
|
-
"S603", # subprocess call with non-literal — Ticket 9
|
|
87
|
-
"S607", # start-process-with-partial-path — Ticket 9
|
|
88
|
-
|
|
89
|
-
# ── Deferred to PLE-336 — Replace print() with structured logging
|
|
90
|
-
# https://linear.app/plerionplatforms/issue/PLE-336
|
|
91
|
-
"T201", # print found
|
|
92
|
-
]
|
|
93
|
-
|
|
94
|
-
[lint.flake8-builtins]
|
|
95
|
-
ignorelist = ["id", "map"]
|
|
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
|