Skip to content

Commit

Permalink
Merge pull request #4880 from aiidateam/release/1.6.3
Browse files Browse the repository at this point in the history
Release `v1.6.3`
  • Loading branch information
sphuber authored Apr 28, 2021
2 parents 3f7ee1b + 2181e41 commit c0fec53
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# Changelog

## v1.6.2 - 2021-04-26
## v1.6.3 - 2021-04-28

[full changelog](https://github.com/aiidateam/aiida-core/compare/v1.6.1...v1.6.2) | [GitHub contributors page for this release](https://github.com/aiidateam/aiida-core/graphs/contributors?from=2021-03-31&to=2021-04-26&type=c)
[full changelog](https://github.com/aiidateam/aiida-core/compare/v1.6.2...v1.6.3) | [GitHub contributors page for this release](https://github.com/aiidateam/aiida-core/graphs/contributors?from=2021-04-281&to=2021-04-28&type=c)

This is a patch release to fix a bug that was introduced in `v1.6.2` that would cause a number of `verdi` commands to fail due to a bug in the `with_dbenv` decorator utility.

### Bug fixes
- Fix `aiida.cmdline.utils.decorators.load_backend_if_not_loaded` [[#4878]](https://github.com/aiidateam/aiida-core/pull/4878)


## v1.6.2 - 2021-04-28

[full changelog](https://github.com/aiidateam/aiida-core/compare/v1.6.1...v1.6.2) | [GitHub contributors page for this release](https://github.com/aiidateam/aiida-core/graphs/contributors?from=2021-03-31&to=2021-04-27&type=c)

### Bug fixes
- CLI: Use the proper proxy command for `verdi calcjob gotocomputer` if configured as such [[#4761]](https://github.com/aiidateam/aiida-core/pull/4761)
Expand Down
2 changes: 1 addition & 1 deletion aiida/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
'For further information please visit http://www.aiida.net/. All rights reserved.'
)
__license__ = 'MIT license, see LICENSE.txt file.'
__version__ = '1.6.2'
__version__ = '1.6.3'
__authors__ = 'The AiiDA team.'
__paper__ = (
'S. P. Huber et al., "AiiDA 1.0, a scalable computational infrastructure for automated reproducible workflows and '
Expand Down
21 changes: 14 additions & 7 deletions aiida/cmdline/utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
code branch gets visited and possibly avoiding the overhead if not
"""

from contextlib import contextmanager

from click_spinner import spinner
Expand All @@ -33,18 +32,26 @@


def load_backend_if_not_loaded():
"""Load the current profile if necessary while running the spinner to show command hasn't crashed."""
from aiida.manage.configuration import load_profile, PROFILE
"""Load the database backend environment for the currently loaded profile.
If no profile has been loaded yet, the default profile will be loaded first. A spinner will be shown during both
actions to indicate that the function is working and has not crashed, since loading can take a second.
"""
from aiida.manage.configuration import get_profile, load_profile
from aiida.manage.manager import get_manager

if PROFILE is None:
manager = get_manager()

if get_profile() is None or not manager.backend_loaded:
with spinner():
load_profile()
get_manager().get_backend()
load_profile() # This will load the default profile if no profile has already been loaded
manager.get_backend() # This will load the backend of the loaded profile, if not already loaded


def with_dbenv():
"""Function decorator that will load the database environment only when the function is called.
"""Function decorator that will load the database environment for the currently loaded profile.
.. note:: if no profile has been loaded yet, the default profile will be loaded first.
Example::
Expand Down
2 changes: 1 addition & 1 deletion setup.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aiida-core",
"version": "1.6.2",
"version": "1.6.3",
"url": "http://www.aiida.net/",
"license": "MIT License",
"author": "The AiiDA team",
Expand Down

0 comments on commit c0fec53

Please sign in to comment.