This app is a collection of resources for developers to have a more detailed view of the libraries that are installed in their Dash App Python environment. You can check the source code here.
Summary:
- The "Additional resources" section (collapsed by default) includes commands to run in a terminal to get information about the environment and fix issues.
- There "Upload files" section allows users to paste or upload
requirements.txtand/orpip_freeze.txtfiles. The details of libraries listed in those files will be shown in the "Packages history" tab. This app doesn't support yet other files to specify requirements likepyproject.toml. - The "Packages history" tab shows only some columns by default. Additional information about the libraries is already retrieved and can be shown with the checklist in the right side of the table.
- The "Packages history" table is useful:
- When there's a discrepancy between a Dash App behaviour between the deployed app (which the
requirements.txtfile represents) and the local environment (which thepip_freeze.txtfile represents).- For these cases, it's useful to compare the version number in the sections "requirements.txt" and "Installed".
- To understand why the numbers in these columns might be different, you can look at the "requirements.txt > Pinned" column and "Newest > Release date". A common scenario is a new version including breaking changes and, if the library version is not pinned (
==,<=) in requirements.txt, the newest one is installed. These issues typically appear asImportError: cannot import name X from Y' (/app/.heroku/python/lib/PYTHON_VERSION/site-packages/LIBRARY_NAME/SOME_FILE.py). - If a library appears in
pip_freeze.txtbut not inrequirements.txt, it was likely installed because it's a dependency of a library inrequirements.txt. To identify and understand the dependency relationships, you can usepipdeptree(check the "Resources" section). - In these cases, the solution is either to pin the conflicting library to a previous version (the version you used when developing the app) or updating the app code to the newer versions of the library
- When a Dash App had been working fine but a new deployment caused it to break, without any changes to the app code, you are likely facing a breaking change from a new release, as specified in the previous point.
- When there's a discrepancy between a Dash App behaviour between the deployed app (which the
- The information shown in "Packages history" and "Changelog" is retrieved from PyPi and the additional resources listed there for each library (Documentation, GitHub or Changelog page). If the Changelog is retrieved from GitHub, the
GITHUB_PATenvironment variable will be used to get the information for each release. ThisGITHUB_PATshould be a Personal Access Token (PAT) with read access to the repositories you want to have access to. A PAT is also necessary to make these requests even if the library/repository is public. Alternatively, you can directly visit the library's resources by checking the "Links" column (hidden by default) section of the "Packages history" table. - The "Changelogs" tab allows you to review one or multiple libraries' changelogs. If you have included a
GITHUB_PATenvironment variable with read access to some private repositories, the GitHub-based changelog (information from the "Tags" section in the repository) will be shown there too.requirements.txtorpip_freeze.txtfiles don't need to be provided for this tab to work and you can also specify a library name that doesn't appear in your environment. - Selecting one or more libraries from the "Packages history" table will enable the "Show selected libraries changelogs" button. Clicking it will take you directly to the "Changelogs" tab, with the selected libraries' names already in the search bar.
- The "Strip requirements" tab removes all of the version numbers from the provided
requirements.txtfile (from the "Upload files" section). - This app uses both browser persistence (for the uploaded files) and file system caching/memoization (Diskcache). The cache for library updates (for example, a function that retrieves changelogs) expires after 24h (i.e. if the cached result is older than 24h, it will be deleted and the function will be called again, generating a fresh result).