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

Road to 4.0 part 1 #683

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Road to 4.0 part 1 #683

wants to merge 2 commits into from

Conversation

rochacbruno
Copy link
Member

@rochacbruno rochacbruno commented Oct 22, 2021

NO BREAKING CHANGE

Basically, this makes #677 obsolete and now allows this form of schema.

class Settings(Dynaconf):
    bar = "zaz"
    banana: str  # must break, no default value
    apple: str = Field(default_expr="env.APPLE | upper")
    colors: List[str]
    meh: int = None
    server: str = "myserver"
    hdf = "33"

    class SchemaConfig:
        extra_fields_policy = ExtraFields.allow
        validation_mode = SchemaValidationMode.eager
        envvar_prefix = "MYPROGRAM"
        settings_file = "settings.yaml"

settings = Settings(foo="bar")

BREAKING CHANGE

The following mode is now removed!

from dynaconf import settings

Must use

from dynaconf import Dynaconf

# Subclass and configure
class Settings(Dynaconf):
    field: type = Field(...)
    ...
    class SchemaConfig:
        ...

# or use defaults
settings = Dynaconf(**options)

@stale
Copy link

stale bot commented Jul 14, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 14, 2022
@rochacbruno
Copy link
Member Author

This is going to be refactored

@phitoduck
Copy link

Very excited for v4!

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

Successfully merging this pull request may close these issues.

None yet

2 participants