Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom converters to the docs #790

Closed
rochacbruno opened this issue Aug 16, 2022 · 3 comments
Closed

Add custom converters to the docs #790

rochacbruno opened this issue Aug 16, 2022 · 3 comments
Labels

Comments

@rochacbruno
Copy link
Member

The PR #784

allowed

# app.py
from pathlib import Path
from dynaconf.utils import parse_conf

parse_conf.converters["@path"] = (
    lambda value: value.set_casting(Path)
    if isinstance(value, parse_conf.Lazy)
    else Path(value)
)
# settings.toml

parent = "@path @format {env[HOME]}/parent"
child = "@path @format {this.parent}/child"

We need to add that to the docs and example/ test run

@jorenretel
Copy link
Contributor

Hi,

I think I already added this: https://github.com/dynaconf/dynaconf/blob/master/example/custom_cast_token/app.py

That covers adding to example/ test run, right?

@rochacbruno
Copy link
Member Author

sadly not @jorenretel , we want to automate those runs, but currently it runs via https://github.com/dynaconf/dynaconf/blob/master/Makefile#L9

@jorenretel
Copy link
Contributor

I have put in a pull request: #791

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants