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

Support configurable settings directory with lazy initialization #1195

Merged
merged 9 commits into from
Sep 25, 2018

Conversation

jonmmease
Copy link
Contributor

This PR makes 2 changes to our handling of the .plotly settings directory.

  1. The default location of this directory is still ~/.plotly, but it can now be overridden by setting the PLOTLY_DIR environment variable before Python starts. These changes are built on this PR by @itsb: user-controllable plotly config directory #661
  2. 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. Defaults are now returned when settings are accessed and the config directory does not exist.

Change 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:

@jonmmease
Copy link
Contributor Author

cc @chriddyp @Kully @cldougl . Please let me know if there's anything here you're uncomfortable with given the other contexts where plotly.py is used.

@chriddyp
Copy link
Member

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.

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

3 participants