codeanalyzer-typescript 0.1.0__py3-none-macosx_10_12_x86_64.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.
- codeanalyzer_typescript/__init__.py +52 -0
- codeanalyzer_typescript/_bin/.gitignore +5 -0
- codeanalyzer_typescript/_bin/codeanalyzer-typescript +0 -0
- codeanalyzer_typescript-0.1.0.dist-info/METADATA +76 -0
- codeanalyzer_typescript-0.1.0.dist-info/RECORD +6 -0
- codeanalyzer_typescript-0.1.0.dist-info/WHEEL +5 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""Prebuilt ``codeanalyzer-typescript`` backend binary for CLDK.
|
|
2
|
+
|
|
3
|
+
This package carries the platform-specific, self-contained ``codeanalyzer-typescript``
|
|
4
|
+
executable (built from this repo with ``bun build --compile``) and exposes its
|
|
5
|
+
filesystem path. CLDK's Python SDK depends on this package and calls
|
|
6
|
+
:func:`bin_path` to locate the analyzer, exactly as it imports ``codeanalyzer-python``
|
|
7
|
+
for the Python backend.
|
|
8
|
+
|
|
9
|
+
Each published wheel is platform-tagged and contains the single binary for that
|
|
10
|
+
platform; pip resolves the correct wheel at install time.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import os
|
|
16
|
+
import stat
|
|
17
|
+
import sys
|
|
18
|
+
from importlib import resources
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
|
|
21
|
+
__version__ = "0.1.0"
|
|
22
|
+
|
|
23
|
+
__all__ = ["bin_path", "__version__"]
|
|
24
|
+
|
|
25
|
+
_BINARY_NAME = "codeanalyzer-typescript" + (".exe" if sys.platform == "win32" else "")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def bin_path() -> Path:
|
|
29
|
+
"""Return the absolute path to the bundled ``codeanalyzer-typescript`` binary.
|
|
30
|
+
|
|
31
|
+
Raises:
|
|
32
|
+
FileNotFoundError: if the wheel for this platform did not include a binary
|
|
33
|
+
(e.g. an unsupported platform, or a source/dev install with no build run).
|
|
34
|
+
"""
|
|
35
|
+
resource = resources.files("codeanalyzer_typescript") / "_bin" / _BINARY_NAME
|
|
36
|
+
with resources.as_file(resource) as extracted:
|
|
37
|
+
path = Path(extracted)
|
|
38
|
+
|
|
39
|
+
if not path.exists():
|
|
40
|
+
raise FileNotFoundError(
|
|
41
|
+
f"Bundled codeanalyzer-typescript binary not found at {path}. "
|
|
42
|
+
"This usually means there is no prebuilt wheel for your platform; "
|
|
43
|
+
"build the binary with `bun build --compile` and point CLDK at it via "
|
|
44
|
+
"analysis_backend_path or $CODEANALYZER_TS_BIN."
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
# Wheels may not preserve the executable bit on POSIX; restore it best-effort.
|
|
48
|
+
if os.name == "posix":
|
|
49
|
+
mode = path.stat().st_mode
|
|
50
|
+
path.chmod(mode | stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
|
|
51
|
+
|
|
52
|
+
return path
|
|
Binary file
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codeanalyzer-typescript
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Prebuilt codeanalyzer-typescript backend binary for CLDK (codellm-devkit).
|
|
5
|
+
Project-URL: Homepage, https://codellm-devkit.info
|
|
6
|
+
Project-URL: Repository, https://github.com/codellm-devkit/codeanalyzer-ts
|
|
7
|
+
Author-email: Rahul Krishna <i.m.ralk@gmail.com>
|
|
8
|
+
License: Apache-2.0
|
|
9
|
+
Keywords: cldk,code analysis,codellm-devkit,typescript
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# codeanalyzer-typescript (Python distribution)
|
|
18
|
+
|
|
19
|
+
This directory packages the compiled `codeanalyzer-typescript` binary as a set of
|
|
20
|
+
platform-specific Python wheels, published to PyPI as **`codeanalyzer-typescript`**.
|
|
21
|
+
|
|
22
|
+
The CLDK Python SDK depends on this package and calls `codeanalyzer_typescript.bin_path()`
|
|
23
|
+
to locate the analyzer binary — the same way it imports `codeanalyzer-python` for the
|
|
24
|
+
Python backend. The binary itself is built from this repo's `src/` with
|
|
25
|
+
`bun build --compile`, so it is fully self-contained (no Node/Bun needed at runtime).
|
|
26
|
+
|
|
27
|
+
## Why platform wheels?
|
|
28
|
+
|
|
29
|
+
Unlike the Java backend (one cross-platform `.jar`), a `bun --compile` binary is
|
|
30
|
+
platform-specific and large (~70 MB). So we ship **one wheel per OS/arch**, tagged
|
|
31
|
+
`py3-none-<platform>` (the binary is Python-agnostic — no per-Python-version matrix),
|
|
32
|
+
and let pip resolve the correct one at install time. There is intentionally no usable
|
|
33
|
+
sdist: the binary cannot be built without Bun.
|
|
34
|
+
|
|
35
|
+
## Building & publishing
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
python -m pip install build wheel hatchling twine
|
|
39
|
+
./build_wheels.sh # cross-compiles every target via Bun, emits ./dist/*.whl
|
|
40
|
+
twine upload dist/*.whl
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`build_wheels.sh` loops over the Bun targets, compiles each binary into
|
|
44
|
+
`src/codeanalyzer_typescript/_bin/`, builds a pure wheel, and retags it to the platform.
|
|
45
|
+
Bun cross-compiles all targets from a single host, so this does not need a CI runner
|
|
46
|
+
matrix.
|
|
47
|
+
|
|
48
|
+
## Versioning
|
|
49
|
+
|
|
50
|
+
The released version comes from the **git tag**. A push of `vX.Y.Z` triggers the
|
|
51
|
+
release workflow, which derives `X.Y.Z` from the tag, verifies it matches this
|
|
52
|
+
repo's `package.json` `version` (failing fast on mismatch), and stamps it into
|
|
53
|
+
`__init__.py` via `$PKG_VERSION` — hatch reads `__version__` as the wheel version
|
|
54
|
+
(`pyproject.toml` declares `dynamic = ["version"]`). So the GitHub Release tag, the
|
|
55
|
+
PyPI wheel version, and the npm `package.json` version are always in lockstep.
|
|
56
|
+
|
|
57
|
+
To cut a release: bump `package.json` `version`, then push the matching tag, e.g.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm version 0.2.0 --no-git-tag-version # or edit package.json
|
|
61
|
+
git commit -am "Release v0.2.0" && git tag v0.2.0 && git push --tags
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
For a **local** wheel build, override the fallback version explicitly:
|
|
65
|
+
`PKG_VERSION=0.2.0 ./build_wheels.sh`.
|
|
66
|
+
|
|
67
|
+
One thing still tracked by hand: the python-sdk pin — `[tool.backend-versions]
|
|
68
|
+
codeanalyzer-typescript` and the `dependencies` entry
|
|
69
|
+
`codeanalyzer-typescript==<version>` — must be bumped to consume a new release.
|
|
70
|
+
|
|
71
|
+
## SDK integration
|
|
72
|
+
|
|
73
|
+
In the python-sdk, `TSCodeanalyzer._get_codeanalyzer_exec()` resolves the binary in
|
|
74
|
+
this order: `analysis_backend_path` → `$CODEANALYZER_TS_BIN` → **this package** →
|
|
75
|
+
in-tree bundled `bin/`. Adding `codeanalyzer-typescript` to the SDK's `dependencies`
|
|
76
|
+
makes the binary available automatically on install.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
codeanalyzer_typescript/__init__.py,sha256=f2JzA_PPc4SU59_EDbYC1YktWFtEWnEwGuj_8ovQypY,1900
|
|
2
|
+
codeanalyzer_typescript/_bin/.gitignore,sha256=_mZ_61eDWQ65V05VrmLP33rSeppQmwCwV8_qsgHUOHM,251
|
|
3
|
+
codeanalyzer_typescript/_bin/codeanalyzer-typescript,sha256=XM4QAD0h_50LTHZzoOeuozdcFGasck94jdopJm_LY5k,82182224
|
|
4
|
+
codeanalyzer_typescript-0.1.0.dist-info/METADATA,sha256=MzNfbhKNfb4KV85v8PGqbqauwA81aP5Emd4J_FUKL2w,3477
|
|
5
|
+
codeanalyzer_typescript-0.1.0.dist-info/WHEEL,sha256=SJq-BPVeMh94RRAzlvEIJBbA0stBAC0qkxOhcE8kbKA,104
|
|
6
|
+
codeanalyzer_typescript-0.1.0.dist-info/RECORD,,
|