dccex 0.1.1__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.
dccex-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,97 @@
1
+ Metadata-Version: 2.3
2
+ Name: dccex
3
+ Version: 0.1.1
4
+ Summary: Locate and run DCC applications
5
+ Author: Henrik Wilhelmsen
6
+ Author-email: Henrik Wilhelmsen <henrik@hwanimation.tech>
7
+ Requires-Dist: dccpath>=0.2.1
8
+ Requires-Python: >=3.14
9
+ Project-URL: Repository, https://git.hwanimation.tech/hwanimationtech/dccex
10
+ Description-Content-Type: text/markdown
11
+
12
+ # dccex
13
+
14
+ `dccex` locates installed Digital Content Creation (DCC) applications and runs
15
+ them with the arguments you provide.
16
+
17
+ Version-specific companion packages expose
18
+ commands such as `blender5` and `maya2026`, making it practical to select a DCC
19
+ version in shell scripts, CI, and project tooling.
20
+
21
+ See [the packages directory](./packages) for which versioned packages are available.
22
+
23
+ ## Command-line usage
24
+
25
+ ### uv tool
26
+
27
+ Install a version-specific package once to add its command to the `uv` tools
28
+ bin directory (make sure it is on your `PATH` with `uv tool update-shell`):
29
+
30
+ ```sh
31
+ uv tool install blenderex-5
32
+ blender5
33
+ ```
34
+
35
+ For example, install Maya 2026 and invoke its bundled Python interpreter:
36
+
37
+ ```sh
38
+ uv tool install mayaex-2026
39
+ mayapy2026 --version
40
+ ```
41
+
42
+ ### uvx
43
+
44
+ Use `uvx` when you do not want to keep the command installed. `--from` selects
45
+ the package while the final command is the generated DCC command:
46
+
47
+ ```sh
48
+ uvx --from blenderex-5 blender5
49
+ uvx --from mayaex-2026 mayapy2026 --version
50
+ ```
51
+
52
+ ### pixi
53
+
54
+ Run a version-specific command without adding it to a `pixi.toml` by supplying
55
+ the package as an execution specification:
56
+
57
+ ```sh
58
+ pixi exec --spec blenderex-5 blender5
59
+ pixi exec --spec mayaex-2026 mayapy2026 --version
60
+ ```
61
+
62
+ ## Library usage
63
+
64
+ Add the core package to a Python project, then call `call_dcc_exe` with the
65
+ executable name and required DCC version. It returns the launched process's
66
+ exit code, or `1` when the executable cannot be located.
67
+
68
+ ```sh
69
+ uv add dccex
70
+ ```
71
+
72
+ ```python
73
+ import sys
74
+
75
+ from dccex import call_dcc_exe
76
+
77
+ exit_code = call_dcc_exe(dcc_exe="blender", version="5", args=["--version"])
78
+ sys.exit(exit_code)
79
+ ```
80
+
81
+ The supported executable names are `"blender"`, `"maya"`, `"mayapy"`,
82
+ `"mobu"`, and `"mobupy"`.
83
+
84
+ ## Development
85
+
86
+ The version-specific packages are generated from `scripts/data/pkgs.json`:
87
+
88
+ ```sh
89
+ uv run scripts/gen_pkgs.py
90
+ ```
91
+
92
+ Do not edit files under `packages/` directly; update the templates or package
93
+ data and regenerate them instead.
94
+
95
+ ## License
96
+
97
+ `dccex` is licensed under the [Mozilla Public License 2.0](LICENSE).
dccex-0.1.1/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # dccex
2
+
3
+ `dccex` locates installed Digital Content Creation (DCC) applications and runs
4
+ them with the arguments you provide.
5
+
6
+ Version-specific companion packages expose
7
+ commands such as `blender5` and `maya2026`, making it practical to select a DCC
8
+ version in shell scripts, CI, and project tooling.
9
+
10
+ See [the packages directory](./packages) for which versioned packages are available.
11
+
12
+ ## Command-line usage
13
+
14
+ ### uv tool
15
+
16
+ Install a version-specific package once to add its command to the `uv` tools
17
+ bin directory (make sure it is on your `PATH` with `uv tool update-shell`):
18
+
19
+ ```sh
20
+ uv tool install blenderex-5
21
+ blender5
22
+ ```
23
+
24
+ For example, install Maya 2026 and invoke its bundled Python interpreter:
25
+
26
+ ```sh
27
+ uv tool install mayaex-2026
28
+ mayapy2026 --version
29
+ ```
30
+
31
+ ### uvx
32
+
33
+ Use `uvx` when you do not want to keep the command installed. `--from` selects
34
+ the package while the final command is the generated DCC command:
35
+
36
+ ```sh
37
+ uvx --from blenderex-5 blender5
38
+ uvx --from mayaex-2026 mayapy2026 --version
39
+ ```
40
+
41
+ ### pixi
42
+
43
+ Run a version-specific command without adding it to a `pixi.toml` by supplying
44
+ the package as an execution specification:
45
+
46
+ ```sh
47
+ pixi exec --spec blenderex-5 blender5
48
+ pixi exec --spec mayaex-2026 mayapy2026 --version
49
+ ```
50
+
51
+ ## Library usage
52
+
53
+ Add the core package to a Python project, then call `call_dcc_exe` with the
54
+ executable name and required DCC version. It returns the launched process's
55
+ exit code, or `1` when the executable cannot be located.
56
+
57
+ ```sh
58
+ uv add dccex
59
+ ```
60
+
61
+ ```python
62
+ import sys
63
+
64
+ from dccex import call_dcc_exe
65
+
66
+ exit_code = call_dcc_exe(dcc_exe="blender", version="5", args=["--version"])
67
+ sys.exit(exit_code)
68
+ ```
69
+
70
+ The supported executable names are `"blender"`, `"maya"`, `"mayapy"`,
71
+ `"mobu"`, and `"mobupy"`.
72
+
73
+ ## Development
74
+
75
+ The version-specific packages are generated from `scripts/data/pkgs.json`:
76
+
77
+ ```sh
78
+ uv run scripts/gen_pkgs.py
79
+ ```
80
+
81
+ Do not edit files under `packages/` directly; update the templates or package
82
+ data and regenerate them instead.
83
+
84
+ ## License
85
+
86
+ `dccex` is licensed under the [Mozilla Public License 2.0](LICENSE).
@@ -0,0 +1,27 @@
1
+ [project]
2
+ name = "dccex"
3
+ version = "0.1.1"
4
+ description = "Locate and run DCC applications"
5
+ readme = "README.md"
6
+ requires-python = ">=3.14"
7
+ dependencies = ["dccpath>=0.2.1"]
8
+
9
+ [[project.authors]]
10
+ name = "Henrik Wilhelmsen"
11
+ email = "henrik@hwanimation.tech"
12
+
13
+ [project.urls]
14
+ Repository = "https://git.hwanimation.tech/hwanimationtech/dccex"
15
+
16
+ [dependency-groups]
17
+ dev = [
18
+ "ruff>=0.16.1",
19
+ "ty>=0.0.65",
20
+ ]
21
+
22
+ [build-system]
23
+ requires = ["uv_build>=0.12.2,<0.13.0"]
24
+ build-backend = "uv_build"
25
+
26
+ [tool.uv.workspace]
27
+ members = ["packages/*"]
@@ -0,0 +1,28 @@
1
+ [project]
2
+ name = "dccex"
3
+ version = "0.1.1"
4
+ description = "Locate and run DCC applications"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Henrik Wilhelmsen", email = "henrik@hwanimation.tech" }
8
+ ]
9
+ requires-python = ">=3.14"
10
+ dependencies = [
11
+ "dccpath>=0.2.1",
12
+ ]
13
+
14
+ [project.urls]
15
+ Repository = "https://git.hwanimation.tech/hwanimationtech/dccex"
16
+
17
+ [dependency-groups]
18
+ dev = [
19
+ "ruff>=0.16.1",
20
+ "ty>=0.0.65",
21
+ ]
22
+
23
+ [build-system]
24
+ requires = ["uv_build>=0.12.2,<0.13.0"]
25
+ build-backend = "uv_build"
26
+
27
+ [tool.uv.workspace]
28
+ members = ["packages/*"]
@@ -0,0 +1,78 @@
1
+ # Copyright (C) 2026 Henrik Wilhelmsen.
2
+ #
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
6
+
7
+ """DCCEX - A package for finding and running DCC executables."""
8
+
9
+ import logging
10
+ import os
11
+ import subprocess
12
+ from typing import Literal
13
+
14
+ from dccpath import (
15
+ DCCPathError,
16
+ get_blender,
17
+ get_maya,
18
+ get_mayapy,
19
+ get_mobu,
20
+ get_mobupy,
21
+ )
22
+
23
+ logger = logging.getLogger(__name__)
24
+
25
+
26
+ SupportedDCCs = Literal["maya", "mayapy", "mobu", "mobupy", "blender"]
27
+
28
+
29
+ def call_dcc_exe(
30
+ dcc_exe: SupportedDCCs,
31
+ version: str,
32
+ args: list[str] | None = None,
33
+ ) -> int:
34
+ """Locate and call the given DCC executable for the given version.
35
+
36
+ Args:
37
+ dcc_exe: The DCC to call
38
+ version: The DCC version
39
+ args: Optional extra arguments to pass to the DCC
40
+
41
+ Returns:
42
+ The return code of the subprocess call to the executable, or 1 if an error
43
+ occurred during setup.
44
+ """
45
+ if args is None:
46
+ args = []
47
+
48
+ match dcc_exe:
49
+ case "maya":
50
+ search_fn = get_maya
51
+ case "mayapy":
52
+ search_fn = get_mayapy
53
+ case "mobu":
54
+ search_fn = get_mobu
55
+ case "mobupy":
56
+ search_fn = get_mobupy
57
+ case "blender":
58
+ search_fn = get_blender
59
+ case _:
60
+ logger.error("invalid DCC argument: %s", dcc_exe)
61
+ return 1
62
+
63
+ try:
64
+ executable = search_fn(version=version).resolve().as_posix()
65
+ except DCCPathError:
66
+ logger.exception(
67
+ "an error occurred when trying to get the %s executable",
68
+ dcc_exe,
69
+ )
70
+ return 1
71
+
72
+ logger.debug("running dcc executable: %s", executable)
73
+ return subprocess.call( # noqa: S603
74
+ [executable, *args],
75
+ env=os.environ,
76
+ encoding="utf-8",
77
+ text=True,
78
+ )