Skip to content

Commit f47fec9

Browse files
authored
⬆️ Update for aiida-core v2 (#40)
1 parent 41efa4f commit f47fec9

File tree

13 files changed

+29
-39
lines changed

13 files changed

+29
-39
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: ci
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
47

58
jobs:
69

@@ -10,7 +13,7 @@ jobs:
1013
strategy:
1114
matrix:
1215
python-version: ["3.8"]
13-
aiida-version: ["stable", "develop"]
16+
aiida-version: ["stable"]
1417

1518
services:
1619
postgres:
@@ -39,20 +42,11 @@ jobs:
3942
with:
4043
python-version: ${{ matrix.python-version }}
4144

42-
- name: Install aiida develop version
43-
run: |
44-
pip install git+git://github.com/aiidateam/aiida-core
45-
if: ${{ matrix.aiida-version == 'develop' }}
46-
4745
- name: Install python dependencies
4846
run: |
4947
pip install --upgrade pip
5048
pip install -e .[testing]
5149
52-
- name: Run reentry scan
53-
run: reentry scan
54-
if: ${{ matrix.aiida-version != 'develop' }}
55-
5650
- name: Run test suite
5751
env:
5852
# show timings of tests
@@ -72,7 +66,6 @@ jobs:
7266
run: |
7367
pip install --upgrade pip
7468
pip install -e .[docs]
75-
reentry scan -r aiida
7669
- name: Build docs
7770
run: cd docs && make
7871

@@ -88,8 +81,7 @@ jobs:
8881
- name: Install python dependencies
8982
run: |
9083
pip install --upgrade pip
91-
pip install -e .[pre-commit,docs,testing]
92-
reentry scan -r aiida
84+
pip install -e .[pre-commit,testing]
9385
- name: Run pre-commit
9486
run: |
9587
pre-commit install

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
build/
1313
dist/
1414
pip-wheel-metadata/
15+
.tox/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
- id: isort
2222

2323
- repo: https://github.com/psf/black
24-
rev: 21.12b0
24+
rev: 22.3.0
2525
hooks:
2626
- id: black
2727

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ For more information, see the [developer guide](https://aiida-diff.readthedocs.i
5252

5353
* Add input files using `SinglefileData`:
5454
```python
55-
SinglefileData = DataFactory('singlefile')
55+
SinglefileData = DataFactory('core.singlefile')
5656
inputs['file1'] = SinglefileData(file='/path/to/file1')
5757
inputs['file2'] = SinglefileData(file='/path/to/file2')
5858
```

aiida_diff/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
AiiDA demo plugin that wraps the `diff` executable for computing the difference between two files.
55
"""
66

7-
__version__ = "1.2.0"
7+
__version__ = "2.0.0"

aiida_diff/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def get_computer(name=LOCALHOST_NAME, workdir=None):
4242
:param workdir: path to work directory
4343
Used only when creating a new computer.
4444
:return: The computer node
45-
:rtype: :py:class:`aiida.orm.Computer`
45+
:rtype: :py:class:`aiida.orm.computers.Computer`
4646
"""
4747

4848
try:
@@ -73,7 +73,7 @@ def get_code(entry_point, computer):
7373
:param entry_point: Entry point of calculation plugin
7474
:param computer: (local) AiiDA computer
7575
:return: The code node
76-
:rtype: :py:class:`aiida.orm.Code`
76+
:rtype: :py:class:`aiida.orm.nodes.data.code.Code`
7777
"""
7878

7979
try:

aiida_diff/parsers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self, node):
2424
Checks that the ProcessNode being passed was produced by a DiffCalculation.
2525
2626
:param node: ProcessNode of calculation
27-
:param type node: :class:`aiida.orm.ProcessNode`
27+
:param type node: :class:`aiida.orm.nodes.process.process.ProcessNode`
2828
"""
2929
super().__init__(node)
3030
if not issubclass(node.process_class, DiffCalculation):
@@ -39,7 +39,7 @@ def parse(self, **kwargs):
3939
output_filename = self.node.get_option("output_filename")
4040

4141
# Check that folder content is as expected
42-
files_retrieved = self.retrieved.list_object_names()
42+
files_retrieved = self.retrieved.base.repository.list_object_names()
4343
files_expected = [output_filename]
4444
# Note: set(A) <= set(B) checks whether A is a subset of B
4545
if not set(files_expected) <= set(files_retrieved):
@@ -50,7 +50,7 @@ def parse(self, **kwargs):
5050

5151
# add output file
5252
self.logger.info(f"Parsing '{output_filename}'")
53-
with self.retrieved.open(output_filename, "rb") as handle:
53+
with self.retrieved.base.repository.open(output_filename, "rb") as handle:
5454
output_node = SinglefileData(file=handle)
5555
self.out("diff", output_node)
5656

conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
@pytest.fixture(scope="function", autouse=True)
8-
def clear_database_auto(clear_database): # pylint: disable=unused-argument
8+
def clear_database_auto(aiida_profile_clean): # pylint: disable=unused-argument
99
"""Automatically clear database in between tests."""
1010

1111

docs/source/conf.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,13 @@
1414
import sys
1515
import time
1616

17-
from reentry import manager
18-
1917
from aiida.manage.configuration import load_documentation_profile
2018

2119
import aiida_diff
2220

2321
# -- AiiDA-related setup --------------------------------------------------
2422

25-
# ensure all entry point plugins are lodaed
26-
manager.scan()
27-
28-
# Load the dummy profile even if we are running locally, this way the documentation will succeed even if the current
29-
# default profile of the AiiDA installation does not use a Django backend.
23+
# Load the dummy documentation profile
3024
load_documentation_profile()
3125

3226
# -- General configuration ------------------------------------------------
@@ -49,7 +43,7 @@
4943

5044
intersphinx_mapping = {
5145
"python": ("https://docs.python.org/3", None),
52-
"aiida": ("https://aiida-core.readthedocs.io/en/latest", None),
46+
"aiida": ("https://aiida.readthedocs.io/projects/aiida-core/en/latest", None),
5347
}
5448

5549
# Add any paths that contain templates here, relative to this directory.

docs/source/developer_guide/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Continuous integration
4444

4545
``aiida-diff`` comes with a ``.github`` folder that contains continuous integration tests on every commit using `GitHub Actions <https://github.com/features/actions>`_. It will:
4646

47-
#. run all tests for the ``django`` ORM
47+
#. run all tests
4848
#. build the documentation
4949
#. check coding style and version number (not required to pass by default)
5050

0 commit comments

Comments
 (0)