-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Support configurable settings directory with lazy initialization #1195
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
Conversation
...itsb/plotly.py into itsb-PLOTLY_DIR_environment_variable
...d to be written When settings are accessed and directory or files don't exist, return the defaults
It needs to be PlotlyTestCase in order to trigger the saving/restoration of config and credentials.
Otherwise defaults themselves are mutated!
Previously this settings directory was created and initialized during the initial import of the plotly library. Now, the creation of the directory and the initialization of the configuration files is delayed until an operation is performed that needs to write to the directory.
👍 works for me. a lot of dash users have questions about this when they deploy their apps on servers with protected home directories. they aren't actually using any of the files in ~/.plotly, it just appears when dash does its own import plotly.
This PR makes 2 changes to our handling of the
.plotlysettings directory.~/.plotly, but it can now be overridden by setting thePLOTLY_DIRenvironment variable before Python starts. These changes are built on this PR by @itsb: user-controllable plotly config directory #661Change 1 provides a way to customize the location of plotly.py's settings, and makes it possible for users to create and maintain multiple profiles.
Change 2 removes the concurrency issues associated with launching many plotly processes simultaneously.
This PR addresses the following issues:
import plotlycreates (possibly) unnecessary credentials #728