Recent Releases of https://github.com/aphp/confit
https://github.com/aphp/confit - v0.10.0
Changelog
- Deprecate
auto_draft_in_config, in favor of explicitly using@registry: myname !draftto define a draft object - :boom: Even if a
MyClass.draft(...)instantiation contains all required parameter, it will still return a draft.draft.instantiatemust be called to instantiate the actual object.
Pull Requests
- Favor explicit draft objects (via rather than autodraftin_config by @percevalw in https://github.com/aphp/confit/pull/39
- fix: improve draft implementation by @percevalw in https://github.com/aphp/confit/pull/40
- chore: bump version to 0.10.0 by @percevalw in https://github.com/aphp/confit/pull/41
Full Changelog: https://github.com/aphp/confit/compare/v0.9.0...v0.10.0
- Python
Published by percevalw 6 months ago
https://github.com/aphp/confit - v0.9.0
Changelog
- Fix calling @validatearguments on classes with wrapped `init_` functions (e.g. accelerate loggers)
- Enforce
auto_draft_in_configparameter when a function is imported via entry points (i.e., apply precedence to function passed toRegistry.register, instead of the one got from the entry point) - Add
default_configoption in CLI decorator
What's Changed
- feat: add default config option in CLI by @Thomzoy in https://github.com/aphp/confit/pull/38
- fix: support @validatearguments on classes with wrapped _init__ by @percevalw in https://github.com/aphp/confit/pull/37
Full Changelog: https://github.com/aphp/confit/compare/v0.8.0...v0.9.0
- Python
Published by percevalw 8 months ago
https://github.com/aphp/confit - v0.8.0
Changelog
- Added
auto_draft_in_configparameter toregister(...)function. This is meant for functions that can only be partially be instantiated by a user, because a required parameter will be provided by the library later.
For instance:
- EDS-NLP's
ScheduledOptimizerrequires the pipeline parameters, which depends on the pipeline being trained - EDS-NLP's local trackers (like
csvandjson) requirelogging_dirwhich might be defined in theedsnlp.trainfunction.
If a callable registered with auto_draft_in_config=True is resolved with missing required parameters, a Draft[ReturnType] class is returned.
This class can then be instantiated via the draft.instantiate method.
We don't instantiate a Draft class via the __call__ method to avoid users mistakenly proceeding with a non instantiated class.
Instead, whenever a Draft an attribute or a method is requested on Draft class, outside the Draft few specific attrs/methods,
a message error is displayed explaining how this object is not instantiated yet.
The user can also explicitly instantiate the Draft object via the Class.draft method for classes that have been wrapped with validate_arguments.
- Added a
Validatableclass that can be inherited from to run avalidateclass method whenever the class is validated
Pull Requests
- feat: added allow_partial parameter by @percevalw in https://github.com/aphp/confit/pull/34
- chore: bump version to 0.8.0 by @percevalw in https://github.com/aphp/confit/pull/36
Full Changelog: https://github.com/aphp/confit/compare/v0.7.5...v0.8.0
- Python
Published by percevalw 10 months ago
https://github.com/aphp/confit - v0.7.5
What's Changed
- Handle non-str keys by @Thomzoy in https://github.com/aphp/confit/pull/32
- chore: bump version to 0.7.5 by @Thomzoy in https://github.com/aphp/confit/pull/35
Full Changelog: https://github.com/aphp/confit/compare/v0.7.4...v0.7.5
- Python
Published by Thomzoy 11 months ago
https://github.com/aphp/confit - v0.7.4
Changelog
- Allow larger than 4096 bytes config files
- Escape tabs and newline when serializing to a config file
- Fix an infinite loop that occured when resolving a reference to a field with a null value
Pull Requests
- Fix/issue 26 : YAML Parsing for Large Config Files by @LucasDedieu in https://github.com/aphp/confit/pull/28
- Fix: escape tabs and newline when serializing to a config file by @percevalw in https://github.com/aphp/confit/pull/29
- Support reference to fields with null values by @percevalw in https://github.com/aphp/confit/pull/30
- chore: bump version to 0.7.4 by @percevalw in https://github.com/aphp/confit/pull/31
New Contributors
- @LucasDedieu made their first contribution in https://github.com/aphp/confit/pull/28
Full Changelog: https://github.com/aphp/confit/compare/v0.7.3...v0.7.4
- Python
Published by percevalw about 1 year ago
https://github.com/aphp/confit - v0.7.3
Changelog
- Support interpolated seed in the config file (as a reminder, the seed is treated specifically by confit to initialize random generators before any object is resolved)
- Support if/else expressions in interpolation, and only resolve the relevant branch
Pull Requests
- Better interpolation by @percevalw in https://github.com/aphp/confit/pull/25
- Bump version to 0.7.3 by @percevalw in https://github.com/aphp/confit/pull/27
Full Changelog: https://github.com/aphp/confit/compare/v0.7.2...v0.7.3
- Python
Published by percevalw about 1 year ago
https://github.com/aphp/confit - v0.7.2
Changelog
- Seed the program BEFORE the config file is resolved and components have been instantiated, to ensure reproducibility.
Pull Request
- Seeded CLI by @percevalw in https://github.com/aphp/confit/pull/24
Full Changelog: https://github.com/aphp/confit/compare/v0.7.1...v0.7.2
- Python
Published by percevalw about 1 year ago
https://github.com/aphp/confit - v0.7.1
Changelog
- Force utf-8 encoding when writing a config file (ini or yaml)
Pull Requests
- Fix encoding by @percevalw in https://github.com/aphp/confit/pull/22
- chore: bump version to 0.7.1 by @percevalw in https://github.com/aphp/confit/pull/23
Full Changelog: https://github.com/aphp/confit/compare/v0.7.0...v0.7.1
- Python
Published by percevalw over 1 year ago
https://github.com/aphp/confit - v0.7.0
Changelog
Changed
- Aborting a script will now show the traceback
Fixed
- Confit should no longer cause pydantic v1 deprecation warnings
Pull Requests
- v0.7.0 by @percevalw in https://github.com/aphp/confit/pull/21
Full Changelog: https://github.com/aphp/confit/compare/v0.6.0...v0.7.0
- Python
Published by percevalw over 1 year ago
https://github.com/aphp/confit - v0.6.0
Changelog
Fixed
- Support IPython autoreload on confit wrapped functions
- Support using config files with scripts without a dedicated section header
- Disable configparser interpolation (% symbol)
- Better support for escaped strings in config files
- Various registry-related fixes
Added
- Non-relevant fields (outside the script dedicated section) are no longer instantiated when running a script with a config file
- We now support loading and serializing configs in yaml syntax (
Confit.from_yaml_str,Confit.to_yaml_str,Confit.from_disk("___.yaml")andConfit.to_disk("___.yaml"))
Pull Requests
- Improvements by @percevalw in https://github.com/aphp/confit/pull/19
- feat: support yaml syntax by @percevalw in https://github.com/aphp/confit/pull/20
Full Changelog: https://github.com/aphp/confit/compare/v0.5.6...v0.6.0
- Python
Published by percevalw over 1 year ago
https://github.com/aphp/confit - v0.5.6
No change from v0.5.5. Package is now distributed as source and wheel.
Full Changelog: https://github.com/aphp/confit/compare/v0.5.5...v0.5.6
- Python
Published by percevalw about 2 years ago
https://github.com/aphp/confit - v0.5.5
Changelog
Added
- Support fixing the path of validation errors raised inside a "validate" function (see the
AsListmeta type in the tests)
Pull Requests
- Support fixing path of nested validation errors inside a method by @percevalw in https://github.com/aphp/confit/pull/16
Full Changelog: https://github.com/aphp/confit/compare/v0.5.4...v0.5.5
- Python
Published by percevalw about 2 years ago
https://github.com/aphp/confit - v0.5.4
Changelog
Fixed
- We now forward function signature when accessing a callable via a deprecated registry name.
This is useful when
registry.get("deprecated-name")is inspected.
Pull Requests
- Forward deprecated fn signature by @percevalw in https://github.com/aphp/confit/pull/15
Full Changelog: https://github.com/aphp/confit/compare/v0.5.3...v0.5.4
- Python
Published by percevalw about 2 years ago
https://github.com/aphp/confit - v0.5.3
Changelog
Changed
- We now raise an error if a value in the config cannot be deserialized as a JSON object but contains characters that hint at a JSON object (e.g. quotes, brackets, etc.). This changes the old behavior where we would silently ignore the value and keep the string as is.
Fixed
- Allow complex interpolations like
${[*section."key.with.dot", "baz"]}
Pull Requests
- v0.5.3 by @percevalw in https://github.com/aphp/confit/pull/14
Full Changelog: https://github.com/aphp/confit/compare/v0.5.2...v0.5.3
- Python
Published by percevalw over 2 years ago
https://github.com/aphp/confit - v0.5.2
Changelog
Changed
- Keys with dots (or path-like keys in general) will be escaped when serializing a config
python {"section": {"deep.key": "ok"}}will be serialized asini [section] 'deep.key' = "ok"
What's Changed
- Escape path-like keys by @percevalw in https://github.com/aphp/confit/pull/13
Full Changelog: https://github.com/aphp/confit/compare/v0.5.1...v0.5.2
- Python
Published by percevalw over 2 years ago
https://github.com/aphp/confit - v0.5.1
Changelog
- Use context instead of func for setseed to allow ```python with setseed(42): # do stuff num = random.randint(0, 100) ```
- Add auto-reload plugin to work with confit wrapped functions in notebooks
Pull Requests
- Misc utils by @percevalw in https://github.com/aphp/confit/pull/12
Full Changelog: https://github.com/aphp/confit/compare/v0.5.0...v0.5.1
- Python
Published by percevalw over 2 years ago
https://github.com/aphp/confit - v0.5.0
What's Changed
Added
deprecatedparameter to register an object under multiple names with deprecation warnings
Fixed
- Stop interpreting type errors as validation errors when executing a validated function
Pull Requests
- Parameter for deprecated names by @percevalw in https://github.com/aphp/confit/pull/11
Full Changelog: https://github.com/aphp/confit/compare/v0.4.3...v0.5.0
- Python
Published by percevalw over 2 years ago
https://github.com/aphp/confit - v0.4.3
What's Changed
Fixed
- Save var kwargs as separate fields
Pull Requests
- Save var kwargs as separate fields by @percevalw in https://github.com/aphp/confit/pull/10
Full Changelog: https://github.com/aphp/confit/compare/v0.4.2...v0.4.3
- Python
Published by percevalw over 2 years ago
https://github.com/aphp/confit - v0.4.2
What's Changed
Fixed
- Re-enable extra/duplicate arg errors and uniformize between pydantic v1/v2
- Add pydantic-core dependency for jsonable types during dump
Pull Requests
- v0.4.2 by @percevalw in https://github.com/aphp/confit/pull/9
Full Changelog: https://github.com/aphp/confit/compare/v0.4.1...v0.4.2
- Python
Published by percevalw over 2 years ago
https://github.com/aphp/confit - v0.4.1
What's changed
Fixed
- Use pydantic v2 context error only if it is an exception
Full Changelog: https://github.com/aphp/confit/compare/v0.4.0...v0.4.1
- Python
Published by percevalw over 2 years ago
https://github.com/aphp/confit - v0.4.0
What's new
Added
- Improve validation errors merging and display. By default, confit related frames and exception causes in the traceback are hidden.
- Show inner-confit traceback and exception chains if
CONFIT_DEBUGenv var is true - Support for both Pydantic v2 and v1
Fixed
- If the
seedis given a default value in CLI, it can now be used by confit when no seed is given
Pull Requests
- docs: fix language switching by @percevalw in https://github.com/aphp/confit/pull/2
- v0.3.0 by @percevalw in https://github.com/aphp/confit/pull/6
- Better errors by @percevalw in https://github.com/aphp/confit/pull/7
- Pydantic v2 by @percevalw in https://github.com/aphp/confit/pull/8
Full Changelog: https://github.com/aphp/confit/compare/v0.3.0...v0.4.0
- Python
Published by percevalw over 2 years ago
https://github.com/aphp/confit - v0.3.0
What's Changed
- Allow keyword only parameters
- Avoid import of all entry points by catalogue during failed registry lookup
- Fix bug in serialization, leading to mixed config fields
Full Changelog: https://github.com/aphp/confit/compare/v0.2.1...v0.3.0
- Python
Published by percevalw over 2 years ago
https://github.com/aphp/confit - v0.2.1
Github publication !
Features:
- pydantic validation
- post-resolution interpolation
- advanced safe interpolation
- typer-based CLI
- extended toml config files
- inport/export config to string/files from simple & complex values
- Python
Published by percevalw almost 3 years ago