Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
jonmmease merged 9 commits into master from enh_1076
Sep 25, 2018

Conversation

@jonmmease
Copy link
Contributor

@jonmmease jonmmease commented Sep 24, 2018

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:

mungojam reacted with heart emoji
itsb and others added 9 commits January 12, 2017 17:25
...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!
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.

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.

@jonmmease jonmmease merged commit 79cdc1e into master Sep 25, 2018
@jonmmease jonmmease added this to the v3.3.0 milestone Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

v3.3.0

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /