Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@contractkit/plugin-python

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contractkit/plugin-python - npm Package Compare versions

Comparing version
0.10.1
to
0.11.0
+6
-6
.turbo/turbo-build$colon$ci.log
> @contractkit/plugin-python@0.10.1 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-python
> @contractkit/plugin-python@0.11.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-python
> eslint --max-warnings=0 && pnpm run build
> @contractkit/plugin-python@0.10.1 build /home/runner/work/ContractKit/ContractKit/packages/plugin-python
> @contractkit/plugin-python@0.11.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-python
> tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration

@@ -14,7 +14,7 @@

ESM Build start
ESM dist/index.js 42.33 KB
ESM dist/index.js.map 89.19 KB
ESM ⚡️ Build success in 192ms
ESM dist/index.js 42.68 KB
ESM dist/index.js.map 90.20 KB
ESM ⚡️ Build success in 156ms
DTS Build start
DTS ⚡️ Build success in 3797ms
DTS ⚡️ Build success in 4501ms
DTS dist/index.d.ts 1.10 KB
> @contractkit/plugin-python@0.10.1 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-python
> @contractkit/plugin-python@0.11.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-python
> vitest run --coverage

@@ -9,9 +9,9 @@

✓ tests/codegen-client.test.ts (27 tests) 94ms
✓ tests/codegen-models.test.ts (32 tests) 116ms
✓ tests/codegen-models.test.ts (32 tests) 118ms
✓ tests/codegen-client.test.ts (27 tests) 107ms
 Test Files  2 passed (2)
 Tests  59 passed (59)
 Start at  11:16:36
 Duration  5.14s (transform 2.46s, setup 0ms, import 7.24s, tests 210ms, environment 0ms)
 Start at  11:38:17
 Duration  5.48s (transform 2.53s, setup 0ms, import 7.86s, tests 225ms, environment 0ms)

@@ -18,0 +18,0 @@  % Coverage report from v8

# @contractkit/contractkit-plugin-python
## 0.11.0
### Minor Changes
- 4ac6d4d: Move plugin incremental-build manifests under the CLI cache directory (default `.contractkit/cache/`, configurable via `config.cache.dir`). Bruno's `.contractkit-bruno-manifest.json` (in the bruno-collection dir), Python's `.contractkit-python-manifest.json` (in the python-sdk dir), and TypeScript's `.contractkit-typescript-manifest.json` (at rootDir) now all live as `bruno-manifest.json` / `python-manifest.json` / `typescript-manifest.json` under `ctx.cacheDir`, alongside the CLI's existing `build.json` and HTTP cache. Output dirs no longer contain build state.
`PluginContext` gains a `cacheDir: string` field. `runIncrementalCodegen` no longer takes a `manifestFilename` argument and no longer bundles the manifest into `filesToWrite` — the result's `manifest` is returned separately so plugins can persist it wherever they want. New helper `serializeIncrementalManifest(manifest)` produces the JSON form.
After upgrading, the old in-output manifests can be deleted manually (or with `--force`); plugins will simply do a full regen on the first run since they won't find a manifest at the new path.
### Patch Changes
- Updated dependencies [4ac6d4d]
- @contractkit/core@0.16.0
## 0.10.1

@@ -4,0 +19,0 @@

<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1778152601456" clover="3.2.0">
<project timestamp="1778152601456" name="All files">
<coverage generated="1778153903219" clover="3.2.0">
<project timestamp="1778153903219" name="All files">
<metrics statements="538" coveredstatements="456" conditionals="416" coveredconditionals="320" methods="91" coveredmethods="78" elements="1045" coveredelements="854" complexity="0" loc="538" ncloc="538" packages="2" files="3" classes="3"/>

@@ -5,0 +5,0 @@ <package name="src">

@@ -119,3 +119,3 @@

<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-05-07T11:16:41.420Z
at 2026-05-07T11:38:23.142Z
</div>

@@ -122,0 +122,0 @@ <script src="prettify.js"></script>

@@ -1348,3 +1348,3 @@

<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-05-07T11:16:41.420Z
at 2026-05-07T11:38:23.142Z
</div>

@@ -1351,0 +1351,0 @@ <script src="../prettify.js"></script>

@@ -119,3 +119,3 @@

<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-05-07T11:16:41.420Z
at 2026-05-07T11:38:23.142Z
</div>

@@ -122,0 +122,0 @@ <script src="../prettify.js"></script>

@@ -655,3 +655,3 @@

<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-05-07T11:16:41.420Z
at 2026-05-07T11:38:23.142Z
</div>

@@ -658,0 +658,0 @@ <script src="../prettify.js"></script>

@@ -104,3 +104,3 @@

<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-05-07T11:16:41.420Z
at 2026-05-07T11:38:23.142Z
</div>

@@ -107,0 +107,0 @@ <script src="../prettify.js"></script>

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,iBAAiB,EAOpB,MAAM,mBAAmB,CAAC;AAmB3B,MAAM,WAAW,qBAAqB;IAClC,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAI1C,QAAA,MAAM,MAAM,EAAE,iBAMb,CAAC;AAEF,eAAe,MAAM,CAAC;AAEtB,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAOvG"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,iBAAiB,EAOpB,MAAM,mBAAmB,CAAC;AAoB3B,MAAM,WAAW,qBAAqB;IAClC,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAK1C,QAAA,MAAM,MAAM,EAAE,iBAMb,CAAC;AAEF,eAAe,MAAM,CAAC;AAEtB,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAOvG"}

@@ -5,5 +5,5 @@ var __defProp = Object.defineProperty;

// src/index.ts
import { resolve, join, relative } from "path";
import { existsSync, readFileSync, rmSync, readdirSync, rmdirSync } from "fs";
import { runIncrementalCodegen, parseIncrementalManifest, emptyIncrementalManifest, hashFingerprint, collectTransitiveModelRefs, collectTypeRefs as collectTypeRefs2 } from "@contractkit/core";
import { resolve, join, relative, dirname } from "path";
import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync, readdirSync, rmdirSync } from "fs";
import { runIncrementalCodegen, parseIncrementalManifest, emptyIncrementalManifest, serializeIncrementalManifest, hashFingerprint, collectTransitiveModelRefs, collectTypeRefs as collectTypeRefs2 } from "@contractkit/core";

@@ -950,3 +950,3 @@ // src/codegen-models.ts

var PYTHON_CODEGEN_VERSION = "1";
var MANIFEST_FILENAME = ".contractkit-python-manifest.json";
var CACHE_MANIFEST_FILENAME = "python-manifest.json";
var plugin = {

@@ -973,2 +973,3 @@ name: "python-sdk",

const outDir = resolve(rootDir, config.baseDir ?? "python-sdk");
const manifestPath = resolve(ctx.cacheDir, CACHE_MANIFEST_FILENAME);
const modelModulePaths = /* @__PURE__ */ new Map();

@@ -995,3 +996,3 @@ const modelMap = /* @__PURE__ */ new Map();

].sort();
const prevManifest = ctx.cacheEnabled ? readManifest(outDir) : emptyIncrementalManifest(PYTHON_CODEGEN_VERSION);
const prevManifest = ctx.cacheEnabled ? readManifest(manifestPath) : emptyIncrementalManifest(PYTHON_CODEGEN_VERSION);
const units = [];

@@ -1129,3 +1130,2 @@ for (const { moduleName, relPath, root } of contractEntries) {

codegenVersion: PYTHON_CODEGEN_VERSION,
manifestFilename: MANIFEST_FILENAME,
prevManifest,

@@ -1140,2 +1140,3 @@ globalFiles,

}
writeManifest(manifestPath, result.manifest);
void relative;

@@ -1193,4 +1194,3 @@ }

__name(paramSourceTypes, "paramSourceTypes");
function readManifest(outDir) {
const manifestPath = resolve(outDir, MANIFEST_FILENAME);
function readManifest(manifestPath) {
if (!existsSync(manifestPath)) return emptyIncrementalManifest(PYTHON_CODEGEN_VERSION);

@@ -1204,2 +1204,12 @@ try {

__name(readManifest, "readManifest");
function writeManifest(manifestPath, manifest) {
try {
mkdirSync(dirname(manifestPath), {
recursive: true
});
writeFileSync(manifestPath, serializeIncrementalManifest(manifest), "utf-8");
} catch {
}
}
__name(writeManifest, "writeManifest");
function deleteStalePaths(outDir, relPaths) {

@@ -1206,0 +1216,0 @@ if (relPaths.length === 0) return;

{
"name": "@contractkit/plugin-python",
"version": "0.10.1",
"version": "0.11.0",
"description": "ContractKit built-in plugin: Python SDK client generation (Pydantic v2 + httpx)",

@@ -29,3 +29,3 @@ "author": {

"dependencies": {
"@contractkit/core": "0.15.1"
"@contractkit/core": "0.16.0"
},

@@ -35,4 +35,4 @@ "devDependencies": {

"vitest": "^4.1.5",
"@repo/config-eslint": "0.3.1",
"@repo/config-typescript": "0.1.0"
"@repo/config-typescript": "0.1.0",
"@repo/config-eslint": "0.3.1"
},

@@ -39,0 +39,0 @@ "scripts": {

@@ -1,3 +0,3 @@

import { resolve, join, relative } from 'node:path';
import { existsSync, readFileSync, rmSync, readdirSync, rmdirSync } from 'node:fs';
import { resolve, join, relative, dirname } from 'node:path';
import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync, readdirSync, rmdirSync } from 'node:fs';
import type {

@@ -16,2 +16,3 @@ ContractKitPlugin,

emptyIncrementalManifest,
serializeIncrementalManifest,
hashFingerprint,

@@ -52,3 +53,4 @@ collectTransitiveModelRefs,

const MANIFEST_FILENAME = '.contractkit-python-manifest.json';
/** Filename for the persisted Python manifest under the CLI cache directory. */
const CACHE_MANIFEST_FILENAME = 'python-manifest.json';

@@ -90,2 +92,3 @@ const plugin: ContractKitPlugin = {

const outDir = resolve(rootDir, config.baseDir ?? 'python-sdk');
const manifestPath = resolve(ctx.cacheDir, CACHE_MANIFEST_FILENAME);

@@ -113,3 +116,3 @@ // ── Build cross-file lookup tables ───────────────────────────────────────

const prevManifest: IncrementalManifest = ctx.cacheEnabled ? readManifest(outDir) : emptyIncrementalManifest(PYTHON_CODEGEN_VERSION);
const prevManifest: IncrementalManifest = ctx.cacheEnabled ? readManifest(manifestPath) : emptyIncrementalManifest(PYTHON_CODEGEN_VERSION);
const units: IncrementalUnit[] = [];

@@ -254,3 +257,2 @@

codegenVersion: PYTHON_CODEGEN_VERSION,
manifestFilename: MANIFEST_FILENAME,
prevManifest,

@@ -267,2 +269,4 @@ globalFiles,

}
writeManifest(manifestPath, result.manifest);
// Suppress unused import warning — `relative` is reserved for future use.

@@ -320,5 +324,4 @@ void relative;

/** Read the previous run's manifest. Returns an empty manifest when missing or unreadable. */
function readManifest(outDir: string): IncrementalManifest {
const manifestPath = resolve(outDir, MANIFEST_FILENAME);
/** Read the previous run's manifest from `manifestPath`. Returns an empty manifest when missing or unreadable. */
function readManifest(manifestPath: string): IncrementalManifest {
if (!existsSync(manifestPath)) return emptyIncrementalManifest(PYTHON_CODEGEN_VERSION);

@@ -332,2 +335,12 @@ try {

/** Write the manifest to `manifestPath`. Creates parent dirs as needed. Errors are swallowed so a broken cache never blocks the build. */
function writeManifest(manifestPath: string, manifest: IncrementalManifest): void {
try {
mkdirSync(dirname(manifestPath), { recursive: true });
writeFileSync(manifestPath, serializeIncrementalManifest(manifest), 'utf-8');
} catch {
// best-effort
}
}
/** Delete paths from the prior manifest that aren't produced this run. Mirrors the Bruno cleanup approach. */

@@ -334,0 +347,0 @@ function deleteStalePaths(outDir: string, relPaths: string[]): void {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display