nadzoring.core package

Package self-management and environment diagnostics.

nadzoring.core.changelog(version: str | None = None, *, timeout_config: TimeoutConfig | None = None) → list[CheckResult][source]

Fetch GitHub release notes, falling back to the repository changelog section.

Parameters:
  • version – Release version, optionally prefixed with v; defaults to installed.

  • timeout_config – Connection, read and lifetime limits for GitHub requests.

Returns:

Release notes or an explicit failure observation.

nadzoring.core.check_dependencies(*, strict: bool = False) → list[CheckResult][source]

Validate installed runtime requirements, including markers and extras.

Requirements come from wheel metadata generated from pyproject.toml. Extra distributions are informational unless strict mode is requested; optional dependency groups are not required by the base installation.

Parameters:

strict – Treat distributions outside the runtime dependency graph as warnings.

Returns:

Dependency observations and an extra-package summary, with explicit errors.

nadzoring.core.check_network(target: str = 'pypi.org', *, timeout_config: TimeoutConfig | None = None) → list[CheckResult][source]

Probe DNS, certificate-verified HTTPS, and optional ICMP for a host.

Parameters:
  • target – Hostname or IP address, without a URL scheme or path.

  • timeout_config – Connection, read, and overall operation limits.

Returns:

Diagnostic rows with latency in milliseconds or an explicit error.

nadzoring.core.check_permissions(*, verbose: bool = False) → list[CheckResult][source]

Probe directory access, interpreter executability, and socket creation.

Missing directories are checked through their nearest existing parent, not created. Temporary write probes are automatically removed. Raw socket permissions are optional and never trigger privilege elevation.

Parameters:

verbose – Include application and probed parent paths in successful rows.

Returns:

Directory, interpreter and socket permission observations.

nadzoring.core.current_version() → str[source]

Return the installed distribution version (never a hard-coded release).

nadzoring.core.doctor(*, timeout_config: TimeoutConfig | None = None) → list[CheckResult][source]

Aggregate Python, dependency, permission, network, and optional tool checks.

Parameters:

timeout_config – Limits applied to the aggregated network probes.

Returns:

All diagnostic observations followed by a successful-check summary.

nadzoring.core.update(*, installer: str = 'auto', dry_run: bool = False, timeout_config: TimeoutConfig | None = None) → list[CheckResult][source]

Upgrade only this interpreter’s installation without shell or elevation.

Parameters:
  • installer – auto (prefer uv), pip, or uv.

  • dry_run – Report the exact argument vector without spawning a process.

  • timeout_config – Subprocess and whole-operation time limit.

Returns:

Update result, including command and any subprocess failure.

nadzoring.core.version_info(*, check: bool = False, timeout_config: TimeoutConfig | None = None) → list[CheckResult][source]

Show the installed version and optionally compare it with stable PyPI releases.

Parameters:
  • check – Query PyPI for its latest published version when true.

  • timeout_config – Connection, read and lifetime limits for the PyPI request.

Returns:

An installed-version, update-available or explicit failure observation.

Submodules