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

Don't create or check permissions on .plotly config directory until it a write operation is requested #1076

Closed
jonmmease opened this issue Jul 27, 2018 · 3 comments
Milestone

Comments

@jonmmease
Copy link
Contributor

Right now we always run the check to make sure read/write permissions are available for the user's .plotly directory. We do it with a call to tools.ensure_local_plotly_files() on the import of plotly/plotly/plotly.py. Becuase of our recursive imports this package is always imported and so we always check for these permissions.

Because of use-cases like that in #1068, where a bunch of jobs are running on a cluster and are just doing offline plotting, we shouldn't do this check unless we're actually using the plotly.plotly package to communicate with the plot.ly servers.

@jonmmease jonmmease changed the title Don't check for read/write permissions on .plotly directory until it's needed Don't create or check permissions on .plotly config directory until it a write operation is requested Sep 20, 2018
@jonmmease jonmmease added this to the v3.3.0 milestone Sep 20, 2018
@jonmmease
Copy link
Contributor Author

Done in #1195

@pb-cdunn
Copy link

pb-cdunn commented Jan 8, 2019

I think this is still a problem.

_______ ERROR collecting tests/unit/test_pbreports_plot_plotly_helper.py _______
tests/unit/test_pbreports_plot_plotly_helper.py:7: in <module>
    from pbreports.plot import plotly_helper
pbreports/plot/plotly_helper.py:12: in <module>
    from plotly import graph_objs
/scratch/cdunn/repo/pbreports/build/lib/python2.7/site-packages/plotly/__init__.py:31: in <module>
    from plotly import (plotly, dashboard_objs, graph_objs, grid_objs, tools,
/scratch/cdunn/repo/pbreports/build/lib/python2.7/site-packages/plotly/plotly/__init__.py:10: in <module>
    from . plotly import (
/scratch/cdunn/repo/pbreports/build/lib/python2.7/site-packages/plotly/plotly/plotly.py:30: in <module>
    from plotly import exceptions, files, session, tools, utils
/scratch/cdunn/repo/pbreports/build/lib/python2.7/site-packages/plotly/files.py:41: in <module>
    _file_permissions = _permissions()
/scratch/cdunn/repo/pbreports/build/lib/python2.7/site-packages/plotly/files.py:28: in _permissions
    os.mkdir(TEST_DIR)
E   OSError: [Errno 17] File exists: '/home/UNIXHOME/cdunn/.test'

I had to re-raise in the except-catch block of _permissions in order to get this. from plotly import graph_objs seems to trigger it, and that's in the public API.

@pb-cdunn
Copy link

pb-cdunn commented Jan 8, 2019

I want to make warnings into errors in my tests. (pytest -W error), so this is a big problem for me.

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

No branches or pull requests

2 participants