xqo-toolchains 3.1.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dudikkocak
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,49 @@
1
+ Metadata-Version: 2.4
2
+ Name: xqo-toolchains
3
+ Version: 3.1.0
4
+ Summary: Node, Go, Rust and .NET setup for xqo run_code
5
+ Author: dudikkocak
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/dudikkocak/xqo
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: xqo<4,>=3.0
12
+ Provides-Extra: dev
13
+ Requires-Dist: pytest>=8; extra == "dev"
14
+ Requires-Dist: pytest-timeout>=2.3; extra == "dev"
15
+ Dynamic: license-file
16
+
17
+ # xqo-toolchains
18
+
19
+ Node (including Nuxt and Next), Go, Rust and .NET for [xqo](https://github.com/dudikkocak/xqo)'s `run_code`, next to
20
+ the Python venv the base package already makes.
21
+
22
+ ```bash
23
+ pip install xqo-toolchains
24
+ ```
25
+
26
+ Before each run it:
27
+
28
+ - **splits the workspace into components**: folders with `package.json`, `go.mod`, `Cargo.toml` or `*.sln`/`*.csproj`,
29
+ so a Go service with a Nuxt app in `web/` is two components;
30
+ - **picks versions** from `.nvmrc`, `.node-version`, `package.json` engines, `go.mod`, `global.json`,
31
+ `rust-toolchain.toml`, `.tool-versions` and `mise.toml`. With `mise` on PATH they are installed once and shared;
32
+ without it the host's toolchains are used and a mismatch is reported;
33
+ - **installs dependencies** only when a manifest or lockfile changed: `npm ci` / `pnpm` / `yarn` / `bun`,
34
+ `go mod download`, `cargo fetch`, `dotnet restore`. Download caches are shared by all tasks, build outputs belong
35
+ to the task.
36
+
37
+ With [xqo-docker](https://pypi.org/project/xqo-docker/) installed, runs use each project's official image at the
38
+ version it asks for (`node:<v>-bookworm`, `golang:<v>-bookworm`, `rust:<channel>-bookworm`,
39
+ `mcr.microsoft.com/dotnet/sdk:<v>`), and a mixed project gets a composite image built once.
40
+
41
+ | `sandbox` key | Default | |
42
+ |---|---|---|
43
+ | `toolchains` | `true` | `false` turns the setup off for this HQ |
44
+ | `versions` | `auto` | `auto` (mise if installed, else the host's), `mise` or `host` |
45
+ | `cache_dir` | `~/.cache/xqo/toolchains` | shared download caches (or `XQO_CACHE_DIR`) |
46
+ | `node_modules` | `auto` | `auto` (link; a real copy for Next), `link` or `clone` |
47
+ | `images` | | per-toolchain image overrides for the docker backend, e.g. `{"node": "node:20-bookworm"}` |
48
+
49
+ The local backend is not a security boundary: commands run as xqo's user, with network. Use xqo-docker for isolation.
@@ -0,0 +1,33 @@
1
+ # xqo-toolchains
2
+
3
+ Node (including Nuxt and Next), Go, Rust and .NET for [xqo](https://github.com/dudikkocak/xqo)'s `run_code`, next to
4
+ the Python venv the base package already makes.
5
+
6
+ ```bash
7
+ pip install xqo-toolchains
8
+ ```
9
+
10
+ Before each run it:
11
+
12
+ - **splits the workspace into components**: folders with `package.json`, `go.mod`, `Cargo.toml` or `*.sln`/`*.csproj`,
13
+ so a Go service with a Nuxt app in `web/` is two components;
14
+ - **picks versions** from `.nvmrc`, `.node-version`, `package.json` engines, `go.mod`, `global.json`,
15
+ `rust-toolchain.toml`, `.tool-versions` and `mise.toml`. With `mise` on PATH they are installed once and shared;
16
+ without it the host's toolchains are used and a mismatch is reported;
17
+ - **installs dependencies** only when a manifest or lockfile changed: `npm ci` / `pnpm` / `yarn` / `bun`,
18
+ `go mod download`, `cargo fetch`, `dotnet restore`. Download caches are shared by all tasks, build outputs belong
19
+ to the task.
20
+
21
+ With [xqo-docker](https://pypi.org/project/xqo-docker/) installed, runs use each project's official image at the
22
+ version it asks for (`node:<v>-bookworm`, `golang:<v>-bookworm`, `rust:<channel>-bookworm`,
23
+ `mcr.microsoft.com/dotnet/sdk:<v>`), and a mixed project gets a composite image built once.
24
+
25
+ | `sandbox` key | Default | |
26
+ |---|---|---|
27
+ | `toolchains` | `true` | `false` turns the setup off for this HQ |
28
+ | `versions` | `auto` | `auto` (mise if installed, else the host's), `mise` or `host` |
29
+ | `cache_dir` | `~/.cache/xqo/toolchains` | shared download caches (or `XQO_CACHE_DIR`) |
30
+ | `node_modules` | `auto` | `auto` (link; a real copy for Next), `link` or `clone` |
31
+ | `images` | | per-toolchain image overrides for the docker backend, e.g. `{"node": "node:20-bookworm"}` |
32
+
33
+ The local backend is not a security boundary: commands run as xqo's user, with network. Use xqo-docker for isolation.
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "xqo-toolchains"
7
+ version = "3.1.0"
8
+ description = "Node, Go, Rust and .NET setup for xqo run_code"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ authors = [{name = "dudikkocak"}]
13
+ dependencies = [
14
+ "xqo>=3.0,<4",
15
+ ]
16
+
17
+ [project.optional-dependencies]
18
+ dev = ["pytest>=8", "pytest-timeout>=2.3"]
19
+
20
+ [project.urls]
21
+ Homepage = "https://github.com/dudikkocak/xqo"
22
+
23
+ [project.entry-points."xqo.plugins"]
24
+ toolchains = "xqo_toolchains:ToolchainsPlugin"
25
+
26
+ [tool.setuptools.packages.find]
27
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,32 @@
1
+ """xqo-toolchains: Node (incl. Nuxt/Next), Go, Rust and .NET for run_code, next to Python's uv venv (core).
2
+
3
+ It installs itself into the sandbox (`xqo.api.use_toolchains`): component detection, versions through mise,
4
+ dependency setup with digest stamps and shared download caches, for the local backend and (with xqo-docker)
5
+ toolchain images. Without it (or with `"plugins": {"disable": ["toolchains"]}`) runs still work: Python projects get
6
+ their venv, other projects run with whatever is on the host's PATH and no setup step. Per HQ it can also be switched
7
+ off with `"sandbox": {"toolchains": false}`. The details are in chains.py."""
8
+ from __future__ import annotations
9
+
10
+ import shutil
11
+
12
+ from xqo.api import Plugin, use_toolchains
13
+
14
+ __version__ = "3.1.0"
15
+
16
+
17
+ class ToolchainsPlugin(Plugin):
18
+ name = "toolchains"
19
+ description = "Node / Go / Rust / .NET setup for run_code"
20
+
21
+ @classmethod
22
+ def register(cls) -> None:
23
+ from . import chains
24
+ use_toolchains(chains)
25
+
26
+ def configure(self, ctx, cfg):
27
+ from . import chains
28
+ on = (cfg.get("sandbox") or {}).get("toolchains", True)
29
+ return {"kinds": [k for k in chains.KINDS if k != "python"], "enabled": bool(on)}
30
+
31
+ def status(self) -> dict:
32
+ return {**self.obj, "mise": bool(shutil.which("mise"))}