Skip to content

Commit

Permalink
Fix interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
kmagusiak committed Nov 26, 2023
1 parent 7858049 commit 9d6ec83
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ alphaconf.setup_configuration({
def main():
log = logging.getLogger()
log.info('server.url:', alphaconf.get('server.url'))
log.info('has server.user:', alphaconf.get('server.user', bool))
log.info('has server.user:', alphaconf.get('server.user', bool, default=False))

if __name__ == '__main__':
alphaconf.cli.run(main)
Expand Down Expand Up @@ -110,6 +110,7 @@ When showing the configuration, by default configuration keys which are
secrets, keys or passwords will be masked.
Another good practice is to have a file containing the password which
you can retrieve using `alphaconf.get('secret_file', 'read_strip')`.
TODO do better than this, also pydantic.SecretStr?

### Invoke integration

Expand All @@ -125,9 +126,9 @@ alphaconf.invoke.run(__name__, ns)
```

## Way to 1.0
- Secret management
- Install completions for bash
- Run a function after importing the module
- Run a specific function `alphaconf.cli.run_module()`:
find functions and parse their args
- Install completions for bash `alphaconf --install-autocompletion`

[OmegaConf]: https://omegaconf.readthedocs.io/
[pydantic]: https://docs.pydantic.dev/latest/
4 changes: 2 additions & 2 deletions alphaconf/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ def mount(configuration_paths: List[str] = [], setup_logging: bool = True):
application.setup_configuration(configuration_paths=configuration_paths)
set_application(application)
if setup_logging:
import logging_util
from . import logging_util

logging_util.setup_application_logging(
application.configuration.get('logging'), default=None
application.configuration.get('logging', default=None)
)
logging.info('Mounted interactive application')

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ requires-python = ">=3.9"
classifiers = [
# https://pypi.org/pypi?%3Aaction=list_classifiers
"Programming Language :: Python :: 3",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Environment :: Console",
]
Expand Down

0 comments on commit 9d6ec83

Please sign in to comment.