A without behavior source backed by a Kubernetes ConfigMap mount, reloaded with watchfiles.
Project description
without-configmap
A without behavior source backed by a Kubernetes ConfigMap mount: the first
context that actually changes, proving the context-updated-by-a-stream half of
the model end to end. Where without-env loads a static value
once, this one re-parses on every mount change.
watch_config(mount, parse) is a Stream that yields the parsed config now and a
freshly parsed value every time the mount changes. It watches the mount
directory, not the file, so it catches the atomic ..data symlink swap that
projected ConfigMaps
use. Feed the stream through without.sample to read the latest value as a
Context:
from pathlib import Path
from pydantic import BaseModel
from without import sample
from without_configmap import read_yaml_file, watch_config
class MyConfig(BaseModel):
model_config = {"frozen": True}
default_mode: str
max_bytes: int
source = watch_config(Path("/etc/config"), read_yaml_file(MyConfig, "config.yaml"))
async with sample(source) as config:
config.current() # always the latest reloaded value, never blocks
await config.updated() # block until the next reload lands, then return it
See the
without-configmap guide
(with the API reference)
for the full surface.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file without_configmap-0.0.1.tar.gz.
File metadata
- Download URL: without_configmap-0.0.1.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5b4ab3038959488cd8060b6c820e615d00fe9bbe11d427d79559d456e566c7b
|
|
| MD5 |
1c833a0e775dfca30b5dd92ee7adad7b
|
|
| BLAKE2b-256 |
d1aa9b5165350b1df9de2e8f981c1471e44ba92d4050081a0af31b9c5f23ceee
|
File details
Details for the file without_configmap-0.0.1-py3-none-any.whl.
File metadata
- Download URL: without_configmap-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7dee0ab8ad998963843a3f87292fd92950225956328c1e04c94742724041915
|
|
| MD5 |
bdd88ad582bba280816cb7e7c0fdbe6f
|
|
| BLAKE2b-256 |
746f704c16a2cdeac502fe8e2eb07534eaeb821ca83987a5dad480cfa27950cf
|