resolvescript 0.1.2__tar.gz → 0.1.4a0__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.
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/PKG-INFO +58 -3
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/README.md +56 -1
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/pyproject.toml +6 -6
- resolvescript-0.1.4a0/src/ResolveScript/__init__.py +366 -0
- resolvescript-0.1.4a0/src/ResolveScript/_version.py +8 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/cli.py +17 -6
- resolvescript-0.1.4a0/src/ResolveScript/fetch.py +186 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/install/installer.py +60 -8
- resolvescript-0.1.4a0/src/ResolveScript/manifest/__init__.py +70 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/manifest/xml_reader.py +18 -1
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/resolver.py +46 -12
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/sandbox/__init__.py +32 -2
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/sandbox/loader.py +20 -0
- resolvescript-0.1.4a0/src/ResolveScript/sources/__init__.py +61 -0
- resolvescript-0.1.4a0/src/ResolveScript/sources/archive.py +167 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/sources/git.py +32 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/templates/extension/conftest.py +1 -1
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/testing/__init__.py +1 -1
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/workspace.py +10 -3
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/src/resolvescript.egg-info/PKG-INFO +58 -3
- resolvescript-0.1.4a0/src/resolvescript.egg-info/SOURCES.txt +65 -0
- resolvescript-0.1.4a0/src/resolvescript.egg-info/entry_points.txt +2 -0
- resolvescript-0.1.4a0/src/resolvescript.egg-info/top_level.txt +1 -0
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/tests/test_analyze.py +4 -4
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/tests/test_cli.py +3 -3
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/tests/test_consolidate.py +6 -6
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/tests/test_install.py +10 -10
- resolvescript-0.1.4a0/tests/test_library.py +191 -0
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/tests/test_manage.py +2 -2
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/tests/test_manifest.py +5 -5
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/tests/test_package.py +3 -3
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/tests/test_runtime.py +21 -21
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/tests/test_sandbox.py +6 -6
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/tests/test_scaffold.py +5 -5
- resolvescript-0.1.4a0/tests/test_security.py +160 -0
- resolvescript-0.1.2/src/resolve_script/__init__.py +0 -3
- resolvescript-0.1.2/src/resolve_script/fetch.py +0 -90
- resolvescript-0.1.2/src/resolve_script/manifest/__init__.py +0 -1
- resolvescript-0.1.2/src/resolve_script/sources/__init__.py +0 -15
- resolvescript-0.1.2/src/resolve_script/sources/archive.py +0 -82
- resolvescript-0.1.2/src/resolvescript.egg-info/SOURCES.txt +0 -62
- resolvescript-0.1.2/src/resolvescript.egg-info/entry_points.txt +0 -2
- resolvescript-0.1.2/src/resolvescript.egg-info/top_level.txt +0 -1
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/LICENSE +0 -0
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/setup.cfg +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/analyze.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/config.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/consolidate.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/install/__init__.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/install/discovery.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/install/registry.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/manifest/json_reader.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/manifest/model.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/manifest/validation.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/package.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/sandbox/api.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/sandbox/env.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/sandbox/repl.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/sandbox/smoke.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/scaffold.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/semver.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/sources/known.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/sources/release.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/spec.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/templates/extension/@NAME@/__init__.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/templates/extension/@NAME@/menu.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/templates/extension/@NAME@.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/templates/extension/README.md +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/templates/extension/manifest.json.j2 +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/templates/extension/manifest.xml.j2 +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/templates/extension/tests/test_smoke.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/templates/inapp/register.py +0 -0
- {resolvescript-0.1.2/src/resolve_script → resolvescript-0.1.4a0/src/ResolveScript}/testing/fixtures.py +0 -0
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/src/resolvescript.egg-info/dependency_links.txt +0 -0
- {resolvescript-0.1.2 → resolvescript-0.1.4a0}/src/resolvescript.egg-info/requires.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: resolvescript
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: CLI framework for building, coding, testing, packaging and installing DaVinci Resolve scripts.
|
|
3
|
+
Version: 0.1.4a0
|
|
4
|
+
Summary: CLI and library framework for building, coding, testing, packaging and installing DaVinci Resolve scripts.
|
|
5
5
|
License: MIT
|
|
6
6
|
Classifier: Development Status :: 3 - Alpha
|
|
7
7
|
Classifier: Environment :: Console
|
|
@@ -22,7 +22,18 @@ Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
|
22
22
|
Dynamic: license-file
|
|
23
23
|
|
|
24
24
|
# resolvescript
|
|
25
|
-
|
|
25
|
+
<p align="center">
|
|
26
|
+
<strong>The only resolve scripting framework out there.</strong>
|
|
27
|
+
<br /><br />
|
|
28
|
+
<img src="https://img.shields.io/badge/python-%233670A0.svg?style=for-the-badge&logo=python&logoColor=ffdd54" alt="Python" />
|
|
29
|
+
<img src="https://img.shields.io/badge/davinci_resolve-%23233A51.svg?style=for-the-badge&logo=davinciresolve&logoColor=white" alt="DaVinci Resolve" />
|
|
30
|
+
<img src="https://img.shields.io/badge/pypi-%23ececec.svg?style=for-the-badge&logo=pypi&logoColor=1f73b7" alt="PyPI" />
|
|
31
|
+
<img src="https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white" alt="GitHub Actions" />
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Overview
|
|
26
37
|
Build, test, package and install [DaVinci Resolve](https://www.blackmagicdesign.com/products/davinciresolve) Python scripts and plugins: a small CLI with an npm-style workflow for the Resolve `Scripts/` tree.
|
|
27
38
|
|
|
28
39
|
- `create` scaffolds a project with a `manifest.json` and smoke tests
|
|
@@ -33,6 +44,14 @@ Build, test, package and install [DaVinci Resolve](https://www.blackmagicdesign.
|
|
|
33
44
|
|
|
34
45
|
Install with pip: `pip install resolvescript` (Python 3.12+).
|
|
35
46
|
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
| Aspect | Specification |
|
|
50
|
+
| --------------- | --------------------------------- |
|
|
51
|
+
| Current version | v0.1.4-alpha |
|
|
52
|
+
| Resolve support | DaVinci Resolve Free & Studio 18+ |
|
|
53
|
+
| License | MIT |
|
|
54
|
+
|
|
36
55
|
## Quickstart
|
|
37
56
|
|
|
38
57
|
```console
|
|
@@ -133,6 +152,42 @@ Installs drop into each OS's Resolve Scripts root under the manifest `targets`.
|
|
|
133
152
|
|
|
134
153
|
`resolvescript` ships a mock `DaVinciResolveScript` module with a faithful-enough Resolve color/editing/page object model for testing, plus `resolvescript test --api-coverage` to report which mock methods your tests actually exercise.
|
|
135
154
|
|
|
155
|
+
## Library API
|
|
156
|
+
|
|
157
|
+
`ResolveScript` is a first-class Python package — import it in any script:
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
import ResolveScript as rs
|
|
161
|
+
|
|
162
|
+
# scaffold a new project
|
|
163
|
+
root, written = rs.scaffold_project("my_tool", destination=".")
|
|
164
|
+
|
|
165
|
+
# static analysis
|
|
166
|
+
issues = rs.analyze_project(root)
|
|
167
|
+
|
|
168
|
+
# load & validate manifest
|
|
169
|
+
manifest = rs.load_manifest(root / "manifest.json")
|
|
170
|
+
rs.validate_manifest_or_throw(manifest)
|
|
171
|
+
|
|
172
|
+
# consolidate to a single file
|
|
173
|
+
cfg = rs.config_from_manifest(root, manifest)
|
|
174
|
+
result = rs.consolidate(cfg)
|
|
175
|
+
print(rs.summarize(result, cfg))
|
|
176
|
+
|
|
177
|
+
# package a release artifact
|
|
178
|
+
pkg = rs.package_project(root)
|
|
179
|
+
print(pkg.archive)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Every name exported at the package root is also available from its owning submodule, e.g. `rs.consolidate` mirrors `ResolveScript.consolidate.consolidate`. The major subpackages are:
|
|
183
|
+
|
|
184
|
+
- `ResolveScript.manifest` — model, loaders, validators
|
|
185
|
+
- `ResolveScript.sandbox` — mock Resolve API, smoke runs, REPL
|
|
186
|
+
- `ResolveScript.sources` — archive/GitHub/known-source helpers
|
|
187
|
+
- `ResolveScript.install` — install, registry, target resolution
|
|
188
|
+
|
|
189
|
+
Version: `rs.get_version()` returns the installed version string.
|
|
190
|
+
|
|
136
191
|
## Development
|
|
137
192
|
|
|
138
193
|
```console
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# resolvescript
|
|
2
|
-
|
|
2
|
+
<p align="center">
|
|
3
|
+
<strong>The only resolve scripting framework out there.</strong>
|
|
4
|
+
<br /><br />
|
|
5
|
+
<img src="https://img.shields.io/badge/python-%233670A0.svg?style=for-the-badge&logo=python&logoColor=ffdd54" alt="Python" />
|
|
6
|
+
<img src="https://img.shields.io/badge/davinci_resolve-%23233A51.svg?style=for-the-badge&logo=davinciresolve&logoColor=white" alt="DaVinci Resolve" />
|
|
7
|
+
<img src="https://img.shields.io/badge/pypi-%23ececec.svg?style=for-the-badge&logo=pypi&logoColor=1f73b7" alt="PyPI" />
|
|
8
|
+
<img src="https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white" alt="GitHub Actions" />
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
3
14
|
Build, test, package and install [DaVinci Resolve](https://www.blackmagicdesign.com/products/davinciresolve) Python scripts and plugins: a small CLI with an npm-style workflow for the Resolve `Scripts/` tree.
|
|
4
15
|
|
|
5
16
|
- `create` scaffolds a project with a `manifest.json` and smoke tests
|
|
@@ -10,6 +21,14 @@ Build, test, package and install [DaVinci Resolve](https://www.blackmagicdesign.
|
|
|
10
21
|
|
|
11
22
|
Install with pip: `pip install resolvescript` (Python 3.12+).
|
|
12
23
|
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
| Aspect | Specification |
|
|
27
|
+
| --------------- | --------------------------------- |
|
|
28
|
+
| Current version | v0.1.4-alpha |
|
|
29
|
+
| Resolve support | DaVinci Resolve Free & Studio 18+ |
|
|
30
|
+
| License | MIT |
|
|
31
|
+
|
|
13
32
|
## Quickstart
|
|
14
33
|
|
|
15
34
|
```console
|
|
@@ -110,6 +129,42 @@ Installs drop into each OS's Resolve Scripts root under the manifest `targets`.
|
|
|
110
129
|
|
|
111
130
|
`resolvescript` ships a mock `DaVinciResolveScript` module with a faithful-enough Resolve color/editing/page object model for testing, plus `resolvescript test --api-coverage` to report which mock methods your tests actually exercise.
|
|
112
131
|
|
|
132
|
+
## Library API
|
|
133
|
+
|
|
134
|
+
`ResolveScript` is a first-class Python package — import it in any script:
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
import ResolveScript as rs
|
|
138
|
+
|
|
139
|
+
# scaffold a new project
|
|
140
|
+
root, written = rs.scaffold_project("my_tool", destination=".")
|
|
141
|
+
|
|
142
|
+
# static analysis
|
|
143
|
+
issues = rs.analyze_project(root)
|
|
144
|
+
|
|
145
|
+
# load & validate manifest
|
|
146
|
+
manifest = rs.load_manifest(root / "manifest.json")
|
|
147
|
+
rs.validate_manifest_or_throw(manifest)
|
|
148
|
+
|
|
149
|
+
# consolidate to a single file
|
|
150
|
+
cfg = rs.config_from_manifest(root, manifest)
|
|
151
|
+
result = rs.consolidate(cfg)
|
|
152
|
+
print(rs.summarize(result, cfg))
|
|
153
|
+
|
|
154
|
+
# package a release artifact
|
|
155
|
+
pkg = rs.package_project(root)
|
|
156
|
+
print(pkg.archive)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Every name exported at the package root is also available from its owning submodule, e.g. `rs.consolidate` mirrors `ResolveScript.consolidate.consolidate`. The major subpackages are:
|
|
160
|
+
|
|
161
|
+
- `ResolveScript.manifest` — model, loaders, validators
|
|
162
|
+
- `ResolveScript.sandbox` — mock Resolve API, smoke runs, REPL
|
|
163
|
+
- `ResolveScript.sources` — archive/GitHub/known-source helpers
|
|
164
|
+
- `ResolveScript.install` — install, registry, target resolution
|
|
165
|
+
|
|
166
|
+
Version: `rs.get_version()` returns the installed version string.
|
|
167
|
+
|
|
113
168
|
## Development
|
|
114
169
|
|
|
115
170
|
```console
|
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "resolvescript"
|
|
7
|
-
version = "0.1.
|
|
8
|
-
description = "CLI framework for building, coding, testing, packaging and installing DaVinci Resolve scripts."
|
|
7
|
+
version = "0.1.4-alpha"
|
|
8
|
+
description = "CLI and library framework for building, coding, testing, packaging and installing DaVinci Resolve scripts."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
11
11
|
license = {text = "MIT"}
|
|
@@ -29,20 +29,20 @@ dev = [
|
|
|
29
29
|
]
|
|
30
30
|
|
|
31
31
|
[project.scripts]
|
|
32
|
-
resolvescript = "
|
|
32
|
+
resolvescript = "ResolveScript.cli:main"
|
|
33
33
|
|
|
34
34
|
[tool.setuptools.packages.find]
|
|
35
35
|
where = ["src"]
|
|
36
|
-
include = ["
|
|
36
|
+
include = ["ResolveScript*"]
|
|
37
37
|
|
|
38
38
|
[tool.setuptools.package-data]
|
|
39
|
-
"
|
|
39
|
+
"ResolveScript" = ["templates/**/*"]
|
|
40
40
|
|
|
41
41
|
[tool.ruff]
|
|
42
42
|
line-length = 100
|
|
43
43
|
target-version = "py39"
|
|
44
44
|
extend-exclude = [
|
|
45
|
-
"src/
|
|
45
|
+
"src/ResolveScript/templates", # placeholders (@NAME@) are not valid Python
|
|
46
46
|
]
|
|
47
47
|
|
|
48
48
|
[tool.ruff.lint]
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
"""ResolveScript — script framework for DaVinci Resolve.
|
|
2
|
+
|
|
3
|
+
ResolveScript is both a CLI and a normal Python package, so you can drive
|
|
4
|
+
every feature directly from a script or an interactive session.
|
|
5
|
+
|
|
6
|
+
Quick start — create and inspect a new script project::
|
|
7
|
+
|
|
8
|
+
import ResolveScript as rs
|
|
9
|
+
|
|
10
|
+
root, written = rs.scaffold_project(
|
|
11
|
+
"my-tool", destination=".", fmt="json", template="default"
|
|
12
|
+
)
|
|
13
|
+
print(root, written)
|
|
14
|
+
|
|
15
|
+
issues = rs.analyze_project(root)
|
|
16
|
+
for issue in issues:
|
|
17
|
+
print(issue)
|
|
18
|
+
|
|
19
|
+
cfg = rs.config_from_manifest(root / "resolve-script.manifest.json")
|
|
20
|
+
result = rs.consolidate(cfg)
|
|
21
|
+
print(result.target) # single-file build
|
|
22
|
+
print(result.sources) # files folded into the build
|
|
23
|
+
|
|
24
|
+
Borrow a ``Source`` spec from a known GitHub project::
|
|
25
|
+
|
|
26
|
+
import ResolveScript as rs
|
|
27
|
+
|
|
28
|
+
print(rs.lookup("hello")) # canonical source for a known name
|
|
29
|
+
values = rs.build_values("my-tool") # template substition values
|
|
30
|
+
|
|
31
|
+
Sit scripts in the Resolve environment::
|
|
32
|
+
|
|
33
|
+
from ResolveScript.sandbox import build_default_env, fake_resolve_module
|
|
34
|
+
from ResolveScript.install import install_project
|
|
35
|
+
|
|
36
|
+
env = build_default_env()
|
|
37
|
+
fake_resolve_module(env) # injects a fake ``resolve`` module
|
|
38
|
+
install_project(env, run_smoke=True, root=".")
|
|
39
|
+
|
|
40
|
+
Every public name is available both at the package root and from its owning
|
|
41
|
+
module, e.g. ``ResolveScript.consolidate`` is also the top-level
|
|
42
|
+
``consolidate`` function.
|
|
43
|
+
|
|
44
|
+
Subpackages ship their own convenience imports:
|
|
45
|
+
|
|
46
|
+
* ``ResolveScript.manifest`` — manifest model, loaders, validators
|
|
47
|
+
* ``ResolveScript.sandbox`` — mock Resolve API, smoke runs, REPL
|
|
48
|
+
* ``ResolveScript.sources`` — archive/git/known-source helpers
|
|
49
|
+
* ``ResolveScript.install`` — install, registry and target resolution
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
from __future__ import annotations
|
|
53
|
+
|
|
54
|
+
from ._version import __version__, get_version
|
|
55
|
+
|
|
56
|
+
# --- pipeline ----------------------------------------------------------
|
|
57
|
+
from .analyze import KNOWN_ROOTS, Analysis, Issue, analyze_project, issues_to_json
|
|
58
|
+
|
|
59
|
+
# --- config ------------------------------------------------------------
|
|
60
|
+
from .config import (
|
|
61
|
+
allow_remote,
|
|
62
|
+
is_editable_install,
|
|
63
|
+
normalize_path,
|
|
64
|
+
plugins_dir,
|
|
65
|
+
python_spec,
|
|
66
|
+
scripts_root_override,
|
|
67
|
+
user_config_dir,
|
|
68
|
+
)
|
|
69
|
+
from .consolidate import (
|
|
70
|
+
BuildConfig,
|
|
71
|
+
ConsolidateError,
|
|
72
|
+
ConsolidateResult,
|
|
73
|
+
config_from_manifest,
|
|
74
|
+
consolidate,
|
|
75
|
+
summarize,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
# --- fetch / CLI -------------------------------------------------------
|
|
79
|
+
from .fetch import Fetched, FetchError, fetch, fetch_json, sha256_file
|
|
80
|
+
|
|
81
|
+
# --- install -----------------------------------------------------------
|
|
82
|
+
from .install import (
|
|
83
|
+
REGISTRY_REL,
|
|
84
|
+
SCHEMA_VERSION,
|
|
85
|
+
InstalledFile,
|
|
86
|
+
InstallError,
|
|
87
|
+
InstallOptions,
|
|
88
|
+
InstallResult,
|
|
89
|
+
RegistryError,
|
|
90
|
+
add_or_update_entry,
|
|
91
|
+
default_scripts_root,
|
|
92
|
+
discover_entrypoint,
|
|
93
|
+
get_extension,
|
|
94
|
+
install_package,
|
|
95
|
+
install_project,
|
|
96
|
+
read_registry,
|
|
97
|
+
registry_path,
|
|
98
|
+
remove_entry,
|
|
99
|
+
resolve_scripts_root,
|
|
100
|
+
select_files,
|
|
101
|
+
target_dir,
|
|
102
|
+
uninstall_package,
|
|
103
|
+
write_registry,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
# --- manifest ----------------------------------------------------------
|
|
107
|
+
from .manifest import (
|
|
108
|
+
TARGET_SUGGESTIONS,
|
|
109
|
+
Compat,
|
|
110
|
+
ConsolidateConfig,
|
|
111
|
+
InstallConfig,
|
|
112
|
+
Manifest,
|
|
113
|
+
ManifestError,
|
|
114
|
+
Release,
|
|
115
|
+
Target,
|
|
116
|
+
dumps,
|
|
117
|
+
is_valid_semver,
|
|
118
|
+
load_manifest,
|
|
119
|
+
loads,
|
|
120
|
+
manifest_from_dict,
|
|
121
|
+
validate_manifest,
|
|
122
|
+
validate_manifest_or_throw,
|
|
123
|
+
validate_target,
|
|
124
|
+
)
|
|
125
|
+
from .package import PackageError, PackageResult, package_project
|
|
126
|
+
|
|
127
|
+
# --- spec / resolver ---------------------------------------------------
|
|
128
|
+
from .resolver import (
|
|
129
|
+
Resolved,
|
|
130
|
+
ResolveError,
|
|
131
|
+
lockfile_satisfies,
|
|
132
|
+
resolve_spec,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
# --- sandbox -----------------------------------------------------------
|
|
136
|
+
from .sandbox import (
|
|
137
|
+
DEFAULT_PROJECT,
|
|
138
|
+
FUSION_SCRIPT_MODULE,
|
|
139
|
+
FakeClip,
|
|
140
|
+
FakeComp,
|
|
141
|
+
FakeFolder,
|
|
142
|
+
FakeFusion,
|
|
143
|
+
FakeKey,
|
|
144
|
+
FakeMediaPool,
|
|
145
|
+
FakeMediaPoolItem,
|
|
146
|
+
FakeProject,
|
|
147
|
+
FakeProjectManager,
|
|
148
|
+
FakeResolve,
|
|
149
|
+
FakeSpline,
|
|
150
|
+
FakeStroke,
|
|
151
|
+
FakeTimeline,
|
|
152
|
+
FakeTool,
|
|
153
|
+
SmokeCheck,
|
|
154
|
+
SmokeResult,
|
|
155
|
+
build_default_env,
|
|
156
|
+
default_namespace,
|
|
157
|
+
discover_exports,
|
|
158
|
+
fake_resolve_module,
|
|
159
|
+
install_fake_resolve,
|
|
160
|
+
load_built_module,
|
|
161
|
+
load_source_module,
|
|
162
|
+
purge_module,
|
|
163
|
+
run_smoke,
|
|
164
|
+
start_repl,
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
# --- scaffold ----------------------------------------------------------
|
|
168
|
+
from .scaffold import (
|
|
169
|
+
DEFAULT_VERSION,
|
|
170
|
+
TEMPLATES_DIR,
|
|
171
|
+
ScaffoldError,
|
|
172
|
+
build_values,
|
|
173
|
+
normalize_name,
|
|
174
|
+
render,
|
|
175
|
+
scaffold_project,
|
|
176
|
+
)
|
|
177
|
+
from .semver import SemVerError, Version, matches, pick_best
|
|
178
|
+
|
|
179
|
+
# --- sources -----------------------------------------------------------
|
|
180
|
+
from .sources import (
|
|
181
|
+
ARCHIVE_SUFFIXES,
|
|
182
|
+
CONVENTIONS,
|
|
183
|
+
ArchiveError,
|
|
184
|
+
GitSourceError,
|
|
185
|
+
ReleaseError,
|
|
186
|
+
ReleaseSpec,
|
|
187
|
+
asset_download_url,
|
|
188
|
+
canonical_source,
|
|
189
|
+
codeload_url,
|
|
190
|
+
default_branch,
|
|
191
|
+
download_github,
|
|
192
|
+
is_archive_path,
|
|
193
|
+
known_names,
|
|
194
|
+
list_tags,
|
|
195
|
+
lookup,
|
|
196
|
+
make_archive,
|
|
197
|
+
resolve_tag,
|
|
198
|
+
search,
|
|
199
|
+
tags_have_version,
|
|
200
|
+
unpack_archive,
|
|
201
|
+
)
|
|
202
|
+
from .spec import Spec, SpecError, parse_specifier
|
|
203
|
+
from .workspace import (
|
|
204
|
+
WORKSPACE_FILE,
|
|
205
|
+
WorkspaceError,
|
|
206
|
+
add_dependency,
|
|
207
|
+
has_workspace,
|
|
208
|
+
read_workspace,
|
|
209
|
+
remove_dependency,
|
|
210
|
+
save,
|
|
211
|
+
workspace_path,
|
|
212
|
+
write_workspace,
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
__all__ = [
|
|
216
|
+
# version
|
|
217
|
+
"__version__",
|
|
218
|
+
"get_version",
|
|
219
|
+
# manifest
|
|
220
|
+
"Compat",
|
|
221
|
+
"ConsolidateConfig",
|
|
222
|
+
"InstallConfig",
|
|
223
|
+
"Manifest",
|
|
224
|
+
"ManifestError",
|
|
225
|
+
"Release",
|
|
226
|
+
"TARGET_SUGGESTIONS",
|
|
227
|
+
"Target",
|
|
228
|
+
"dumps",
|
|
229
|
+
"is_valid_semver",
|
|
230
|
+
"load_manifest",
|
|
231
|
+
"loads",
|
|
232
|
+
"manifest_from_dict",
|
|
233
|
+
"validate_manifest",
|
|
234
|
+
"validate_manifest_or_throw",
|
|
235
|
+
"validate_target",
|
|
236
|
+
# sources
|
|
237
|
+
"ARCHIVE_SUFFIXES",
|
|
238
|
+
"CONVENTIONS",
|
|
239
|
+
"ArchiveError",
|
|
240
|
+
"GitSourceError",
|
|
241
|
+
"ReleaseError",
|
|
242
|
+
"ReleaseSpec",
|
|
243
|
+
"asset_download_url",
|
|
244
|
+
"canonical_source",
|
|
245
|
+
"codeload_url",
|
|
246
|
+
"default_branch",
|
|
247
|
+
"download_github",
|
|
248
|
+
"is_archive_path",
|
|
249
|
+
"known_names",
|
|
250
|
+
"list_tags",
|
|
251
|
+
"lookup",
|
|
252
|
+
"make_archive",
|
|
253
|
+
"resolve_tag",
|
|
254
|
+
"search",
|
|
255
|
+
"tags_have_version",
|
|
256
|
+
"unpack_archive",
|
|
257
|
+
# install
|
|
258
|
+
"REGISTRY_REL",
|
|
259
|
+
"SCHEMA_VERSION",
|
|
260
|
+
"InstallError",
|
|
261
|
+
"InstallOptions",
|
|
262
|
+
"InstallResult",
|
|
263
|
+
"InstalledFile",
|
|
264
|
+
"RegistryError",
|
|
265
|
+
"add_or_update_entry",
|
|
266
|
+
"default_scripts_root",
|
|
267
|
+
"discover_entrypoint",
|
|
268
|
+
"get_extension",
|
|
269
|
+
"install_package",
|
|
270
|
+
"install_project",
|
|
271
|
+
"read_registry",
|
|
272
|
+
"registry_path",
|
|
273
|
+
"remove_entry",
|
|
274
|
+
"resolve_scripts_root",
|
|
275
|
+
"select_files",
|
|
276
|
+
"target_dir",
|
|
277
|
+
"uninstall_package",
|
|
278
|
+
"write_registry",
|
|
279
|
+
# sandbox
|
|
280
|
+
"DEFAULT_PROJECT",
|
|
281
|
+
"FUSION_SCRIPT_MODULE",
|
|
282
|
+
"FakeClip",
|
|
283
|
+
"FakeComp",
|
|
284
|
+
"FakeFolder",
|
|
285
|
+
"FakeFusion",
|
|
286
|
+
"FakeKey",
|
|
287
|
+
"FakeMediaPool",
|
|
288
|
+
"FakeMediaPoolItem",
|
|
289
|
+
"FakeProject",
|
|
290
|
+
"FakeProjectManager",
|
|
291
|
+
"FakeResolve",
|
|
292
|
+
"FakeSpline",
|
|
293
|
+
"FakeStroke",
|
|
294
|
+
"FakeTimeline",
|
|
295
|
+
"FakeTool",
|
|
296
|
+
"SmokeCheck",
|
|
297
|
+
"SmokeResult",
|
|
298
|
+
"build_default_env",
|
|
299
|
+
"default_namespace",
|
|
300
|
+
"discover_exports",
|
|
301
|
+
"fake_resolve_module",
|
|
302
|
+
"install_fake_resolve",
|
|
303
|
+
"load_built_module",
|
|
304
|
+
"load_source_module",
|
|
305
|
+
"purge_module",
|
|
306
|
+
"run_smoke",
|
|
307
|
+
"start_repl",
|
|
308
|
+
# config
|
|
309
|
+
"allow_remote",
|
|
310
|
+
"is_editable_install",
|
|
311
|
+
"normalize_path",
|
|
312
|
+
"plugins_dir",
|
|
313
|
+
"python_spec",
|
|
314
|
+
"scripts_root_override",
|
|
315
|
+
"user_config_dir",
|
|
316
|
+
# spec / resolver
|
|
317
|
+
"ResolveError",
|
|
318
|
+
"Resolved",
|
|
319
|
+
"lockfile_satisfies",
|
|
320
|
+
"resolve_spec",
|
|
321
|
+
"SemVerError",
|
|
322
|
+
"Version",
|
|
323
|
+
"matches",
|
|
324
|
+
"pick_best",
|
|
325
|
+
"Spec",
|
|
326
|
+
"SpecError",
|
|
327
|
+
"parse_specifier",
|
|
328
|
+
"WORKSPACE_FILE",
|
|
329
|
+
"WorkspaceError",
|
|
330
|
+
"add_dependency",
|
|
331
|
+
"has_workspace",
|
|
332
|
+
"read_workspace",
|
|
333
|
+
"remove_dependency",
|
|
334
|
+
"save",
|
|
335
|
+
"workspace_path",
|
|
336
|
+
"write_workspace",
|
|
337
|
+
# pipeline
|
|
338
|
+
"KNOWN_ROOTS",
|
|
339
|
+
"Analysis",
|
|
340
|
+
"Issue",
|
|
341
|
+
"analyze_project",
|
|
342
|
+
"issues_to_json",
|
|
343
|
+
"BuildConfig",
|
|
344
|
+
"ConsolidateError",
|
|
345
|
+
"ConsolidateResult",
|
|
346
|
+
"config_from_manifest",
|
|
347
|
+
"consolidate",
|
|
348
|
+
"summarize",
|
|
349
|
+
"PackageError",
|
|
350
|
+
"PackageResult",
|
|
351
|
+
"package_project",
|
|
352
|
+
# scaffold
|
|
353
|
+
"DEFAULT_VERSION",
|
|
354
|
+
"TEMPLATES_DIR",
|
|
355
|
+
"ScaffoldError",
|
|
356
|
+
"build_values",
|
|
357
|
+
"normalize_name",
|
|
358
|
+
"render",
|
|
359
|
+
"scaffold_project",
|
|
360
|
+
# fetch
|
|
361
|
+
"Fetched",
|
|
362
|
+
"FetchError",
|
|
363
|
+
"fetch",
|
|
364
|
+
"fetch_json",
|
|
365
|
+
"sha256_file",
|
|
366
|
+
]
|
|
@@ -429,6 +429,7 @@ def _cmd_manage_remove(args: argparse.Namespace) -> int:
|
|
|
429
429
|
import shutil
|
|
430
430
|
|
|
431
431
|
from .install.discovery import target_dir
|
|
432
|
+
from .install.installer import InstallError, validate_registry_name, validate_registry_relpath
|
|
432
433
|
from .install.registry import get_extension, read_registry, remove_entry
|
|
433
434
|
|
|
434
435
|
scripts_root = _resolve_scripts_root(args.scripts_root)
|
|
@@ -441,17 +442,27 @@ def _cmd_manage_remove(args: argparse.Namespace) -> int:
|
|
|
441
442
|
)
|
|
442
443
|
return 1
|
|
443
444
|
as_directory = bool(entry.get("as_directory", True))
|
|
444
|
-
|
|
445
|
+
try:
|
|
446
|
+
key = validate_registry_name(entry.get("id") or args.name)
|
|
447
|
+
container_name = validate_registry_name(entry.get("name") or key)
|
|
448
|
+
except InstallError as exc:
|
|
449
|
+
print(f"resolvescript: manage remove: {exc}", file=sys.stderr)
|
|
450
|
+
return 1
|
|
445
451
|
for target in entry.get("targets", []):
|
|
446
452
|
base = target_dir(scripts_root, target)
|
|
447
453
|
if as_directory:
|
|
448
|
-
container = base /
|
|
454
|
+
container = base / container_name
|
|
449
455
|
if container.is_dir():
|
|
450
456
|
shutil.rmtree(container)
|
|
451
457
|
print(f"removed {container}")
|
|
452
458
|
else:
|
|
453
|
-
for
|
|
454
|
-
|
|
459
|
+
for raw_rel in entry.get("files", []):
|
|
460
|
+
try:
|
|
461
|
+
rel = validate_registry_relpath(str(raw_rel))
|
|
462
|
+
except InstallError as exc:
|
|
463
|
+
print(f"resolvescript: manage remove: {exc}", file=sys.stderr)
|
|
464
|
+
return 1
|
|
465
|
+
path = base / rel
|
|
455
466
|
if path.is_file() or (path.is_symlink() and not path.exists()):
|
|
456
467
|
path.unlink()
|
|
457
468
|
print(f"removed {path}")
|
|
@@ -495,8 +506,8 @@ def _cmd_test(args: argparse.Namespace) -> int:
|
|
|
495
506
|
env["RESOLVESCRIPT_BUILT_PATH"] = str(built_file)
|
|
496
507
|
runner = (
|
|
497
508
|
"import os, sys, pathlib\n"
|
|
498
|
-
"from
|
|
499
|
-
"from
|
|
509
|
+
"from ResolveScript.sandbox.env import install_fake_resolve\n"
|
|
510
|
+
"from ResolveScript.sandbox.loader import load_built_module\n"
|
|
500
511
|
"install_fake_resolve()\n"
|
|
501
512
|
"if os.environ.get('RESOLVESCRIPT_TARGET') == 'built':\n"
|
|
502
513
|
" name = os.environ['RESOLVESCRIPT_MODULE']\n"
|