plotly / dash-sample-apps

Open-source demos hosted on Dash Gallery
https://dash.gallery
MIT License
3.15k stars 3.04k forks source link

A human requirement and a machine requirement for every app #536

Open xhluca opened 3 years ago

xhluca commented 3 years ago

With recent issues (See PR https://github.com/plotly/dash-sample-apps/pull/535) caused by new version of dependencies breaking an otherwise functioning app, I think that a freeze'd (frozen?) requirement file would be necessary in order to ensure that a certain app is fully functional. For example, instead of a requirements.txt file that looks like this:

dash
casadi==3.5.1
numpy>=1.18.1
...

Instead, it might be a better idea to generate requirements.txt by running pip freeze > requirements.txt. This way, we would avoid one dependency (e.g. casadi) to fall behind while another one (e.g. numpy>=1.18.1) keeps being updated, resulting in broken apps due to API changes.

the human requirements

Since we want to update such apps, it's handy to keep track of human-readable requirements. Perhaps those could be called dependencies.txt or requirements-dev.txt, so that two ways would be recommended:

  1. Trying/reproducing/deploy the app: pip install -r requirements.txt
  2. Fixing/developing the app: pip install -r dependencies.txt or pip install -r requirements-dev.txt
xhluca commented 3 years ago

@emmanuelle @nicolaskruchten Thoughts?

xhluca commented 3 years ago

Already discussed here: https://github.com/plotly/dash/issues/1005

xhluca commented 3 years ago

Seems like pipenv does exactly what I had in mind. Could be worth trying it out for future sample apps