AnnMarieW / dash-multi-page-app-demos

Minimal examples of multi-page apps using Dash Pages
221 stars 52 forks source link

Add a workflow triggering Unit Tests #2

Closed schwabts closed 1 year ago

schwabts commented 1 year ago

Is there a better way to make sure all examples actually run out of the box?

...\dash-multi-page-app-demos>python multi_page_cache_background_callback/app.py
Traceback (most recent call last):
  File "multi_page_cache_background_callback/app.py", line 39, in <module>
    import diskcache
ModuleNotFoundError: No module named 'diskcache'

...\dash-multi-page-app-demos>python multi_page_flask_login/app.py
Traceback (most recent call last):
  File "multi_page_flask_login/app.py", line 15, in <module>
    from flask_login import login_user, LoginManager, UserMixin, logout_user, current_user
ModuleNotFoundError: No module named 'flask_login'

Yes, I'm running this on Windows and should traditionally use the path separator '\' but somehow that's no longer a problem since quite a while as is easily seen by running many other examples out there. Indeed,

...\dash-multi-page-app-demos>python multi_page_query_strings/app.py
Dash is running on http://127.0.0.1:8050/

 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
AnnMarieW commented 1 year ago

@schwabts Great idea - I'd welcome a pull request for that.

Did you install the requirements.txt?

schwabts commented 1 year ago

@AnnMarieW my fault, thanks for reminding me of why that file exists ;)

However, doing so I got

...\dash-multi-page-app-demos>python -m venv env_dash-multi-page-app-demos
...\dash-multi-page-app-demos>env_dash-multi-page-app-demos\scripts\activate
(env_dash-multi-page-app-demos) ...\dash-multi-page-app-demos>pip install -r requirements.txt
ERROR: Invalid requirement: 'Flask-Caching=> 2.0.1' (from line 9 of requirements.txt)
schwabts commented 1 year ago

With the file updated by https://github.com/AnnMarieW/dash-multi-page-app-demos/pull/4 I get

(env_dash-multi-page-app-demos) ...\dash-multi-page-app-demos>pip install -r requirements.txt
Collecting ...
Successfully installed ...

(env_dash-multi-page-app-demos) ...\dash-multi-page-app-demos>python multi_page_flask_login/app.py
Dash is running on http://127.0.0.1:8050/

 * Serving Flask app 'app'
 * Debug mode: on

I just don't manage to successfully log in on the login page, anyway. 🤷‍♂️