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

Stop setting defaults on validators #988

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

Stop setting defaults on validators #988

wants to merge 8 commits into from

Conversation

rochacbruno
Copy link
Member

@rochacbruno rochacbruno commented Aug 23, 2023

Default will be declared on validators
but applied only on get method

Fix #981

  • pass tests
  • make default value loading lazy
  • update docs
  • test cast with lazy values

Default will be declared on validators
but applied only on get method

Fix #981
@netlify
Copy link

netlify bot commented Aug 23, 2023

Deploy Preview for dynaconf ready!

Name Link
🔨 Latest commit 9143590
🔍 Latest deploy log https://app.netlify.com/sites/dynaconf/deploys/64fee56f7fde59000827245f
😎 Deploy Preview https://deploy-preview-988--dynaconf.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@rochacbruno rochacbruno added this to the 3.3.0 milestone Aug 23, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 23, 2023

Test Results (Python 3.11)

468 tests   - 1   464 ✔️  - 5   40s ⏱️ -1s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       4 +4 

For more details on these failures, see this check.

Results for commit 9143590. ± Comparison against base commit 97366d6.

This pull request removes 5 and adds 4 tests. Note that renamed tests count towards both.
tests.test_inspect ‑ test_inspect_print_all
tests.test_inspect ‑ test_inspect_print_key
tests.test_inspect ‑ test_inspect_to_file_all
tests.test_inspect ‑ test_inspect_to_file_key
tests.test_validators ‑ test_toml_should_not_change_validator_type_using_at_sign
tests.test_cli ‑ test_inspect_limit
tests.test_inspect ‑ test_inspect_key_filter
tests.test_inspect ‑ test_inspect_no_filter
tests.test_inspect ‑ test_inspect_to_file

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 23, 2023

Test Results (Python 3.10)

468 tests   - 1   464 ✔️  - 3   41s ⏱️ -1s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       4 +2 

For more details on these failures, see this check.

Results for commit 9143590. ± Comparison against base commit 97366d6.

This pull request removes 5 and adds 4 tests. Note that renamed tests count towards both.
tests.test_inspect ‑ test_inspect_print_all
tests.test_inspect ‑ test_inspect_print_key
tests.test_inspect ‑ test_inspect_to_file_all
tests.test_inspect ‑ test_inspect_to_file_key
tests.test_validators ‑ test_toml_should_not_change_validator_type_using_at_sign
tests.test_cli ‑ test_inspect_limit
tests.test_inspect ‑ test_inspect_key_filter
tests.test_inspect ‑ test_inspect_no_filter
tests.test_inspect ‑ test_inspect_to_file

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 23, 2023

Test Results (Python 3.8)

468 tests   - 1   464 ✔️  - 5   38s ⏱️ -1s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       4 +4 

For more details on these failures, see this check.

Results for commit 9143590. ± Comparison against base commit 97366d6.

This pull request removes 5 and adds 4 tests. Note that renamed tests count towards both.
tests.test_inspect ‑ test_inspect_print_all
tests.test_inspect ‑ test_inspect_print_key
tests.test_inspect ‑ test_inspect_to_file_all
tests.test_inspect ‑ test_inspect_to_file_key
tests.test_validators ‑ test_toml_should_not_change_validator_type_using_at_sign
tests.test_cli ‑ test_inspect_limit
tests.test_inspect ‑ test_inspect_key_filter
tests.test_inspect ‑ test_inspect_no_filter
tests.test_inspect ‑ test_inspect_to_file

♻️ This comment has been updated with latest results.

@rochacbruno rochacbruno marked this pull request as draft August 23, 2023 19:19
@rochacbruno
Copy link
Member Author

copilot:poem

@pedro-psb
Copy link
Member

@rochacbruno The breaking change in #980 (such as turning off toml parsing on setdefault, or other) will be somehow implemented here? So we can add a warning on the 3.2.2 release note.

rochacbruno and others added 6 commits September 6, 2023 10:33
inspect_settings:
* change inspect_settings report-output format names and structure
* implement 'history_limit' on 'utils.inspect:inspect_settings'
* rename key_dotted_path to key
* rename history_sort to new_first
* enforce usage of kwargs, except for "settings", "key" and "env"
* merge "output_format" and "custom" into "dumper"
* add "report_builder" to allow output customization
* add explicit 'print_report' param

cli:
* implement cli --limit|-n
* update cli to match 'inspect_settings' changes

non-breaking-change
* minor "utils.inspect" internal renames
* re-write docstrings in sphinx-style (:param foo)
* expose 'get_history'
* refactor 'test_cli.py': use more robust test isolation strategy
* add data return to 'inspect_settings' for cleaner testing
Shortlog of commits since last release:

    Bruno Rocha (6):
          Release version 3.2.1
          Hooking: Add support for changing the wrapped class (#975)
          Hotfix bypass evaluation #984 (#985)
          Fix #976 from envvars parse True/False as booleans (#983)
          Fix #982 glob on settings_files (#987)
          docker compose is available on CI no need to install

    Pedro Pessoa (1):
          Inspect Feature Review (#958)
@rochacbruno rochacbruno modified the milestones: 3.3.0, 3.2.3 Sep 7, 2023
@eirnym
Copy link

eirnym commented Nov 16, 2023

Hi @rochacbruno Is there any rough estimate for this PR?

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.

[RFC] Stop setting default value inside validate method
4 participants