chtypes 0.3.0__tar.gz → 0.3.2__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.
Files changed (43) hide show
  1. {chtypes-0.3.0 → chtypes-0.3.2}/CHANGELOG.md +27 -0
  2. {chtypes-0.3.0 → chtypes-0.3.2}/PKG-INFO +2 -2
  3. {chtypes-0.3.0 → chtypes-0.3.2}/README.md +1 -1
  4. {chtypes-0.3.0 → chtypes-0.3.2}/pyproject.toml +1 -1
  5. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/__main__.py +13 -1
  6. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/_manifest.py +9 -4
  7. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/fetch.py +278 -75
  8. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/registry.py +8 -9
  9. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/results.py +2 -2
  10. {chtypes-0.3.0 → chtypes-0.3.2}/tests/conftest.py +44 -2
  11. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_cli.py +36 -4
  12. chtypes-0.3.2/tests/test_csv_reader.py +445 -0
  13. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_errors.py +1 -1
  14. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_fetch.py +270 -6
  15. chtypes-0.3.2/tests/test_fetch_abi_revision.py +248 -0
  16. chtypes-0.3.2/tests/test_fetch_sh.py +139 -0
  17. chtypes-0.3.2/tests/test_formats_withnames.py +458 -0
  18. chtypes-0.3.2/tests/test_golden.py +262 -0
  19. chtypes-0.3.2/tests/test_quoting_boundaries.py +235 -0
  20. chtypes-0.3.2/uv.lock +108 -0
  21. chtypes-0.3.0/tests/test_golden.py +0 -153
  22. chtypes-0.3.0/uv.lock +0 -108
  23. {chtypes-0.3.0 → chtypes-0.3.2}/.gitignore +0 -0
  24. {chtypes-0.3.0 → chtypes-0.3.2}/LICENSE +0 -0
  25. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/__init__.py +0 -0
  26. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/_document.py +0 -0
  27. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/_ed25519.py +0 -0
  28. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/_native.py +0 -0
  29. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/_rawjson.py +0 -0
  30. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/discover.py +0 -0
  31. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/errors.py +0 -0
  32. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/py.typed +0 -0
  33. {chtypes-0.3.0 → chtypes-0.3.2}/src/chtypes/transform.py +0 -0
  34. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_abi_revision.py +0 -0
  35. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_discover_reconstruct.py +0 -0
  36. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_ed25519.py +0 -0
  37. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_lazy.py +0 -0
  38. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_parity.py +0 -0
  39. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_rawjson.py +0 -0
  40. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_registry.py +0 -0
  41. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_results_rules.py +0 -0
  42. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_rows_export_with.py +0 -0
  43. {chtypes-0.3.0 → chtypes-0.3.2}/tests/test_transform.py +0 -0
@@ -4,6 +4,33 @@ All notable changes to the python binding. The format is [Keep a Changelog](http
4
4
 
5
5
  The four bindings in this repository are released together and give one answer, so an entry here has a counterpart in the other three.
6
6
 
7
+ ## [Unreleased]
8
+
9
+ ## [0.3.2] — 2026-09-28
10
+
11
+ Speaks ABI revision 5, unchanged from 0.3.1: every artifact 0.3.1 loads, this release loads.
12
+
13
+ ### Added
14
+
15
+ - **`ReleaseEntry.abi_revision`** (`int | None`): the row's `abi_revision`, `None` when the row declares none or declares something that is not an integer.
16
+
17
+ ### Changed
18
+
19
+ - **Installs move to a per-revision directory, so the first fetch after upgrading downloads again.** The per-user cache `default_registry_dir()` is now `${XDG_CACHE_HOME:-~/.cache}/chtypes/artifacts/abi<R>/<os>-<arch>`, `<R>` this binding's own `ABI_REVISION`, where it was `…/chtypes/artifacts/<os>-<arch>`. Two SDK versions that speak different ABI revisions on one machine no longer overwrite each other's artifacts. Nothing is migrated: the old directory is simply no longer read, and can be deleted once nothing older uses it. `CHTYPES_REGISTRY` and an explicit directory are taken exactly as before.
20
+ - **Fetch now selects only artifacts built at this binding's own ABI revision** (`docs/guides/fetch.md` §2). The release's rows are narrowed to those whose `abi_revision` is `ABI_REVISION` before the newest-version, highest-build rule applies; a row that declares no revision never matches. Nothing at that revision for the line and platform is `ArtifactUnpublishedError` (`CHTYPES_ARTIFACT_UNPUBLISHED`, exit 4), naming the revision(s) the release does serve — never a fallback to another revision's build, which the loader would refuse anyway. Across a revision cutover the grace this gives an older binding is temporary: an older-revision build stays fetchable only until that line's next publish evicts it under retention, which keeps two builds per version.
21
+ - **`fetch_lines(..., all_lines=True)` and `python -m chtypes fetch --all` no longer skip a line silently.** A line the release has for the platform only at another ABI revision, or only in rows that record none (built before revisions were recorded), is not installed, and one loud warning line (through `progress` when one is given, else on stderr) names the line, the platform, what the release does serve and this binding's revision; every other line still installs, and the exit status stays 0 when they all do.
22
+ - **`list` shows only the release's rows at this binding's ABI revision** — what a fetch could install — and, when that hides any of the platform's rows, adds one line naming them: `<N> row(s) at ABI revision(s) <S> not shown; this SDK speaks <R>`, or, for rows that record none, `<M> row(s) that record no ABI revision (built before revisions were recorded) not shown; this SDK speaks <R>`. Nothing is added when nothing was hidden.
23
+ - **On darwin-arm64, fetching line 24.8 now fails at fetch time** with `CHTYPES_ARTIFACT_UNPUBLISHED` (exit 4) instead of installing an artifact the loader then refuses: the release's only 24.8 rows for that platform record no ABI revision, because they were built before revisions were recorded, and the message says exactly that rather than that the release serves none.
24
+ - `Release.offered()` now returns only rows at this binding's ABI revision, and `Release.select()` considers only those.
25
+
26
+ ## [0.3.1] — 2026-09-26
27
+
28
+ Speaks ABI revision 5, unchanged from 0.3.0: every artifact 0.3.0 loads, this release loads.
29
+
30
+ ### Changed
31
+
32
+ - **The publish-window retry (`docs/guides/fetch.md` §3a) now also covers a release-level file whose hash disagrees with its `SHA256SUMS` row** — `sdk-goldens.json`, checked after the requested artifact has already installed, since it is best-effort and never blocks that install — and the retry budget widened from 3 attempts ~10s apart to 5 attempts with delays doubling from 4s (4/8/16/32s, ~60s of sleep, ~70s of wall time with network latency). The artifacts host's edge cache can hold a stale pairing of `SHA256SUMS`, its signature, `index.json` or `sdk-goldens.json` for up to its measured 60-second `Cache-Control: max-age`, wider than the original ~10s budget covered. Every retry now re-reads the WHOLE consistent set fresh — never one freshly re-fetched object checked against another attempt's stale one. A release-level file mismatch that never heals still leaves the golden tests skipping loudly, exactly as before, and never fails the fetch that asked for the artifact (issue #223).
33
+
7
34
  ## [0.3.0] — 2026-09-22
8
35
 
9
36
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: chtypes
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Python binding for the chtypes artifacts: ClickHouse's own type system, per version, behind the frozen chs_* C ABI
5
5
  Project-URL: Homepage, https://github.com/wave-rf/chtypes
6
6
  Project-URL: Repository, https://github.com/wave-rf/chtypes
@@ -31,7 +31,7 @@ uv add chtypes # or: pip install chtypes
31
31
  python -m chtypes fetch 25.8
32
32
  ```
33
33
 
34
- The fetch lands in `~/.cache/chtypes/artifacts/<os>-<arch>/25.8/` — the per-user cache every chtypes binding reads by default — after checking an ed25519 signature over the release and the sha256 of every byte. `$CHTYPES_REGISTRY` overrides it. The ed25519 verifier is pure stdlib too.
34
+ The fetch lands in `~/.cache/chtypes/artifacts/abi<R>/<os>-<arch>/25.8/` — the per-user cache every chtypes binding reads by default, `<R>` the ABI revision this SDK speaks (fetch installs only artifacts built at it) — after checking an ed25519 signature over the release and the sha256 of every byte. `$CHTYPES_REGISTRY` overrides it. The ed25519 verifier is pure stdlib too.
35
35
 
36
36
  ## Quickstart
37
37
 
@@ -13,7 +13,7 @@ uv add chtypes # or: pip install chtypes
13
13
  python -m chtypes fetch 25.8
14
14
  ```
15
15
 
16
- The fetch lands in `~/.cache/chtypes/artifacts/<os>-<arch>/25.8/` — the per-user cache every chtypes binding reads by default — after checking an ed25519 signature over the release and the sha256 of every byte. `$CHTYPES_REGISTRY` overrides it. The ed25519 verifier is pure stdlib too.
16
+ The fetch lands in `~/.cache/chtypes/artifacts/abi<R>/<os>-<arch>/25.8/` — the per-user cache every chtypes binding reads by default, `<R>` the ABI revision this SDK speaks (fetch installs only artifacts built at it) — after checking an ed25519 signature over the release and the sha256 of every byte. `$CHTYPES_REGISTRY` overrides it. The ed25519 verifier is pure stdlib too.
17
17
 
18
18
  ## Quickstart
19
19
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "chtypes"
3
- version = "0.3.0"
3
+ version = "0.3.2"
4
4
  description = "Python binding for the chtypes artifacts: ClickHouse's own type system, per version, behind the frozen chs_* C ABI"
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -196,7 +196,14 @@ def _cmd_verify(args: argparse.Namespace) -> int:
196
196
 
197
197
 
198
198
  def _cmd_list(args: argparse.Namespace) -> int:
199
- from .fetch import Fetcher, fetch_destination, host_platform, installed_lines
199
+ from .fetch import (
200
+ Fetcher,
201
+ _fetch_abi_revision,
202
+ _not_shown,
203
+ fetch_destination,
204
+ host_platform,
205
+ installed_lines,
206
+ )
200
207
 
201
208
  platform = args.platform or host_platform()
202
209
  registry = fetch_destination(args.dest, platform=platform)
@@ -221,6 +228,11 @@ def _cmd_list(args: argparse.Namespace) -> int:
221
228
  f" {entry.minor:<8} {entry.clickhouse_version:<18} b{entry.build_number:<3} "
222
229
  f"{entry.file} [{state}]\n"
223
230
  )
231
+ # Only this SDK's own ABI revision is offered (docs/guides/fetch.md §2), and
232
+ # one line names what that hid.
233
+ note = _not_shown([e for e in release.entries if e.platform == platform], _fetch_abi_revision())
234
+ if note is not None:
235
+ sys.stdout.write(f" {note}\n")
224
236
  sys.stdout.flush()
225
237
  return EXIT_OK
226
238
 
@@ -15,6 +15,7 @@ import platform as _platform
15
15
  from dataclasses import dataclass, fields
16
16
  from pathlib import Path
17
17
 
18
+ from ._native import ABI_REVISION
18
19
  from .errors import RegistryError
19
20
 
20
21
  __all__ = [
@@ -38,11 +39,15 @@ def host_platform() -> str:
38
39
 
39
40
  def cache_registry_dir(platform: str | None = None) -> str:
40
41
  """The per-user artifact cache for a platform — ``${XDG_CACHE_HOME:-~/.cache}/
41
- chtypes/artifacts/<os>-<arch>``, this host's by default. Where fetch installs,
42
- where a core-repository build lands, and slot 3 of the registry search path
43
- (docs/guides/fetch.md §1). A path, not a promise: it need not exist yet."""
42
+ chtypes/artifacts/abi<R>/<os>-<arch>``, R this binding's `ABI_REVISION`, this
43
+ host's platform by default. Where fetch installs, and slot 3 of the registry
44
+ search path (docs/guides/fetch.md §1); keyed by revision so two SDK versions
45
+ at different revisions never share it. A path, not a promise: it need not
46
+ exist yet."""
44
47
  base = os.environ.get("XDG_CACHE_HOME") or os.path.join(os.path.expanduser("~"), ".cache")
45
- return os.path.join(base, "chtypes", "artifacts", platform or host_platform())
48
+ return os.path.join(
49
+ base, "chtypes", "artifacts", f"abi{ABI_REVISION}", platform or host_platform()
50
+ )
46
51
 
47
52
 
48
53
  @dataclass(frozen=True, slots=True)