Skip to content

Commit

Permalink
Add support for aiida-core==2.X
Browse files Browse the repository at this point in the history
  • Loading branch information
mpougin committed Aug 26, 2023
1 parent 04b99cf commit 0344579
Show file tree
Hide file tree
Showing 43 changed files with 1,399 additions and 1,363 deletions.
24 changes: 0 additions & 24 deletions .ci/check_travis_tag.py

This file was deleted.

2 changes: 0 additions & 2 deletions .coveragerc

This file was deleted.

161 changes: 85 additions & 76 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,98 +1,107 @@
name: Continuous Integration
name: CI

on: [push, pull_request]

jobs:

test-plugin:
tests:
name: Test Suite
runs-on: ubuntu-latest
timeout-minutes: 30

steps:

- name: Check out repository
uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[tests]
- name: Run test suite
run: pytest

examples:
name: Run examples
runs-on: ubuntu-latest
timeout-minutes: 30

steps:

- uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

# see https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build #and push
uses: docker/build-push-action@v2
with:
context: .
push: false
load: true
tags: aiida_raspa_test
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Run tests
run: |
export DOCKERID=`docker run -d aiida_raspa_test`
docker exec --tty $DOCKERID wait-for-services
docker logs $DOCKERID
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'cd /opt/aiida-raspa/ && py.test --cov aiida_raspa --cov-append .'
# see https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
docker exec --tty --user aiida --env-file <(env | grep GITHUB_) -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} $DOCKERID /bin/bash -l -c 'cd /opt/aiida-raspa/ && coveralls --service=github'
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build #and push
uses: docker/build-push-action@v2
with:
context: .
push: false
load: true
tags: aiida_raspa_test
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run examples
run: |
export DOCKERID=`docker run -d aiida_raspa_test`
docker exec --tty $DOCKERID wait-for-services
docker logs $DOCKERID
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c '\
verdi run /opt/aiida-raspa/examples/simple_calculations/example_base.py --submit raspa && \
verdi run /opt/aiida-raspa/examples/simple_calculations/example_base_restart.py --previous_calc 4 --submit raspa && \
verdi run /opt/aiida-raspa/examples/simple_calculations/example_binary_mixture.py --submit raspa
'
pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[pre-commit,test,docs]
reentry scan
- name: Run pre-commit
run: |
pre-commit install
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )

- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[pre-commit,tests,docs]
- name: Run pre-commit
run: |
pre-commit install
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
docs:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[docs,test]
reentry scan
- name: Build docs
run: |
cd docs && make

- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[docs]
- name: Build docs
run: |
make -C docs html
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,6 @@ tags
[._]*.un~

# End of https://www.gitignore.io/api/vim,linux,macos,python,pycharm
submit_test
submit_test

.vscode
41 changes: 20 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@
# pre-commit install

repos:
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.30.0
hooks:
# yapf = yet another python formatter
- id: yapf
name: yapf
types: [python]
exclude: >
(?x)^(
docs/.*|
)$
args: ['-i']
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort

- repo: local
hooks:
# yapf = yet another python formatter
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.10

# prospector: collection of linters
- id: pylint
language: system
types: [file, python]
name: pylint
entry: pylint
- repo: local
hooks:
- id: pylint
language: system
types: [file, python]
name: pylint
entry: pylint
3 changes: 0 additions & 3 deletions .style.yapf

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM aiidateam/aiida-core:1.6.9
FROM aiidateam/aiida-core:2.3.1

# Set HOME, PATH and RASPA_DIR variables:
ENV PATH="/opt/RASPA2_installed/bin/:${PATH}"
Expand Down Expand Up @@ -36,7 +36,7 @@ RUN pip install coveralls

# Copy and install aiida-raspa plugin.
COPY . aiida-raspa
RUN pip install ./aiida-raspa[pre-commit,test,docs]
RUN pip install -e aiida-raspa[pre-commit,tests,docs]

# Install the RASPA code to AiiDA.
COPY .docker/opt/add-codes.sh /opt/
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

1 change: 0 additions & 1 deletion aiida_raspa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
##############################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
Expand Down
Loading

0 comments on commit 0344579

Please sign in to comment.