Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require spglib 1.15. #23

Closed
wants to merge 8 commits into from
Closed
99 changes: 48 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,26 +81,23 @@ jobs:
run: pip install packaging==20.3 click~=7.0 pyyaml~=5.1 toml

- name: Check requirements files
id: check_reqs
run: python ./utils/dependency_management.py check-requirements DEFAULT

- name: Create commit comment
if: failure()
uses: peter-evans/commit-comment@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: setup.json
body: |
It appears that at least one of the environments defined in the requirements files
('requirements/*.txt') is not meeting the dependencies specified in the 'setup.json' file.
These files define the environment for continuous integration tests, so it is important that they are updated.
${{ steps.check_reqs.outputs.error }}

If this commit is part of a pull request, you can automatically update the requirements by
commenting with '/update-requirements'.

Click [here](https://github.com/aiidateam/aiida-core/wiki/AiiDA-Dependency-Management) for more information.
Click [here](https://github.com/aiidateam/aiida-core/wiki/AiiDA-Dependency-Management) for more information on dependency management.

tests:

needs: [check-requirements]

runs-on: ubuntu-latest
timeout-minutes: 30

Expand All @@ -110,24 +107,24 @@ jobs:
backend: ['django', 'sqlalchemy']
python-version: [3.5, 3.8]

services:
postgres:
image: postgres:10
env:
POSTGRES_DB: test_${{ matrix.backend }}
POSTGRES_PASSWORD: ''
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672
#services: # TODO: UNCOMMENT AFTER DEBUGGING
# postgres:
# image: postgres:10
# env:
# POSTGRES_DB: test_${{ matrix.backend }}
# POSTGRES_PASSWORD: ''
# POSTGRES_HOST_AUTH_METHOD: trust
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
# ports:
# - 5432:5432
# rabbitmq:
# image: rabbitmq:latest
# ports:
# - 5672:5672

steps:
- uses: actions/checkout@v2
Expand All @@ -137,11 +134,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list
sudo apt update
sudo apt install postgresql-10 graphviz
#- name: Install system dependencies # TODO: UNCOMMENT AFTER DEBUGGING
# run: |
# sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list
# sudo apt update
# sudo apt install postgresql-10 graphviz

- name: Upgrade pip
run: |
Expand All @@ -159,26 +156,26 @@ jobs:
reentry scan
pip freeze

- name: Setup environment
env:
AIIDA_TEST_BACKEND: ${{ matrix.backend }}
run:
.github/workflows/setup.sh

- name: Run test suite
env:
AIIDA_TEST_BACKEND: ${{ matrix.backend }}
run:
.github/workflows/tests.sh

- name: Upload coverage report
if: matrix.python-version == 3.5 && github.repository == 'aiidateam/aiida-core'
uses: codecov/codecov-action@v1
with:
name: aiida-pytests-py3.5-${{ matrix.backend }}
flags: ${{ matrix.backend }}
file: ./coverage.xml
fail_ci_if_error: true
#- name: Setup environment # TODO: UNCOMMENT AFTER DEBUGGING
# env:
# AIIDA_TEST_BACKEND: ${{ matrix.backend }}
# run:
# .github/workflows/setup.sh

#- name: Run test suite # TODO: UNCOMMENT AFTER DEBUGGING
# env:
# AIIDA_TEST_BACKEND: ${{ matrix.backend }}
# run:
# .github/workflows/tests.sh

#- name: Upload coverage report
# if: matrix.python-version == 3.5 && github.repository == 'aiidateam/aiida-core'
# uses: codecov/codecov-action@v1
# with:
# name: aiida-pytests-py3.5-${{ matrix.backend }}
# flags: ${{ matrix.backend }}
# file: ./coverage.xml
# fail_ci_if_error: true

verdi:

Expand Down
142 changes: 130 additions & 12 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.8

- name: Install dm-script dependencies
run: pip install packaging==20.3 click~=7.0 pyyaml~=5.1 toml
Expand Down Expand Up @@ -144,14 +144,132 @@ jobs:

- run: pip freeze

- name: Setup AiiDA environment
env:
AIIDA_TEST_BACKEND: ${{ matrix.backend }}
run:
.github/workflows/setup.sh
#- name: Setup AiiDA environment # TODO: UNCOMMENT AFTER DEBUGGING!
# env:
# AIIDA_TEST_BACKEND: ${{ matrix.backend }}
# run:
# .github/workflows/setup.sh

#- name: Run test suite # TODO: UNCOMMENT AFTER DEBUGGING!
# env:
# AIIDA_TEST_BACKEND: ${{ matrix.backend }}
# run:
# .github/workflows/tests.sh

- name: Freeze test environment
run: pip freeze | sed '1d' | tee requirements-py-${{ matrix.python-version }}.txt

# Add python-version specific requirements/ file to the requirements.txt artifact.
# The requirements/ files in the artifact can be used to update the repository in case
# that they are inconsistent with the dependency specification in the setup.json file.
# The consistency is checked as part of the next job within this workflow and an attempt
# to automatically create a pull request to update the requirements/* files is created
# in case that they are determined to be inconsistent.
- uses: actions/upload-artifact@v1
if: matrix.backend == 'django' # The requirements are identical between backends.
with:
name: requirements.txt
path: requirements-py-${{ matrix.python-version }}.txt

- name: Run test suite
env:
AIIDA_TEST_BACKEND: ${{ matrix.backend }}
run:
.github/workflows/tests.sh
# The check-requirements job checks whether the requirements/ files are consistent
# with the dependency specification in the setup.json file. If the check fails,
# the user is warned via a commit comment and a warning as part of this actions
# workflow. Furthermore, an attempt is made to automatically create a pull request
# to update the files. This is only possible if this workflow is not run on a pull
# request from a fork.

check-requirements:

needs: tests

runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install dm-script dependencies
run: pip install packaging==20.3 click~=7.0 pyyaml~=5.1 toml

- name: Check consistency of requirements/ files
id: check_reqs
continue-on-error: true
run: python ./utils/dependency_management.py check-requirements DEFAULT --no-github-annotate

#
# The following steps are only executed if the consistency check failed.
#
- name: Create commit comment
if: steps.check_reqs.outcome == 'Failure' # only run if requirements/ are inconsistent
uses: peter-evans/commit-comment@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: setup.json
body: |
The requirements/ files are inconsistent!

# Check out the base branch so that we can prepare the pull request.
- name: Checkout base branch
if: steps.check_reqs.outcome == 'Failure' # only run if requirements/ are inconsistent
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
clean: true

- name: Download requirements.txt files
if: steps.check_reqs.outcome == 'Failure' # only run if requirements/ are inconsistent
uses: actions/download-artifact@v1
with:
name: requirements.txt
path: requirements

- name: Commit requirements files
if: steps.check_reqs.outcome == 'Failure' # only run if requirements/ are inconsistent
run: |
git add requirements/*

- name: Create pull request for updated requirements files
if: steps.check_reqs.outcome == 'Failure' # only run if requirements/ are inconsistent
id: create_update_requirements_pr
continue-on-error: true
uses: peter-evans/create-pull-request@v2
with:
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: update-requirements
commit-message: "Automated update of requirements/ files."
title: "Update requirements/ files."
body: |
Update requirements files to ensure that they are consistent
with the dependencies specified in the 'setup.json' file.

Please note, that this pull request was likely created to
resolve the inconsistency for a specific dependency, however
other versions that have changed since the last update will
be included as part of this commit as well.

Click [here](https://github.com/aiidateam/aiida-core/wiki/AiiDA-Dependency-Management) for more information.

- name: Create PR comment on success
if: steps.create_update_requirements_pr.outcome == 'Success'
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.number }}
body: |
I automatically created a pull request (#${{ steps.create_update_requirements_pr.outputs.pr_number }}) to update the
requirements/ files to ensure that they are consistent with
dependencies specified in the 'setup.json' file.

- name: Create PR comment on failure
if: steps.create_update_requirements_pr.outcome == 'Failure'
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.number }}
body: |
Please update the requirements/ files to ensure that they comply
are consistent with the dependencies specified in the 'setup.json' file.
2 changes: 1 addition & 1 deletion docs/requirements_for_rtd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pyyaml~=5.1.2
reentry~=1.3
seekpath>=1.9.3,~=1.9
simplejson~=3.16
spglib~=1.14
spglib~=1.15
sphinx-rtd-theme~=0.4.3
sphinxcontrib-contentui~=0.2.4
sphinxcontrib-details-directive~=0.1.0
Expand Down
4 changes: 2 additions & 2 deletions setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"pymatgen>=2019.7.2",
"pymysql~=0.9.3",
"seekpath~=1.9,>=1.9.3",
"spglib~=1.14"
"spglib~=1.15"
],
"notebook": [
"jupyter==1.0.0",
Expand Down Expand Up @@ -210,4 +210,4 @@
],
"aiida.workflows": []
}
}
}
Loading