Skip to content

Commit

Permalink
Remove all deprecated resources for v2.0 (#4881)
Browse files Browse the repository at this point in the history
  • Loading branch information
sphuber committed Apr 29, 2021
1 parent bcc9d6b commit 287d138
Show file tree
Hide file tree
Showing 60 changed files with 40 additions and 2,913 deletions.
30 changes: 0 additions & 30 deletions .github/system_tests/pytest/test_unittest_example.py

This file was deleted.

117 changes: 0 additions & 117 deletions .github/system_tests/test_plugin_testcase.py

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ verdi daemon stop
pytest --noconftest ${SYSTEM_TESTS}/test_test_manager.py
pytest --noconftest ${SYSTEM_TESTS}/test_ipython_magics.py
pytest --noconftest ${SYSTEM_TESTS}/test_profile_manager.py
python ${SYSTEM_TESTS}/test_plugin_testcase.py # uses custom unittest test runner

# Until the `${SYSTEM_TESTS}/pytest` tests are moved within `tests` we have to run them separately and pass in the path to the
# `conftest.py` explicitly, because otherwise it won't be able to find the fixtures it provides
Expand Down
54 changes: 0 additions & 54 deletions aiida/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
More information at http://www.aiida.net
"""
import warnings

from aiida.common.log import configure_logging
from aiida.common.warnings import AiidaDeprecationWarning
from aiida.manage.configuration import get_config_option, get_profile, load_profile

__copyright__ = (
Expand All @@ -40,57 +37,6 @@
__paper_short__ = 'S. P. Huber et al., Scientific Data 7, 300 (2020).'


def load_dbenv(profile=None):
"""Alias for `load_dbenv` from `aiida.backends.utils`
:param profile: name of the profile to load
:type profile: str
.. deprecated:: 1.0.0
Will be removed in `v2.0.0`, use :func:`aiida.manage.configuration.load_profile` instead.
"""
warnings.warn('function is deprecated, use `load_profile` instead', AiidaDeprecationWarning) # pylint: disable=no-member
current_profile = get_profile()
from aiida.common import InvalidOperation

if current_profile:
raise InvalidOperation('You cannot call load_dbenv multiple times!')

load_profile(profile)


def try_load_dbenv(profile=None):
"""Run `load_dbenv` unless the dbenv has already been loaded.
:param profile: name of the profile to load
:type profile: str
:returns: whether profile was loaded
:rtype: bool
.. deprecated:: 1.0.0
Will be removed in `v2.0.0`, use :func:`aiida.manage.configuration.load_profile` instead.
"""
warnings.warn('function is deprecated, use `load_profile` instead', AiidaDeprecationWarning) # pylint: disable=no-member
if not is_dbenv_loaded():
load_dbenv(profile)
return True
return False


def is_dbenv_loaded():
"""Determine whether database environment is already loaded.
:rtype: bool
.. deprecated:: 1.0.0
Will be removed in `v2.0.0`, use :func:`aiida.manage.configuration.load_profile` instead.
"""
warnings.warn('function is deprecated, use `load_profile` instead', AiidaDeprecationWarning) # pylint: disable=no-member
return get_profile() is not None


def get_strict_version():
"""
Return a distutils StrictVersion instance with the current distribution version
Expand Down
9 changes: 0 additions & 9 deletions aiida/calculations/plugins/__init__.py

This file was deleted.

9 changes: 0 additions & 9 deletions aiida/calculations/plugins/arithmetic/__init__.py

This file was deleted.

19 changes: 0 additions & 19 deletions aiida/calculations/plugins/arithmetic/add.py

This file was deleted.

19 changes: 0 additions & 19 deletions aiida/calculations/plugins/templatereplacer.py

This file was deleted.

4 changes: 2 additions & 2 deletions aiida/cmdline/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
# Import to populate the `verdi` sub commands
from aiida.cmdline.commands import (
cmd_archive, cmd_calcjob, cmd_code, cmd_comment, cmd_completioncommand, cmd_computer, cmd_config, cmd_data,
cmd_database, cmd_daemon, cmd_devel, cmd_export, cmd_graph, cmd_group, cmd_help, cmd_import, cmd_node, cmd_plugin,
cmd_process, cmd_profile, cmd_rehash, cmd_restapi, cmd_run, cmd_setup, cmd_shell, cmd_status, cmd_user
cmd_database, cmd_daemon, cmd_devel, cmd_group, cmd_help, cmd_node, cmd_plugin, cmd_process, cmd_profile,
cmd_rehash, cmd_restapi, cmd_run, cmd_setup, cmd_shell, cmd_status, cmd_user
)
24 changes: 3 additions & 21 deletions aiida/cmdline/commands/cmd_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,12 @@ def verdi_archive():
@verdi_archive.command('inspect')
@click.argument('archive', nargs=1, type=click.Path(exists=True, readable=True))
@click.option('-v', '--version', is_flag=True, help='Print the archive format version and exit.')
@click.option('-d', '--data', hidden=True, is_flag=True, help='Print the data contents and exit.')
@click.option('-m', '--meta-data', is_flag=True, help='Print the meta data contents and exit.')
def inspect(archive, version, data, meta_data):
def inspect(archive, version, meta_data):
"""Inspect contents of an archive without importing it.
By default a summary of the archive contents will be printed. The various options can be used to change exactly what
information is displayed.
.. deprecated:: 1.5.0
Support for the --data flag
"""
import dataclasses
from aiida.tools.importexport import CorruptArchive, detect_archive_type, get_reader
Expand All @@ -57,10 +52,6 @@ def inspect(archive, version, data, meta_data):
try:
if version:
echo.echo(reader.export_version)
elif data:
# data is an internal implementation detail
echo.echo_deprecated('--data is deprecated and will be removed in v2.0.0')
echo.echo_dictionary(reader._get_data()) # pylint: disable=protected-access
elif meta_data:
echo.echo_dictionary(dataclasses.asdict(reader.metadata))
else:
Expand Down Expand Up @@ -200,7 +191,6 @@ def create(
@options.ARCHIVE_FORMAT()
@options.FORCE(help='overwrite output file if it already exists')
@click.option('-i', '--in-place', is_flag=True, help='Migrate the archive in place, overwriting the original file.')
@options.SILENT(hidden=True)
@click.option(
'-v',
'--version',
Expand All @@ -218,21 +208,13 @@ def create(
type=click.Choice(['DEBUG', 'INFO', 'WARNING', 'CRITICAL']),
help='Control the verbosity of console logging'
)
def migrate(input_file, output_file, force, silent, in_place, archive_format, version, verbosity):
"""Migrate an export archive to a more recent format version.
.. deprecated:: 1.5.0
Support for the --silent flag, replaced by --verbosity
"""
def migrate(input_file, output_file, force, in_place, archive_format, version, verbosity):
"""Migrate an export archive to a more recent format version."""
from aiida.common.log import override_log_formatter_context
from aiida.common.progress_reporter import set_progress_bar_tqdm, set_progress_reporter
from aiida.tools.importexport import detect_archive_type, EXPORT_VERSION
from aiida.tools.importexport.archive.migrators import get_migrator, MIGRATE_LOGGER

if silent is True:
echo.echo_deprecated('the --silent option is deprecated, use --verbosity')

if in_place:
if output_file:
echo.echo_critical('output file specified together with --in-place flag')
Expand Down
17 changes: 0 additions & 17 deletions aiida/cmdline/commands/cmd_devel.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi devel` commands."""

import sys
import click

from aiida.cmdline.commands.cmd_verdi import verdi
from aiida.cmdline.params import options
from aiida.cmdline.params.types import TestModuleParamType
from aiida.cmdline.utils import decorators, echo


Expand Down Expand Up @@ -89,19 +85,6 @@ def devel_validate_plugins():
echo.echo_success('all registered plugins could successfully loaded.')


@verdi_devel.command('tests')
@click.argument('paths', nargs=-1, type=TestModuleParamType(), required=False)
@options.VERBOSE(help='Print the class and function name for each test.')
@decorators.deprecated_command("This command has been removed in aiida-core v1.1.0. Please run 'pytest' instead.")
@decorators.with_dbenv()
def devel_tests(paths, verbose): # pylint: disable=unused-argument
"""Run the unittest suite or parts of it.
.. deprecated:: 1.1.0
Entry point will be completely removed in `v2.0.0`.
"""


@verdi_devel.command('play', hidden=True)
def devel_play():
"""Play the Aida triumphal march by Giuseppe Verdi."""
Expand Down

0 comments on commit 287d138

Please sign in to comment.