pkg_infra provides shared infrastructure for Saezlab Python packages. It
standardizes three pieces of runtime behavior that are often reimplemented
ad hoc across projects:
- Session metadata for reproducible runs and workspace-aware execution
- Layered YAML configuration with validation and predictable precedence
- Centralized logging based on Python's standard
loggingmodule
What it includes
pkg_infra.get_session(...)as the main entrypoint for initializing runtime state- Config loading from ecosystem, package default, user, working directory, environment variable, and optional custom file sources
- Pydantic-based validation for the merged settings model
- Logging configuration generation with support for file handlers, JSON output, package groups, and async queue-based logging
- A packaged baseline configuration in
pkg_infra/data/default_settings.yaml
Installation
Install the package from PyPI:
pip install pkg_infra
Install it from a local checkout with docs or test extras when developing:
pip install -e ".[docs,tests]"
Quick Example
from pathlib import Path
from pkg_infra import get_session
session = get_session(
workspace=Path("."),
include_location=False,
)
print(session)
print(session.get_config_dict())
corneto_settings = session.get_conf("corneto")
print(corneto_settings)
Configuration Precedence
pkg_infra merges configuration sources in this order, where later sources
override earlier ones:
- Ecosystem config
- Packaged default config
- User config
- Working-directory config
- Config file pointed to by
PKG_INFRA_CONFIG - Explicit custom config path passed by the caller
Documentation
The full documentation is published at https://saezlab.github.io/pkg_infra/.
To serve the docs locally without the current upstream Material warning banner:
source .venv/bin/activate
export NO_MKDOCS_2_WARNING=1
mkdocs serve
Recommended starting points:
- Installation:
docs/installation.md - Quickstart:
docs/learn/tutorials/quickstart.md - Project context and rationale:
docs/pkg_infra-project/
Contributing
Contributions are welcome. The repository includes dedicated guides for
documentation and code contributions in docs/community/.
License
This project is distributed under the BSD-3-Clause License. See LICENSE for details.
Release files for pkg-infra 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pkg_infra-0.1.1.tar.gz | 661.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pkg_infra-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 706.9 kB
Release files / pkg_infra-0.1.1.tar.gz
| Download URL | pkg_infra-0.1.1.tar.gz |
|---|---|
| Size | 661.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12cdf2a49cb9107f96a246135da69cb7919ae4aedbc3988674fc42e34fd8ea8d
|
|
BLAKE2b-256 checksum How to use checksums |
f1b011b27d5a80ac11529135ded619648cdebd5bae612ef8102a88e39d2d6db7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / pkg_infra-0.1.1-py3-none-any.whl
| Download URL | pkg_infra-0.1.1-py3-none-any.whl |
|---|---|
| Size | 45.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
602d7527ce002371aa5a09f6c30ad0ebd78e4a9420c381916c35dc6e059f532a
|
|
BLAKE2b-256 checksum How to use checksums |
2c4b5b6dd0a3fe3ac8de4dc07f20a60071a8d1a117d76a08fc7cbe8511cd086d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|