supercov 0.0.29 → 0.0.31

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.
package/README.md CHANGED
@@ -38,6 +38,8 @@ npx supercov -- npx playwright test
38
38
  npx supercov -- pnpm test:e2e
39
39
  npx supercov -- cargo test
40
40
  npx supercov -- cargo nextest run
41
+ npx supercov -- pytest
42
+ npx supercov -- python -m unittest
41
43
  ```
42
44
 
43
45
  ## Give Supercov a job
@@ -106,12 +108,12 @@ The denominator comes from source structure before the run, so adding or removin
106
108
  | JavaScript | Available | `npx supercov -- npm test` |
107
109
  | TypeScript | Available | `npx supercov -- npm test` |
108
110
  | Rust | Available | `npx supercov -- cargo test` |
109
- | Python | Coming soon | |
111
+ | Python | Available | `npx supercov -- pytest` |
110
112
  | Zig | Coming soon | — |
111
113
  | PHP | Coming soon | — |
112
114
  | C | Coming soon | — |
113
115
 
114
- Supercov requires Node.js 22 or newer. Rust support currently uses Rust 1.95; cargo-nextest 0.9.138 and 0.9.140 are supported.
116
+ Supercov requires Node.js 22 or newer. Rust support currently uses Rust 1.95; cargo-nextest 0.9.138 and 0.9.140 are supported. Python support requires CPython 3.12 or newer and measures pytest and unittest runs.
115
117
 
116
118
  ## Supported test suites
117
119
 
@@ -9,7 +9,7 @@ npx supercov -- npm test
9
9
  ```
10
10
 
11
11
  No account, config file, import, custom reporter, or hosted service is required.
12
- Supercov supports JavaScript, TypeScript, and Rust today.
12
+ Supercov supports JavaScript, TypeScript, Rust, and Python today.
13
13
 
14
14
  ## Before you start
15
15
 
@@ -17,7 +17,8 @@ You need:
17
17
 
18
18
  - Node.js 22 or newer;
19
19
  - a test command that already works in the repository; and
20
- - for Rust, the Rust 1.95 toolchain.
20
+ - for Rust, the Rust 1.95 toolchain;
21
+ - for Python, CPython 3.12 or newer with pytest or unittest.
21
22
 
22
23
  The CLI is distributed through npm, even for Rust projects. The first `npx`
23
24
  invocation may download Supercov from the npm registry. Supercov itself does not
@@ -37,6 +38,9 @@ npx supercov -- pnpm test:e2e
37
38
  # Rust
38
39
  npx supercov -- cargo test
39
40
  npx supercov -- cargo nextest run
41
+
42
+ # Python
43
+ npx supercov -- pytest
40
44
  ```
41
45
 
42
46
  Supercov runs that command in an isolated, instrumented copy of the project.
@@ -1,13 +1,14 @@
1
1
  # Supported languages and test suites
2
2
 
3
- Supercov supports JavaScript, TypeScript, and Rust today. Start with the same
4
- test command the repository already uses; Supercov detects supported runners
5
- inside that command.
3
+ Supercov supports JavaScript, TypeScript, Rust, and Python today. Start with
4
+ the same test command the repository already uses; Supercov detects supported
5
+ runners inside that command.
6
6
 
7
7
  ```sh
8
8
  npx supercov -- npm test
9
9
  npx supercov -- npx playwright test
10
10
  npx supercov -- cargo test
11
+ npx supercov -- pytest
11
12
  ```
12
13
 
13
14
  ## Language support
@@ -17,7 +18,7 @@ npx supercov -- cargo test
17
18
  | JavaScript | Available | `npx supercov -- npm test` |
18
19
  | TypeScript | Available | `npx supercov -- npm test` |
19
20
  | Rust | Available | `npx supercov -- cargo test` |
20
- | Python | Coming soon | |
21
+ | Python | Available | `npx supercov -- pytest` |
21
22
  | Zig | Coming soon | — |
22
23
  | PHP | Coming soon | — |
23
24
  | C | Coming soon | — |
@@ -91,6 +92,43 @@ npx supercov -- cargo nextest run --workspace
91
92
  explanation instead of silently falling back to plausible but inaccurate
92
93
  attribution.
93
94
 
95
+ ## Python
96
+
97
+ | Runner | Attribution | Current requirement |
98
+ | --- | --- | --- |
99
+ | pytest | Exact test, worker, retry, and setup/call/teardown phase identity | CPython 3.12 or newer; run with `npx supercov -- pytest` or `python -m pytest` |
100
+ | pytest-xdist | Exact per worker | Workers inherit the run through the environment |
101
+ | pytest-rerunfailures | Exact per attempt; flaky tests are reported as such | |
102
+ | `python -m unittest` | Exact test and setUp/test/tearDown phase identity | Serial in-process; skips and expected failures are recorded; subtest failures roll up to the parent test |
103
+
104
+ Supercov measures Python through CPython's own monitoring interface. Nothing is
105
+ copied, rewritten, or compiled differently: the project runs in place with its
106
+ own interpreter and virtual environment, and Supercov only adds a start-up hook
107
+ through `PYTHONPATH`, a pytest plugin through `PYTEST_PLUGINS`, and a few
108
+ `SUPERCOV_*` variables. Child interpreters started with `subprocess` or
109
+ `multiprocessing` inherit the exact test identity; threads and thread pools
110
+ carry it through `contextvars`.
111
+
112
+ Each interpreter writes commit-framed evidence to a process-owned mmap. A hard
113
+ kill preserves completed observations and an incomplete tail is ignored; an
114
+ exhausted transport or corrupt committed frame fails the run closed.
115
+
116
+ Measured obligations are statements (including several on one line), function
117
+ entry, boolean decisions with MC/DC vectors, `for` and comprehension iteration,
118
+ `and`/`or` short-circuiting, `match` case selection, and `try` completion,
119
+ handler selection and exception propagation, all derived from CPython's own
120
+ instruction positions rather than from exception hooks.
121
+
122
+ Interpreters launched with `-I`, `-E`, or `-S` ignore `PYTHONPATH` and are not
123
+ measured. Code compiled from strings at runtime has no source obligations.
124
+
125
+ ```sh
126
+ npx supercov -- pytest
127
+ npx supercov -- python -m pytest -n 4
128
+ npx supercov -- uv run pytest
129
+ npx supercov -- python -m unittest
130
+ ```
131
+
94
132
  ## Containers, VMs, and remote execution
95
133
 
96
134
  Supercov can collect from supported processes launched through a container, VM,
@@ -32,7 +32,9 @@ synced back to the project after the run, so `supercov -- npm test -- -u`
32
32
  updates snapshots in the repository exactly as `npm test -- -u` would. Two
33
33
  exceptions are reported instead of applied: changes the command makes to
34
34
  instrumented source files (the instrumented copies must never overwrite your
35
- sources) and deletions (never propagated automatically).
35
+ sources) and deletions (never propagated automatically). Changes inside any
36
+ `node_modules` directory are neither applied nor reported: dependency trees are
37
+ not command outputs.
36
38
 
37
39
  ## Files Supercov creates
38
40
 
@@ -88,6 +90,15 @@ When a suite launches a container or VM from a mounted workspace, Supercov uses
88
90
  the isolated workspace as the source presented to that environment. The runtime
89
91
  must be able to cross the launch boundary and return evidence.
90
92
 
93
+ Dependencies stay out of the instrumented copy. The root `node_modules` is
94
+ linked entry by entry to the project's own, so an environment that mounts the
95
+ workspace must bring its own root dependencies (the supported launchers do).
96
+ Nested `node_modules` inside packages and extensions are materialised as real
97
+ directories: cloned copy-on-write where the filesystem allows it (APFS), and
98
+ hard-linked file by file elsewhere on Unix, so they resolve inside the mount
99
+ either way. Only when neither is possible, such as a dependency tree on another
100
+ volume, are they linked entry by entry like the root.
101
+
91
102
  If a remote executor hides the launch or mount boundary, Supercov reports the
92
103
  limitation instead of claiming unseen code was measured. See
93
104
  [Supported suites](supported-suites.md) for the current boundary.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "supercov",
3
- "version": "0.0.29",
4
- "description": "Zero-edit, runner-aware coverage completeness for JavaScript test suites",
3
+ "version": "0.0.31",
4
+ "description": "Zero-edit, runner-aware coverage completeness for JavaScript, TypeScript, Rust, and Python test suites",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -62,18 +62,20 @@
62
62
  "test:clang-mcdc": "node scripts/clang-mcdc-oracle.mjs",
63
63
  "test:test262": "cargo build --release -p supercov && node scripts/test262-equivalence.mjs",
64
64
  "benchmark:check": "cargo build --release -p supercov && node scripts/rust-transform-benchmark.mjs",
65
+ "benchmark:python-monitoring": "cargo build -p supercov && node scripts/python-monitoring-benchmark.mjs",
65
66
  "check": "cargo fmt --all -- --check && cargo clippy --workspace --all-targets -- -D warnings && npm run test && npm run test:runtime && npm run test:rust-assets && node scripts/package-preflight.mjs",
66
- "release:check": "npm run check && npm run test:engine && npm run test:fixture && npm run test:watchdog && npm run test:engine-contract && npm run test:agent && npm run test:packed-npx && npm run test:clang-mcdc && npm run benchmark:check",
67
+ "release:check": "npm run check && npm run test:engine && npm run test:fixture && npm run test:watchdog && npm run test:engine-contract && npm run test:agent && npm run test:python-monitoring && npm run test:packed-npx && npm run test:clang-mcdc && npm run benchmark:check",
67
68
  "prepack": "node scripts/package-preflight.mjs",
68
- "prepublishOnly": "npm run release:check"
69
+ "prepublishOnly": "npm run release:check",
70
+ "test:python-monitoring": "cargo build -p supercov && node scripts/python-monitoring-integration.mjs"
69
71
  },
70
72
  "optionalDependencies": {
71
- "@supercov/cli-darwin-arm64": "0.0.29",
72
- "@supercov/cli-darwin-x64": "0.0.29",
73
- "@supercov/cli-linux-arm64-gnu": "0.0.29",
74
- "@supercov/cli-linux-arm64-musl": "0.0.29",
75
- "@supercov/cli-linux-x64-gnu": "0.0.29",
76
- "@supercov/cli-linux-x64-musl": "0.0.29"
73
+ "@supercov/cli-darwin-arm64": "0.0.31",
74
+ "@supercov/cli-darwin-x64": "0.0.31",
75
+ "@supercov/cli-linux-arm64-gnu": "0.0.31",
76
+ "@supercov/cli-linux-arm64-musl": "0.0.31",
77
+ "@supercov/cli-linux-x64-gnu": "0.0.31",
78
+ "@supercov/cli-linux-x64-musl": "0.0.31"
77
79
  },
78
80
  "peerDependencies": {
79
81
  "@playwright/test": ">=1.55.0",