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

Update dependency management workflow #3771

Merged
merged 93 commits into from
Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
b1c7270
Add .github/CODEOWNERS file.
csadorf Feb 18, 2020
070a78d
Rename script 'update_dependencies' to 'dependency_management'.
csadorf Feb 19, 2020
c7601ed
Remove the 'etetoolkit' channel from environment.yml.
csadorf Feb 19, 2020
5d552ea
Implement validate command for dependency management util script.
csadorf Feb 19, 2020
f6604bc
Add explicit dependency validation step to CI.
csadorf Feb 19, 2020
13af1d3
Fix yaml requirement.
csadorf Feb 19, 2020
586adf7
Implement 'generate-conda-environment-file' for dependency_management…
csadorf Feb 20, 2020
c27d2bb
Implement validation of rtd_reqs in dependency_management script.
csadorf Feb 20, 2020
a65a0c8
Implement validate-pyproject-toml in dependency_management script.
csadorf Feb 20, 2020
78a3456
Use pathlib for paths in dependency_management script.
csadorf Feb 20, 2020
f3b5702
Use consistent exception type for dependency specification errors.
csadorf Feb 20, 2020
d9beace
Place loading of 'setup.json' file in function.
csadorf Feb 20, 2020
0f5a60e
Fix bug in 'validate-environment-yml' command implementation.
csadorf Feb 20, 2020
59c64a3
Make implemenation 'validate-environment-yml' more robust.
csadorf Feb 20, 2020
ed8eaf0
Improve error message for 'validate-rtd-reqs' command.
csadorf Feb 20, 2020
364b34c
Implement 'generate-pyproject-toml' dependency management command.
csadorf Feb 20, 2020
e502f42
Regenerate 'environment.yml' and 'docs/requirements_for_rtd.txt' file.
csadorf Feb 20, 2020
e98fd81
Fix bug in 'generate-rtd-reqs' implementation.
csadorf Feb 20, 2020
46d4f24
Improve 'dependency_management.py' script API consistency.
csadorf Feb 20, 2020
420983f
Remove the seperate 'dependency' github action.
csadorf Feb 20, 2020
9b86152
Ignore pylint error related to json.decoder module (false positive).
csadorf Feb 20, 2020
21ed385
Remove dependency management script main help.
csadorf Mar 2, 2020
9b635bd
Implement 'pip-install-extras' command for dependency management script.
csadorf Mar 3, 2020
e03b77f
Vendor toml package in utils directory.
csadorf Mar 3, 2020
f889236
Add test for pip installation.
csadorf Mar 3, 2020
79c962b
Extend test for installation with conda.
csadorf Mar 3, 2020
5063076
Add CI step to show test environment.
csadorf Mar 3, 2020
1f13c4c
Use 'source activate' instead of 'conda activate'.
csadorf Mar 3, 2020
240fcd0
Refactor pip and conda install tests.
csadorf Mar 3, 2020
b6a3c1a
Only run tests if installation succeeds.
csadorf Mar 3, 2020
da60601
Attempt to fix issue with conda env activation.
csadorf Mar 3, 2020
7faa026
Use setup-conda action for conda install.
csadorf Mar 3, 2020
4099efa
Only test on Python 3.7 for conda install.
csadorf Mar 3, 2020
99f8a4d
Fix error in install-with-conda CI step.
csadorf Mar 3, 2020
43261ab
Revert "Vendor toml package in utils directory."
csadorf Mar 3, 2020
dab0bf1
Upload requirements.txt as test artifact.
csadorf Mar 3, 2020
c8fb8bd
Split the DM-related CI steps into separate workflow.
csadorf Mar 4, 2020
969b08b
Automatically create PR for updating requirements.txt
csadorf Mar 4, 2020
e3e3dc7
Execute dm workflow on all branches prefixed with dm/*.
csadorf Mar 4, 2020
b41d942
Temporarily reduce GitHub actions workload for testing.
csadorf Mar 4, 2020
c5202c9
Attempt to fix dm workflow issue likely caused by old checkout versions.
csadorf Mar 4, 2020
66c142f
Be less restrictive about the pull request action version.
csadorf Mar 4, 2020
2e22b9b
Further reduce CI load.
csadorf Mar 4, 2020
eef0b8b
Remove untracked files before creating PR.
csadorf Mar 4, 2020
067b6cb
Use seperate job to create update-requirements PR.
csadorf Mar 4, 2020
e695c54
Fix dm.yml syntax error.
csadorf Mar 4, 2020
1fe0433
Extend list of dm-related files in CODEOWNERS file.
csadorf Mar 4, 2020
b305101
Use @aiidateam/dependency-manager as codeowner and reviewer.
csadorf Mar 4, 2020
aa83ffd
Attempt to fix issue in "update-requirements" job.
csadorf Mar 4, 2020
f801cca
Remove obsolete commands from dependency management script.
csadorf Mar 4, 2020
4ff8daa
2nd attempt at fixing update-requirements job.
csadorf Mar 4, 2020
9f851dc
Disable large portions of the testing ci to speed up debugging.
csadorf Mar 4, 2020
b6e2993
Attempt #3 at fixing update-requirements job.
csadorf Mar 4, 2020
5fb8aac
Attempt #4 at fixing update-requirements job.
csadorf Mar 4, 2020
ae89f5a
Attempt #5 at fixing update-requirements job.
csadorf Mar 4, 2020
b03813a
Attempt #6 at fixing update-requirements job.
csadorf Mar 4, 2020
a9ddbeb
Attempt #7 at fixing update-requirements job.
csadorf Mar 4, 2020
50bf61b
Revert "Disable large portions of the testing ci to speed up debugging."
csadorf Mar 4, 2020
ecf1fd1
Restore previously disabled CI steps.
csadorf Mar 4, 2020
91b1eba
Update requirements.txt
github-actions[bot] Mar 4, 2020
61769f3
Remove obsolete constant in dependency management script.
csadorf Mar 5, 2020
613141a
Update documentation of the dependency management script.
csadorf Mar 5, 2020
98f751b
Add 'validate-dependency-specification' job to dm workflow.
csadorf Mar 5, 2020
d0fb277
Do not run dm workflow on misc/dependency-management branch.
csadorf Mar 5, 2020
469cb37
Apply suggestions from code review
csadorf Mar 6, 2020
5378f7d
Fix generate-pyproject-toml to better preserve current file.
csadorf Mar 6, 2020
17b7e27
Fix definition of pip-install-extras command.
csadorf Mar 6, 2020
15a302a
Add release workflow per suggestion.
csadorf Mar 6, 2020
71011f7
Add backend and python-version specific requirements files.
csadorf Mar 6, 2020
ca5b8d0
Revise workflow as discussed in PR.
csadorf Mar 6, 2020
47c5e13
Disable test suite steps.
csadorf Mar 6, 2020
6d6877e
Fix requirements files.
csadorf Mar 6, 2020
2ea98b5
Install from requirements file with deps.
csadorf Mar 6, 2020
ee30d79
Run 'pip freeze' in test-install workflow.
csadorf Mar 6, 2020
06614ef
Test not fixing numpy in test-install.
csadorf Mar 6, 2020
cbf40f6
Restrict numpy version for py35.
csadorf Mar 6, 2020
8b089a5
fixup! Restrict numpy version for py35.
csadorf Mar 6, 2020
a4fdf0b
Require Cython for builds with Python version 3.5.
csadorf Mar 7, 2020
f7d0153
Make numpy (instead of Cython) build requirement on Python 3.5.
csadorf Mar 7, 2020
8c62b35
Show pip version during ci workflows.
csadorf Mar 7, 2020
653ef11
Attempt to fix installation on Python version 3.5.
csadorf Mar 9, 2020
e8320d4
Merge branch 'develop' into misc/dependency-management
csadorf Mar 9, 2020
d112c2a
Revert "Disable test suite steps."
csadorf Mar 9, 2020
6fb7f3a
Slightly streamline ci workflow.
csadorf Mar 9, 2020
b2ef3e0
Update 'test-install' and 'update-requirements' triggers.
csadorf Mar 9, 2020
519908c
Only store requirements for one backend version (django).
csadorf Mar 9, 2020
0c5d2dc
Remove marker for numpy requirement.
csadorf Mar 9, 2020
1bb8351
Run the two extra workflows on the PR branch for testing.
csadorf Mar 9, 2020
bd2c172
Pin the Click version to 7.0.
csadorf Mar 9, 2020
33ac037
Slightly more explicit step names in test-install workflow.
csadorf Mar 9, 2020
51ecd99
Fix typo in 'test-install' workflow definition.
csadorf Mar 9, 2020
8666471
Merge branch 'develop' into misc/dependency-management
csadorf Mar 9, 2020
75f609a
Revert "Run the two extra workflows on the PR branch for testing."
csadorf Mar 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# All files related to dependency management are owned by the
# currently active dependency manager (DM) to trigger an automatic review
# request from the DM upon changes. Please see AEP-002 for details:
# https://github.com/aiidateam/AEP/tree/master/002_dependency_management
setup.* @aiidateam/dependency-manager
environment.yml @aiidateam/dependency-manager
requirements*.txt @aiidateam/dependency-manager
pyproject.toml @aiidateam/dependency-manager
utils/dependency_management.py @aiidateam/dependency-manager
.github/workflows/dm.yml @aiidateam/dependency-manager
38 changes: 14 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
name: aiida-core
name: continuous-integration

on: [push, pull_request]

jobs:

conda:
csadorf marked this conversation as resolved.
Show resolved Hide resolved

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

steps:
- uses: actions/checkout@master

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

- name: Conda install
env:
PYTHON_VERSION: 3.7
run:
.github/workflows/conda.sh

docs:

runs-on: ubuntu-latest
Expand Down Expand Up @@ -91,8 +72,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.5, 3.8]
backend: ['django', 'sqlalchemy']
python-version: [3.5, 3.8]
ltalirz marked this conversation as resolved.
Show resolved Hide resolved

steps:
- uses: actions/checkout@master
Expand All @@ -119,12 +100,21 @@ jobs:
sudo apt install postgresql-10 rabbitmq-server graphviz
sudo systemctl status rabbitmq-server.service

- name: Install python dependencies
- name: Upgrade pip
run: |
pip install --upgrade pip
pip install numpy==1.17.4
pip install -e .[atomic_tools,docs,notebook,rest,testing]
pip --version

- name: upgrade setuptools [py35]
if: matrix.python-version == 3.5
run: pip install -I setuptools==38.2.0 # Minimally required version for Python 3.5.

- name: Install aiida-core
run: |
pip install -r requirements/requirements-py-${{ matrix.python-version }}.txt
pip install --no-deps -e .
reentry scan
pip freeze

- name: Setup environment
env:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/conda.sh

This file was deleted.

153 changes: 153 additions & 0 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: test-install

on:
push:
branch:
- master
- develop
- release/*
- dm/*
paths:
- 'setup.*'
- 'environment.yml'
- 'requirements*.txt'
ltalirz marked this conversation as resolved.
Show resolved Hide resolved
- 'pyproject.toml'
- '.github/workflows/test-install.yml'
schedule:
- cron: '30 02 * * *' # nightly build

jobs:

validate-dependency-specification:
# Note: The specification is also validated by the pre-commit hook.

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

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.7
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan on harmonizing the use of specific Python version like here in a separate PR.

uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Install dm-script dependencies
ltalirz marked this conversation as resolved.
Show resolved Hide resolved
run: pip install click~=7.0 pyyaml~=5.1 toml

- name: Validate
run: python ./utils/dependency_management.py validate-all

install-with-pip:

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

steps:
- uses: actions/checkout@v2

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

- name: Pip install
run: |
python -m pip install -e .
python -m pip freeze

- name: Test importing aiida
run:
python -c "import aiida"

install-with-conda:

runs-on: ubuntu-latest
name: install-with-conda

timeout-minutes: 5

steps:
- uses: actions/checkout@v2

- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: 3.7
- run: conda --version
ltalirz marked this conversation as resolved.
Show resolved Hide resolved
- run: python --version
- run: which python

- name: Create conda environment
run: |
conda env create -f environment.yml -n test-environment
source activate test-environment
python -m pip install --no-deps -e .

- name: Test importing aiida
run: |
source activate test-environment
python -c "import aiida"

tests:

needs: [install-with-pip, install-with-conda]
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
backend: ['django', 'sqlalchemy']

steps:
- uses: actions/checkout@v2
- uses: CasperWA/postgresql-action@v1.2
with:
postgresql version: '10'
postgresql db: test_${{ matrix.backend }}
postgresql user: postgres
postgresql password: ''
postgresql auth: trust

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
wget -O - "https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc" | sudo apt-key add -
echo 'deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang' | sudo tee -a /etc/apt/sources.list.d/bintray.rabbitmq.list
echo 'deb https://dl.bintray.com/rabbitmq/debian bionic main' | sudo tee -a /etc/apt/sources.list.d/bintray.rabbitmq.list
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 rabbitmq-server graphviz
sudo systemctl status rabbitmq-server.service

- run: pip install --upgrade pip

- name: upgrade setuptools [py35]
if: matrix.python-version == 3.5
run: pip install -I setuptools==38.2.0

- name: Install aiida-core
run: |
pip install -e .[atomic_tools,docs,notebook,rest,testing]
reentry scan

- run: pip freeze

- name: Setup AiiDA 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
104 changes: 104 additions & 0 deletions .github/workflows/update-requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: update-requirements

on:
push:
branch:
- release/*
paths:
- 'setup.json'
- '.github/workflows/update-requirements.yml'

jobs:

tests:

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

strategy:
fail-fast: false
matrix:
backend: ['django', 'sqlalchemy']
python-version: [3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v1
- uses: CasperWA/postgresql-action@v1.2
with:
postgresql version: '10'
postgresql db: test_${{ matrix.backend }}
postgresql user: postgres
postgresql password: ''
postgresql auth: trust

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
wget -O - "https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc" | sudo apt-key add -
echo 'deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang' | sudo tee -a /etc/apt/sources.list.d/bintray.rabbitmq.list
echo 'deb https://dl.bintray.com/rabbitmq/debian bionic main' | sudo tee -a /etc/apt/sources.list.d/bintray.rabbitmq.list
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 rabbitmq-server graphviz
sudo systemctl status rabbitmq-server.service

- run: pip install --upgrade pip

- name: upgrade setuptools [py35]
if: matrix.python-version == 3.5
run: pip install -I setuptools==38.2.0

- name: Install aiida-core
run: |
pip install -e .[atomic_tools,docs,notebook,rest,testing]
reentry scan

- 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: Freeze test environment
csadorf marked this conversation as resolved.
Show resolved Hide resolved
run: pip freeze | sed '1d' | tee requirements-py-${{ matrix.python-version }}.txt

# Add python-version specific requirements file to the requirements.txt artifact.
# Will be used in the next job to create a PR in case they are different from the current version.
- 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

update-requirements:
ltalirz marked this conversation as resolved.
Show resolved Hide resolved

needs: tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Download requirements.txt files
uses: actions/download-artifact@v1
with:
name: requirements.txt
path: requirements

- name: Create Pull Request
uses: peter-evans/create-pull-request@v2
with:
commit-message: "Update requirements.txt"
token: ${{ secrets.GITHUB_TOKEN }}
title: "Update requirements.txt"
team-reviewers: dependency-manager
branch: "dm/update-requirements.txt"
21 changes: 11 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,38 +111,39 @@
entry: prospector

- id: rtd-requirements
name: Requirements for RTD
entry: python ./docs/update_req_for_rtd.py --pre-commit
name: Validate docs/requirements_for_rtd.txt
entry: python ./utils/dependency_management.py validate-rtd-reqs
language: system
files: >-
(?x)^(
setup.json|
setup.py|
utils/dependency_management.py|
docs/requirements_for_rtd.txt|
docs/update_req_for_rtd.py|
)$
pass_filenames: false

- id: pyproject
name: Validating pyproject.toml
entry: python ./utils/validate_consistency.py toml
name: Validate pyproject.toml
entry: python ./utils/dependency_management.py validate-pyproject-toml
language: system
files: >-
(?x)^(
setup.json|
setup.py|
utils/validate_consistency.py|
utils/dependency_management.py|
pyproject.toml
)$
pass_filenames: false
- id: conda
name: Validating environment.yml
entry: python ./utils/validate_consistency.py conda
- id: dependencies
name: Validate environment.yml
entry: python ./utils/dependency_management.py validate-environment-yml
language: system
files: >-
(?x)^(
setup.json|
setup.py|
utils/validate_consistency.py|
utils/dependency_management.py|
environment.yml|
)$
pass_filenames: false
Expand Down
Loading