Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Difference in Python packages using Debug mode? #90

Closed
valentijnnieman opened this issue Oct 16, 2018 · 4 comments
Closed

Difference in Python packages using Debug mode? #90

valentijnnieman opened this issue Oct 16, 2018 · 4 comments

Comments

@valentijnnieman
Copy link
Contributor

I'm using a modified version of dash_core_components that I built using python setup.py sdist in dev-requirements.txt like so: dash_core_components-0.33.0rc1.tar.gz this works well when not using debug mode in a Dash app, i.e. app.run_server(debug=False) but if I DO use it, all of the sudden it doesn't use the modified package. I am slightly puzzled and don't know how to fix this, any suggestions would be greatly appreciated!

@T4rk1n
Copy link
Contributor

T4rk1n commented Oct 16, 2018

You need to set app.scripts.config.serve_locally=True for it to serve the modified package.

I recommend the following python environment when developping:

  • Create a new empty python project with a virtual env.
  • Clone all dash repo you need.
  • Install them locally on the virtual env with pip install -e path/to/repo. You may to reinstall dash-renderer after installing dash with this method to get the local install of dash-renderer.
  • If using pycharm, you need to invalidate the cache/restart to reindex the packages.

I then open all the repo in the same pycharm project so I can debug the javascript easily (the last opened pycharm window is the one that connect to the javascript debugger).

@valentijnnieman
Copy link
Contributor Author

You need to set app.scripts.config.serve_locally=True for it to serve the modified package.

I did. It works on production mode, but when switching to development (using debug=True) it doesn't work anymore, it takes another version. I just have a copy of dash_core_components-0.33.0rc1.tar.gz in the root of the project and reference that in dev-requirements.txt. What I don't get is that it works fine in production mode, but not in development! Thanks for your help though, I'll try a fresh venv and see if that fixes anything.

@valentijnnieman
Copy link
Contributor Author

Nevermind, I'm a big dummy! I forgot to build the dash_core_components dev bundle, so the sdist package only had the production one 🙈 I forgot about it being separated now. Thanks for your help @T4rk1n

@T4rk1n
Copy link
Contributor

T4rk1n commented Oct 16, 2018

That's why I put the build:js-dev in prepublish 🙈, but prepublish doesn't run on setup.py sdist.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants