pconfiged¶
- pconfigs.pconfiged(_cls=None, *, runnable=False, mock=False)[source]¶
Decorator that creates a pconfiged object.
See also
For examples, see Construction.
When used with keyword options, it behaves as follows.
- Parameters:
runnable (bool, optional) – If True, the class can be run with
python -m pconfigs.run dot.path.to.config, where the dot‑path specifies an object within a Python module. The class will expose amainmethod with signaturedef main(self, args: Namespace, others: List[str]) -> int. Theargsparameter will have a single value,args.config, which is the dot-path of the config (for example,dot.path.to.config). Seepconfigs.config_runner.ConfigRunnablefor more details.mock (bool, optional) – If True, the pconfiged class may come from an external library that uses simple, keyword-only arguments to define its configuration.