-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Dash Pages bug fixes and enhancements for dash_pages param and layout module imports #2392
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
ab8de66
Fix bug where custom pages_folder wouldn't force use_pages=True
ned2 818d704
add two new pages folder tests and fix bug revealed
ned2 f6990c5
add more test_pages_folder_path_config and refactor to use parameteri…
ned2 0464477
fix bug where pages_folder can't take absolute paths and add tests
ned2 2070c4f
refactor pages_folder_config and add more tests
ned2 89d88b7
make pages_folder_config work with pathlib.Path inputs
ned2 fa1bf85
make pages_folder support pathlib.Path values
ned2 4e09114
add new test for pages_folder with absolute path
ned2 c833e99
add integration test for pages_folder with absolute path
ned2 d79c683
clear PAGES_REGISTRY after each pages integration test to avoid clash…
ned2 3426f62
move pages test dedicated folder
ned2 1e67a65
fix bug where pages_folder with underscores or upper case chars had w…
ned2 948a993
make Dash.pages_folder read-only
ned2 4f4d8fd
replace raised bare Exception with exception.PageError
ned2 fdeadde
add more infer_pages_path tests and improve variable naming
ned2 02c5ca5
fix borked long module names for pages files when pages_folder is abs…
ned2 2eedb00
Support page_folder 1 level below proj root and add clear_page_regist…
ned2 51404ed
Fix flaky tests broken by dirty _pages.CONFIG
ned2 21515af
Properly fix flaky test
ned2 900db46
Refactor test_pages_folder path tests to single parameterised test
ned2 1b3b6a4
add infer_path test case for nested directory paths
ned2 74252a8
Fix imports of modules by Dash Pages feature
ned2 7f9ed57
refactor _infer_module_name
ned2 03271db
add tests for _infer_module_name helper functions
ned2 11dbf86
Change default use_param=None and value of False now disables Pages e…
ned2 7d6d380
remove unused import
ned2 6fcf53b
Merge branch 'dev' into dash-pages-path-fixes
alexcjohnson 04bbf0d
changelog for pages improvements
alexcjohnson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
|
||
import pytest | ||
import dash | ||
from dash._configs import DASH_ENV_VARS | ||
|
||
|
||
@pytest.fixture | ||
def empty_environ(): | ||
for k in DASH_ENV_VARS.keys(): | ||
if k in os.environ: | ||
os.environ.pop(k) | ||
|
||
|
||
@pytest.fixture | ||
def clear_pages_state(): | ||
init_pages_state() | ||
yield | ||
init_pages_state() | ||
|
||
|
||
def init_pages_state(): | ||
"""Clear all global state that is used by pages feature.""" | ||
dash._pages.PAGE_REGISTRY.clear() | ||
dash._pages.CONFIG.clear() | ||
dash._pages.CONFIG.__dict__.clear() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this breaks backward compatibility (combined with the change in dash/_configs.py) because effectively use_pages=True behavior is inferred (by checking page_folder instead of use_pages), while the user relies on the previous use_pages=False behavior.