Skip to main content

Resolver and install-record boundary for install-centric Python package runtimes

Project description

zab-pkg-resolve

zab-pkg-resolve is a small resolver and install-record boundary for Python package runtimes. It keeps source lookup, target normalization, cache/install state, validation, and consumer-facing package records outside the runtime that loads and dispatches installed packages.

The first consumer is zush, but the package is intentionally runtime-agnostic: it records what was resolved and installed, then projects a compact record that another runtime can use to load the package surface.

Install

pip install zab-pkg-resolve

Python 3.12 or newer is required.

What It Provides

  • Canonical target normalization for package references such as GitHub shorthand and explicit URLs.
  • Source/provider registration through ResolverRegistry and SourceProvider implementations.
  • Managed cache and install records through ManagedStore.
  • Runtime-facing ConsumerPackageRecord projection without resolver credentials or registry internals.
  • Structured Loadpoint values for module and path based package surfaces.
  • InstallResult.changed so consumers can skip runtime reloads when an update did not change the active artifact or load surface.
  • Validation policies for manifest fields and Python version constraints.

Basic Usage

from pathlib import Path

from zab_pkg_resolve import CanonicalTarget, Loadpoint, ManagedStore, ResolvedPackage

store = ManagedStore(Path(".zab"))

package = ResolvedPackage(
	id="zush.cron",
	target=CanonicalTarget("package", "zush.cron"),
	artifact_hash="abc123",
	loadpoint=Loadpoint.module("zush_cron.__zush__", callable="extension"),
	capabilities=["zush.extension"],
)

result = store.install(package)

if result.changed:
	for record in store.consumer_records():
		print(record.as_dict())

Loadpoints

A loadpoint tells a consumer runtime where the installed package surface lives and which callable to execute.

Loadpoint.module("package_name.__zush__", callable="extension")
Loadpoint.path("C:/workspace/package_name", callable="extension")

Consumers receive loadpoints through ConsumerPackageRecord.as_dict():

{
	"id": "zush.cron",
	"installed_path": ".zab/installed/zush.cron",
	"entrypoint": None,
	"loadpoint": {
		"kind": "module",
		"ref": "zush_cron.__zush__",
		"callable": "extension",
	},
	"capabilities": ["zush.extension"],
}

Development

uv run --extra dev behave
uv run python -m unittest discover -s tests
uv build

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zab_pkg_resolve-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zab_pkg_resolve-0.1.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file zab_pkg_resolve-0.1.0.tar.gz.

File metadata

  • Download URL: zab_pkg_resolve-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zab_pkg_resolve-0.1.0.tar.gz
Algorithm Hash digest
SHA256 298ac8ba75261decacd115e7b7e6adc576229a5e0e080c45fe746ce6f7e3c212
MD5 86eecb3f6e27acad2d658f57b2d2c047
BLAKE2b-256 19e1ef7f8bec09d2405e92aad5f3b3994a8c39a9a13677a924a0b99130a59bac

See more details on using hashes here.

Provenance

The following attestation bundles were made for zab_pkg_resolve-0.1.0.tar.gz:

Publisher: publish.yml on ZackaryW/zab-pkg-resolve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zab_pkg_resolve-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zab_pkg_resolve-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zab_pkg_resolve-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e97f23f4a68ff68f8b78aa2c9c9015f577b8c0a7163454f5cb5ed671ac0c649
MD5 a7ce35b32ddd08a493713495291f6fc3
BLAKE2b-256 95ed8a2e1bb106b4ae012ec82012db6efb32e15c1281b3ed9243564bbcdab874

See more details on using hashes here.

Provenance

The following attestation bundles were made for zab_pkg_resolve-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ZackaryW/zab-pkg-resolve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page