Repository navigation
Conversation
32aeb0a to
2348ce4
Compare
2348ce4 to
1e04b32
Compare
88bcb12 to
8c29c10
Compare
|
To test with this PR, you can clone the repo and ln the |
There was a problem hiding this comment.
Hi @unkcpz, this is great, thanks for working on this. I did not test yet, for now just a couple of clarifying questions and some suggestions for variable names.
- Does this mean that no changes are needed in the
aiidalabrepo? - Will this also allow us to solve the spurious "Update available", if the new version is incompatible? Perhaps that's for a follow up PR?
- We will need to backport this to the old docker stack image. We need to find out if the current
aiidalab-homeis still compatible or if there were any breaking changes in the meantime.
| app_version, python_bin | ||
| ) | ||
| packages = find_installed_packages(python_bin) | ||
| for requriment in unmatched_requirements: |
There was a problem hiding this comment.
typo, needs to be fixed below as well
| for requriment in unmatched_requirements: | |
| for requirement in unmatched_requirements: |
| if app_version is None: | ||
| return [] | ||
|
|
||
| dependencies = [] |
There was a problem hiding this comment.
Clearer naming?
| dependencies = [] | |
| dependencies_to_install = [] |
| Note: Only check aiida-core compatibility at the moment | ||
| """ | ||
| for dep in dependencies: | ||
| if "aiida-core" in dep.installed: |
There was a problem hiding this comment.
Please generalize this code for the future, define a list of strict dependencies as a global constant (probably at the top of the file or somwhere).
I also wonder, should this function be here or rather in aiidalab repo? I don't have an answer now, but something to think about.
| cannot_reach_registry = ( | ||
| self.app.remote_update_status is AppStatus.CANNOT_REACH_REGISTRY | ||
| ) | ||
| strict_dependency = self._check_strict_dependencies(dependencies) |
There was a problem hiding this comment.
| strict_dependency = self._check_strict_dependencies(dependencies) | |
| strict_dependency_violation = self._check_strict_dependencies(dependencies) |
or maybe
| strict_dependency = self._check_strict_dependencies(dependencies) | |
| violates_strict_dependency = self._check_strict_dependencies(dependencies) |
| installed = self.app.is_installed() | ||
| installed_version = self.app.installed_version | ||
| version_to_install = self.version_selector.version_to_install | ||
| dependencies = self.find_to_be_installed_dependencies( |
There was a problem hiding this comment.
| dependencies = self.find_to_be_installed_dependencies( | |
| dependencies_to_install = self.find_to_be_installed_dependencies( |
| if not busy and can_switch: | ||
| self.dependencies_install_info.value = ( | ||
| self.DEPENDENCIES_INSTALL_INFO.render( | ||
| dependencies=dependencies, |
There was a problem hiding this comment.
| dependencies=dependencies, | |
| dependencies=dependencies_to_install, |
| <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a> | ||
| Following dependencie(s) will be changed: | ||
| <ul> | ||
| {% for p in dependencies %} |
There was a problem hiding this comment.
| {% for p in dependencies %} | |
| {% for p in dependencies_to_install %} |
|
Thanks @danielhollas, you ask very valuable questions.
When I started, I plan to put functions in
No, I didn't take it into account. I test on the latest docker stack to show that downgrade to old version is forbidden. But as you said, this change is more for forbidding user to upgrade app and override aiida-core. I'll check it again.
I don't think there will be breaking changes but as mentioned above this need to backport and I'll test it. |
556f0fb to
1cc6ac1
Compare
|
I address the variables naming suggested by @danielhollas and close this one with replaced it by #130. |
fixes aiidalab/aiidalab#318
The compatibilities only checked for the installed app. If the user going to install the app that would potentially override the aiida-core version the installation will fail in AppManager but the user is not notified before they trigger the installation procedure.
In this PR, the check for the to-be-installed app is activated when the version is selected and will block the user to install the app that has incompatible "core" dependencies. The "core" dependencies now are only
aiida-core.The method
_check_strict_dependencyis used to check that theaiida-coreversion of the container is not overridden by the app.If the "core" dependencies are not incompatible, the dependencies to be installed or updated will show in the info notes to remind the user what will be overridden.